From 6aa146ddd4a804a57f08496aa1fbdf1283af6474 Mon Sep 17 00:00:00 2001 From: Howriq Date: Thu, 20 Nov 2025 17:32:32 +0200 Subject: [PATCH 1/7] style changes Signed-off-by: Howriq --- composer.json | 13 ++++++------- config/autoload/local.php | 2 +- src/App/src/ConfigProvider.php | 2 -- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index bf3d6f2..ca9f12e 100644 --- a/composer.json +++ b/composer.json @@ -27,16 +27,16 @@ }, "require": { "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "dotkernel/dot-cache": "^4.0", + "ramsey/uuid": "^4.5.0", + "ramsey/uuid-doctrine": "^2.1.0", + "roave/psr-container-doctrine": "^5.2.2 || ^6.0.0", "dotkernel/dot-errorhandler": "^4.4.0", "laminas/laminas-component-installer": "^3.5.0", "laminas/laminas-config-aggregator": "^1.17.0", "mezzio/mezzio": "^3.24.0", "mezzio/mezzio-fastroute": "^3.13.0", - "mezzio/mezzio-twigrenderer": "^2.17.0", - "dotkernel/dot-cache": "^4.0", - "ramsey/uuid": "^4.5.0", - "ramsey/uuid-doctrine": "^2.1.0", - "roave/psr-container-doctrine": "^5.2.2" + "mezzio/mezzio-twigrenderer": "^2.17.0" }, "require-dev": { "filp/whoops": "^2.17.0", @@ -47,8 +47,7 @@ "phpunit/phpunit": "^10.5.45", "roave/security-advisories": "dev-master", "symfony/var-dumper": "^7.2.3", - "vincentlanglet/twig-cs-fixer": "^3.5.1", - "phpstan/phpstan-doctrine": "^2.0.3" + "vincentlanglet/twig-cs-fixer": "^3.5.1" }, "autoload": { "psr-4": { diff --git a/config/autoload/local.php b/config/autoload/local.php index 14cdc54..a58f3f8 100644 --- a/config/autoload/local.php +++ b/config/autoload/local.php @@ -26,7 +26,7 @@ ]; return [ - 'databases' => $databases, + 'databases' => $databases, 'doctrine' => [ 'connection' => [ 'orm_default' => [ diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index 7d0fdaf..6e6835a 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -12,8 +12,6 @@ use Light\App\Factory\GetIndexViewHandlerFactory; use Light\App\Handler\GetIndexViewHandler; use Mezzio\Application; -use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType; -use Ramsey\Uuid\Doctrine\UuidBinaryType; use Ramsey\Uuid\Doctrine\UuidType; use Roave\PsrContainerDoctrine\EntityManagerFactory; From 9a33ab71f51de3452339c309654e6ff52065cdf6 Mon Sep 17 00:00:00 2001 From: Howriq Date: Thu, 20 Nov 2025 17:40:56 +0200 Subject: [PATCH 2/7] pipeline fix Signed-off-by: Howriq --- src/App/src/ConfigProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index 6e6835a..ba3efd5 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -21,7 +21,8 @@ class ConfigProvider { /** @return array{ - * dependencies: array, + * dependencies: array + * doctrine: array, * templates: array, * } */ From 74298d64cd96d061d1c249a48446d0d2d2a1913f Mon Sep 17 00:00:00 2001 From: Howriq Date: Thu, 20 Nov 2025 17:43:00 +0200 Subject: [PATCH 3/7] pipeline fix Signed-off-by: Howriq --- src/App/src/ConfigProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index ba3efd5..d93bafd 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -21,7 +21,7 @@ class ConfigProvider { /** @return array{ - * dependencies: array + * dependencies: array, * doctrine: array, * templates: array, * } From 991bf4755bb354b39d21b8e4dc080b7f70ae29ed Mon Sep 17 00:00:00 2001 From: Howriq Date: Thu, 20 Nov 2025 17:47:38 +0200 Subject: [PATCH 4/7] pipeline fix Signed-off-by: Howriq --- src/App/src/ConfigProvider.php | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index d93bafd..1472a55 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -6,6 +6,8 @@ use Doctrine\ORM\EntityManager; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\ORM\Mapping\EntityListenerResolver as EntityListenerResolverInterface; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; use Dot\Cache\Adapter\ArrayAdapter; use Dot\Cache\Adapter\FilesystemAdapter; @@ -15,8 +17,69 @@ use Ramsey\Uuid\Doctrine\UuidType; use Roave\PsrContainerDoctrine\EntityManagerFactory; +use Symfony\Component\Cache\Adapter\AdapterInterface; use function getcwd; +/** + * @phpstan-type ConfigType array{ + * dependencies: DependenciesType, + * doctrine: DoctrineConfigType, + * resultCacheLifetime: int, + * } + * @phpstan-type DoctrineConfigType array{ + * cache: array{ + * array: array{ + * class: class-string, + * }, + * filesystem: array{ + * class: class-string, + * directory: non-empty-string, + * namespace: non-empty-string, + * }, + * }, + * configuration: array{ + * orm_default: array{ + * entity_listener_resolver: class-string, + * result_cache: non-empty-string, + * metadata_cache: non-empty-string, + * query_cache: non-empty-string, + * hydration_cache: non-empty-string, + * typed_field_mapper: non-empty-string|null, + * second_level_cache: array{ + * enabled: bool, + * default_lifetime: int, + * default_lock_lifetime: int, + * file_lock_region_directory: string, + * regions: non-empty-string[], + * }, + * }, + * }, + * driver: array{ + * orm_default: array{ + * class: class-string, + * }, + * }, + * fixtures: non-empty-string, + * migrations: array{ + * table_storage: array{ + * table_name: non-empty-string, + * version_column_name: non-empty-string, + * version_column_length: int, + * executed_at_column_name: non-empty-string, + * execution_time_column_name: non-empty-string, + * }, + * migrations_paths: array, + * all_or_nothing: bool, + * check_database_platform: bool, + * }, + * types: array, + * } + * @phpstan-type DependenciesType array{ + * factories: array, + * aliases: array, + * } + */ + class ConfigProvider { /** @@ -39,6 +102,7 @@ public function __invoke(): array * @return array{ * delegators: array>, * factories: array, + * aliases: array * } */ public function getDependencies(): array @@ -82,6 +146,9 @@ public function getTemplates(): array ]; } + /** + * @return DoctrineConfigType + */ private function getDoctrineConfig(): array { return [ From 948aa682a1fb8cd6029e4f8c8fe616661a68f5e2 Mon Sep 17 00:00:00 2001 From: Howriq Date: Thu, 20 Nov 2025 17:54:53 +0200 Subject: [PATCH 5/7] pipeline fix Signed-off-by: Howriq --- src/App/src/ConfigProvider.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index 1472a55..c4187f2 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -59,15 +59,7 @@ * class: class-string, * }, * }, - * fixtures: non-empty-string, * migrations: array{ - * table_storage: array{ - * table_name: non-empty-string, - * version_column_name: non-empty-string, - * version_column_length: int, - * executed_at_column_name: non-empty-string, - * execution_time_column_name: non-empty-string, - * }, * migrations_paths: array, * all_or_nothing: bool, * check_database_platform: bool, @@ -99,11 +91,7 @@ public function __invoke(): array } /** - * @return array{ - * delegators: array>, - * factories: array, - * aliases: array - * } + * @return DependenciesType */ public function getDependencies(): array { From 6879e5b66ece2b251b16f8aca5a6b94fb8d2e016 Mon Sep 17 00:00:00 2001 From: Howriq Date: Thu, 20 Nov 2025 18:02:11 +0200 Subject: [PATCH 6/7] pipeline fix Signed-off-by: Howriq --- src/App/src/ConfigProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index c4187f2..7a14f42 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -50,7 +50,7 @@ * default_lifetime: int, * default_lock_lifetime: int, * file_lock_region_directory: string, - * regions: non-empty-string[], + * regions: string[], * }, * }, * }, @@ -152,6 +152,7 @@ private function getDoctrineConfig(): array ], 'configuration' => [ 'orm_default' => [ + 'entity_listener_resolver' => EntityListenerResolverInterface::class, 'result_cache' => 'filesystem', 'metadata_cache' => 'filesystem', 'query_cache' => 'filesystem', From beff965c33d0ee93610f368e8de3ce14728a21ec Mon Sep 17 00:00:00 2001 From: Howriq Date: Thu, 20 Nov 2025 18:04:07 +0200 Subject: [PATCH 7/7] pipeline fix Signed-off-by: Howriq --- src/App/src/ConfigProvider.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App/src/ConfigProvider.php b/src/App/src/ConfigProvider.php index 7a14f42..212099d 100644 --- a/src/App/src/ConfigProvider.php +++ b/src/App/src/ConfigProvider.php @@ -16,8 +16,8 @@ use Mezzio\Application; use Ramsey\Uuid\Doctrine\UuidType; use Roave\PsrContainerDoctrine\EntityManagerFactory; - use Symfony\Component\Cache\Adapter\AdapterInterface; + use function getcwd; /** @@ -153,12 +153,12 @@ private function getDoctrineConfig(): array 'configuration' => [ 'orm_default' => [ 'entity_listener_resolver' => EntityListenerResolverInterface::class, - 'result_cache' => 'filesystem', - 'metadata_cache' => 'filesystem', - 'query_cache' => 'filesystem', - 'hydration_cache' => 'array', - 'typed_field_mapper' => null, - 'second_level_cache' => [ + 'result_cache' => 'filesystem', + 'metadata_cache' => 'filesystem', + 'query_cache' => 'filesystem', + 'hydration_cache' => 'array', + 'typed_field_mapper' => null, + 'second_level_cache' => [ 'enabled' => true, 'default_lifetime' => 3600, 'default_lock_lifetime' => 60,