You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
extract ConfigType phpstan-type
This commit is contained in:
@@ -7,15 +7,38 @@
|
||||
|
||||
namespace Flasher\Prime\Config;
|
||||
|
||||
/**
|
||||
* @phpstan-type ConfigType array{
|
||||
* default: string,
|
||||
* root_script: string,
|
||||
* themes: array<string, array{
|
||||
* view: string,
|
||||
* styles: string[],
|
||||
* scripts: string[],
|
||||
* options: array<string, mixed>,
|
||||
* }>,
|
||||
* auto_translate: bool,
|
||||
* flash_bag?: array{
|
||||
* enabled: bool,
|
||||
* mapping: array<string, string>,
|
||||
* },
|
||||
* presets: array<string, array{
|
||||
* type: string,
|
||||
* title: string,
|
||||
* message: string,
|
||||
* options: array<string, mixed>,
|
||||
* }>,
|
||||
* }
|
||||
*/
|
||||
final class Config implements ConfigInterface
|
||||
{
|
||||
/**
|
||||
* @var array<string, mixed>
|
||||
* @phpstan-var ConfigType
|
||||
*/
|
||||
private $config;
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $config
|
||||
* @phpstan-param ConfigType $config
|
||||
*/
|
||||
public function __construct(array $config = array())
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
namespace Flasher\Symfony\DependencyInjection;
|
||||
|
||||
use Flasher\Prime\Config\Config;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
@@ -14,21 +15,7 @@ use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
/**
|
||||
* @phpstan-type ConfigType array{
|
||||
* default: string,
|
||||
* root_script: string,
|
||||
* themes: array<string, array{
|
||||
* view: string,
|
||||
* styles: string[],
|
||||
* scripts: string[],
|
||||
* options: array<string, mixed>,
|
||||
* }>,
|
||||
* translate_by_default: bool,
|
||||
* flash_bag?: array{
|
||||
* enabled: bool,
|
||||
* mapping: array<string, string>,
|
||||
* },
|
||||
* }
|
||||
* @phpstan-import-type ConfigType from Config
|
||||
*/
|
||||
final class FlasherExtension extends Extension implements CompilerPassInterface
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user