
| Current Path : /var/www/html/c12park/vendor/chi-teck/drupal-code-generator/src/Command/PhpStormMeta/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/c12park/vendor/chi-teck/drupal-code-generator/src/Command/PhpStormMeta/States.php |
<?php
declare(strict_types=1);
namespace DrupalCodeGenerator\Command\PhpStormMeta;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
use DrupalCodeGenerator\Asset\File;
/**
* Generates PhpStorm meta-data for Drupal states.
*/
final class States {
/**
* Constructs the object.
*/
public function __construct(
private readonly KeyValueFactoryInterface $keyValueStore,
) {}
/**
* Generator callback.
*/
public function __invoke(): File {
$states = \array_keys($this->keyValueStore->get('state')->getAll());
return File::create('.phpstorm.meta.php/states.php')
->template('states.php.twig')
->vars(['states' => $states]);
}
}