Skip to content

Commit dd4a498

Browse files
authored
Merge pull request #6 from Howriq/chapter-1
pipeline fix
2 parents 6a0f581 + beff965 commit dd4a498

File tree

3 files changed

+74
-20
lines changed

3 files changed

+74
-20
lines changed

composer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
},
2828
"require": {
2929
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
30+
"dotkernel/dot-cache": "^4.0",
31+
"ramsey/uuid": "^4.5.0",
32+
"ramsey/uuid-doctrine": "^2.1.0",
33+
"roave/psr-container-doctrine": "^5.2.2 || ^6.0.0",
3034
"dotkernel/dot-errorhandler": "^4.4.0",
3135
"laminas/laminas-component-installer": "^3.5.0",
3236
"laminas/laminas-config-aggregator": "^1.17.0",
3337
"mezzio/mezzio": "^3.24.0",
3438
"mezzio/mezzio-fastroute": "^3.13.0",
35-
"mezzio/mezzio-twigrenderer": "^2.17.0",
36-
"dotkernel/dot-cache": "^4.0",
37-
"ramsey/uuid": "^4.5.0",
38-
"ramsey/uuid-doctrine": "^2.1.0",
39-
"roave/psr-container-doctrine": "^5.2.2"
39+
"mezzio/mezzio-twigrenderer": "^2.17.0"
4040
},
4141
"require-dev": {
4242
"filp/whoops": "^2.17.0",
@@ -47,8 +47,7 @@
4747
"phpunit/phpunit": "^10.5.45",
4848
"roave/security-advisories": "dev-master",
4949
"symfony/var-dumper": "^7.2.3",
50-
"vincentlanglet/twig-cs-fixer": "^3.5.1",
51-
"phpstan/phpstan-doctrine": "^2.0.3"
50+
"vincentlanglet/twig-cs-fixer": "^3.5.1"
5251
},
5352
"autoload": {
5453
"psr-4": {

config/autoload/local.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
];
2727

2828
return [
29-
'databases' => $databases,
29+
'databases' => $databases,
3030
'doctrine' => [
3131
'connection' => [
3232
'orm_default' => [

src/App/src/ConfigProvider.php

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,78 @@
66

77
use Doctrine\ORM\EntityManager;
88
use Doctrine\ORM\EntityManagerInterface;
9+
use Doctrine\ORM\Mapping\EntityListenerResolver as EntityListenerResolverInterface;
10+
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
911
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
1012
use Dot\Cache\Adapter\ArrayAdapter;
1113
use Dot\Cache\Adapter\FilesystemAdapter;
1214
use Light\App\Factory\GetIndexViewHandlerFactory;
1315
use Light\App\Handler\GetIndexViewHandler;
1416
use Mezzio\Application;
15-
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
16-
use Ramsey\Uuid\Doctrine\UuidBinaryType;
1717
use Ramsey\Uuid\Doctrine\UuidType;
1818
use Roave\PsrContainerDoctrine\EntityManagerFactory;
19+
use Symfony\Component\Cache\Adapter\AdapterInterface;
1920

2021
use function getcwd;
2122

23+
/**
24+
* @phpstan-type ConfigType array{
25+
* dependencies: DependenciesType,
26+
* doctrine: DoctrineConfigType,
27+
* resultCacheLifetime: int,
28+
* }
29+
* @phpstan-type DoctrineConfigType array{
30+
* cache: array{
31+
* array: array{
32+
* class: class-string<AdapterInterface>,
33+
* },
34+
* filesystem: array{
35+
* class: class-string<AdapterInterface>,
36+
* directory: non-empty-string,
37+
* namespace: non-empty-string,
38+
* },
39+
* },
40+
* configuration: array{
41+
* orm_default: array{
42+
* entity_listener_resolver: class-string<EntityListenerResolverInterface>,
43+
* result_cache: non-empty-string,
44+
* metadata_cache: non-empty-string,
45+
* query_cache: non-empty-string,
46+
* hydration_cache: non-empty-string,
47+
* typed_field_mapper: non-empty-string|null,
48+
* second_level_cache: array{
49+
* enabled: bool,
50+
* default_lifetime: int,
51+
* default_lock_lifetime: int,
52+
* file_lock_region_directory: string,
53+
* regions: string[],
54+
* },
55+
* },
56+
* },
57+
* driver: array{
58+
* orm_default: array{
59+
* class: class-string<MappingDriver>,
60+
* },
61+
* },
62+
* migrations: array{
63+
* migrations_paths: array<non-empty-string, non-empty-string>,
64+
* all_or_nothing: bool,
65+
* check_database_platform: bool,
66+
* },
67+
* types: array<non-empty-string, class-string>,
68+
* }
69+
* @phpstan-type DependenciesType array{
70+
* factories: array<class-string|non-empty-string, class-string|non-empty-string>,
71+
* aliases: array<class-string|non-empty-string, class-string|non-empty-string>,
72+
* }
73+
*/
74+
2275
class ConfigProvider
2376
{
2477
/**
2578
@return array{
2679
* dependencies: array<mixed>,
80+
* doctrine: array<mixed>,
2781
* templates: array<mixed>,
2882
* }
2983
*/
@@ -37,10 +91,7 @@ public function __invoke(): array
3791
}
3892

3993
/**
40-
* @return array{
41-
* delegators: array<class-string, array<class-string>>,
42-
* factories: array<class-string, class-string>,
43-
* }
94+
* @return DependenciesType
4495
*/
4596
public function getDependencies(): array
4697
{
@@ -83,6 +134,9 @@ public function getTemplates(): array
83134
];
84135
}
85136

137+
/**
138+
* @return DoctrineConfigType
139+
*/
86140
private function getDoctrineConfig(): array
87141
{
88142
return [
@@ -98,12 +152,13 @@ private function getDoctrineConfig(): array
98152
],
99153
'configuration' => [
100154
'orm_default' => [
101-
'result_cache' => 'filesystem',
102-
'metadata_cache' => 'filesystem',
103-
'query_cache' => 'filesystem',
104-
'hydration_cache' => 'array',
105-
'typed_field_mapper' => null,
106-
'second_level_cache' => [
155+
'entity_listener_resolver' => EntityListenerResolverInterface::class,
156+
'result_cache' => 'filesystem',
157+
'metadata_cache' => 'filesystem',
158+
'query_cache' => 'filesystem',
159+
'hydration_cache' => 'array',
160+
'typed_field_mapper' => null,
161+
'second_level_cache' => [
107162
'enabled' => true,
108163
'default_lifetime' => 3600,
109164
'default_lock_lifetime' => 60,

0 commit comments

Comments
 (0)