Skip to content

Commit 348bd22

Browse files
authored
Merge pull request #205 from Chi-teck/phpstorm_test_fix
add back cron run before states query
2 parents 6fba282 + 295753f commit 348bd22

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Command/PhpStormMeta/PhpStormMeta.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function generate(array &$vars, Assets $assets): void {
7676
$assets[] = (new Routes($this->getHelper('route_info')))();
7777
$assets[] = (new Services($this->getHelper('service_info')))();
7878
$assets[] = (new Settings())();
79-
$assets[] = (new States($service('keyvalue')))();
79+
$assets[] = (new States($service('keyvalue'), $service('cron')))();
8080
}
8181

8282
/**

src/Command/PhpStormMeta/States.php

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace DrupalCodeGenerator\Command\PhpStormMeta;
66

7+
use Drupal\Core\CronInterface;
78
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
89
use DrupalCodeGenerator\Asset\File;
910

@@ -17,12 +18,14 @@ final class States {
1718
*/
1819
public function __construct(
1920
private readonly KeyValueFactoryInterface $keyValueStore,
21+
private readonly CronInterface $cron,
2022
) {}
2123

2224
/**
2325
* Generator callback.
2426
*/
2527
public function __invoke(): File {
28+
$this->cron->run();
2629
$states = \array_keys($this->keyValueStore->get('state')->getAll());
2730
return File::create('.phpstorm.meta.php/states.php')
2831
->template('states.php.twig')

0 commit comments

Comments
 (0)