@@ -42,9 +42,9 @@ |
||
42 | 42 | |
43 | 43 | DirectoriesInterface $dirs, |
44 | 44 | FilesInterface $files |
45 | - ) { |
|
45 | + ){ |
|
46 | 46 | return new FileSnapshotter( |
47 | - $dirs->get('runtime') . '/snapshots/', |
|
47 | + $dirs->get('runtime').'/snapshots/', |
|
48 | 48 | $env->get('SNAPSHOT_MAX_FILES', self::MAX_SNAPSHOTS), |
49 | 49 | $env->get('SNAPSHOT_VERBOSITY', HandlerInterface::VERBOSITY_VERBOSE), |
50 | 50 | new HtmlHandler(), |
@@ -58,8 +58,8 @@ |
||
58 | 58 | */ |
59 | 59 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
60 | 60 | { |
61 | - if (!$dirs->has('locale')) { |
|
62 | - $dirs->set('locale', $dirs->get('app') . 'locale/'); |
|
61 | + if (!$dirs->has('locale')){ |
|
62 | + $dirs->set('locale', $dirs->get('app').'locale/'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $this->config->setDefaults('translator', [ |
@@ -58,7 +58,8 @@ |
||
58 | 58 | */ |
59 | 59 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
60 | 60 | { |
61 | - if (!$dirs->has('locale')) { |
|
61 | + if (!$dirs->has('locale')) |
|
62 | + { |
|
62 | 63 | $dirs->set('locale', $dirs->get('app') . 'locale/'); |
63 | 64 | } |
64 | 65 |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
44 | 44 | { |
45 | - if (!$dirs->has('views')) { |
|
46 | - $dirs->set('views', $dirs->get('app') . 'views'); |
|
45 | + if (!$dirs->has('views')){ |
|
46 | + $dirs->set('views', $dirs->get('app').'views'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | // default view config |
50 | 50 | $this->config->setDefaults('views', [ |
51 | 51 | 'cache' => [ |
52 | 52 | 'enabled' => !$env->get('DEBUG', false), |
53 | - 'directory' => $dirs->get('cache') . 'views' |
|
53 | + 'directory' => $dirs->get('cache').'views' |
|
54 | 54 | ], |
55 | 55 | 'namespaces' => [ |
56 | 56 | 'default' => [$dirs->get('views')] |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function addDirectory(string $namespace, string $directory) |
68 | 68 | { |
69 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
69 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])){ |
|
70 | 70 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
71 | 71 | } |
72 | 72 | |
73 | - $this->config->modify('views', new Append('namespaces.' . $namespace, null, $directory)); |
|
73 | + $this->config->modify('views', new Append('namespaces.'.$namespace, null, $directory)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -42,7 +42,8 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs) |
44 | 44 | { |
45 | - if (!$dirs->has('views')) { |
|
45 | + if (!$dirs->has('views')) |
|
46 | + { |
|
46 | 47 | $dirs->set('views', $dirs->get('app') . 'views'); |
47 | 48 | } |
48 | 49 | |
@@ -66,7 +67,8 @@ discard block |
||
66 | 67 | */ |
67 | 68 | public function addDirectory(string $namespace, string $directory) |
68 | 69 | { |
69 | - if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) { |
|
70 | + if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) |
|
71 | + { |
|
70 | 72 | $this->config->modify('views', new Append('namespaces', $namespace, [])); |
71 | 73 | } |
72 | 74 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $finalizer->addFinalizer(function () use ($container) { |
29 | 29 | /** @var DatabaseManager $dbal */ |
30 | 30 | $dbal = $container->get(DatabaseManager::class); |
31 | - foreach ($dbal->getDrivers() as $driver) { |
|
31 | + foreach ($dbal->getDrivers() as $driver){ |
|
32 | 32 | $driver->disconnect(); |
33 | 33 | } |
34 | 34 | }); |
@@ -25,10 +25,12 @@ |
||
25 | 25 | */ |
26 | 26 | public function boot(FinalizerInterface $finalizer, ContainerInterface $container) |
27 | 27 | { |
28 | - $finalizer->addFinalizer(function () use ($container) { |
|
28 | + $finalizer->addFinalizer(function () use ($container) |
|
29 | + { |
|
29 | 30 | /** @var DatabaseManager $dbal */ |
30 | 31 | $dbal = $container->get(DatabaseManager::class); |
31 | - foreach ($dbal->getDrivers() as $driver) { |
|
32 | + foreach ($dbal->getDrivers() as $driver) |
|
33 | + { |
|
32 | 34 | $driver->disconnect(); |
33 | 35 | } |
34 | 36 | }); |
@@ -35,9 +35,9 @@ |
||
35 | 35 | ConfiguratorInterface $config, |
36 | 36 | EnvironmentInterface $env, |
37 | 37 | DirectoriesInterface $dirs |
38 | - ) { |
|
39 | - if (!$dirs->has('migrations')) { |
|
40 | - $dirs->set('migrations', $dirs->get('app') . 'migrations'); |
|
38 | + ){ |
|
39 | + if (!$dirs->has('migrations')){ |
|
40 | + $dirs->set('migrations', $dirs->get('app').'migrations'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | $config->setDefaults('migration', [ |
@@ -36,7 +36,8 @@ |
||
36 | 36 | EnvironmentInterface $env, |
37 | 37 | DirectoriesInterface $dirs |
38 | 38 | ) { |
39 | - if (!$dirs->has('migrations')) { |
|
39 | + if (!$dirs->has('migrations')) |
|
40 | + { |
|
40 | 41 | $dirs->set('migrations', $dirs->get('app') . 'migrations'); |
41 | 42 | } |
42 | 43 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function boot(Container $container, FinalizerInterface $finalizer) |
40 | 40 | { |
41 | 41 | $finalizer->addFinalizer(function () use ($container) { |
42 | - if ($container->hasInstance(ORMInterface::class)) { |
|
42 | + if ($container->hasInstance(ORMInterface::class)){ |
|
43 | 43 | $container->get(ORMInterface::class)->getHeap()->clean(); |
44 | 44 | } |
45 | 45 | }); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ): ORMInterface { |
81 | 81 | $orm = new ORM($factory, $schema); |
82 | 82 | |
83 | - if ($promiseFactory !== null) { |
|
83 | + if ($promiseFactory !== null){ |
|
84 | 84 | return $orm->withPromiseFactory($promiseFactory); |
85 | 85 | } |
86 | 86 |
@@ -38,8 +38,10 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function boot(Container $container, FinalizerInterface $finalizer) |
40 | 40 | { |
41 | - $finalizer->addFinalizer(function () use ($container) { |
|
42 | - if ($container->hasInstance(ORMInterface::class)) { |
|
41 | + $finalizer->addFinalizer(function () use ($container) |
|
42 | + { |
|
43 | + if ($container->hasInstance(ORMInterface::class)) |
|
44 | + { |
|
43 | 45 | $container->get(ORMInterface::class)->getHeap()->clean(); |
44 | 46 | } |
45 | 47 | }); |
@@ -80,7 +82,8 @@ discard block |
||
80 | 82 | ): ORMInterface { |
81 | 83 | $orm = new ORM($factory, $schema); |
82 | 84 | |
83 | - if ($promiseFactory !== null) { |
|
85 | + if ($promiseFactory !== null) |
|
86 | + { |
|
84 | 87 | return $orm->withPromiseFactory($promiseFactory); |
85 | 88 | } |
86 | 89 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function boot(SchemaInterface $schema = null) |
80 | 80 | { |
81 | - if (!is_null($schema)) { |
|
81 | + if (!is_null($schema)){ |
|
82 | 82 | $this->bootRepositories($schema); |
83 | 83 | } |
84 | 84 | } |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function bootRepositories(SchemaInterface $schema) |
90 | 90 | { |
91 | - foreach ($schema->getRoles() as $role) { |
|
91 | + foreach ($schema->getRoles() as $role){ |
|
92 | 92 | $repository = $schema->define($role, Schema::REPOSITORY); |
93 | - if ($repository === Repository::class || $repository === null) { |
|
93 | + if ($repository === Repository::class || $repository === null){ |
|
94 | 94 | // default repository can not be wired |
95 | 95 | continue; |
96 | 96 | } |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | public function getGenerators(): array |
129 | 129 | { |
130 | 130 | $result = []; |
131 | - foreach ($this->generators as $generator) { |
|
132 | - if (is_object($generator) && !$generator instanceof Container\Autowire) { |
|
131 | + foreach ($this->generators as $generator){ |
|
132 | + if (is_object($generator) && !$generator instanceof Container\Autowire){ |
|
133 | 133 | $result[] = $generator; |
134 | - } else { |
|
134 | + }else{ |
|
135 | 135 | $result[] = $this->container->get($generator); |
136 | 136 | } |
137 | 137 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | protected function schema(MemoryInterface $memory): ?SchemaInterface |
147 | 147 | { |
148 | 148 | $schema = $memory->loadData('cycle'); |
149 | - if (is_null($schema)) { |
|
149 | + if (is_null($schema)){ |
|
150 | 150 | return null; |
151 | 151 | } |
152 | 152 |
@@ -78,7 +78,8 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function boot(SchemaInterface $schema = null) |
80 | 80 | { |
81 | - if (!is_null($schema)) { |
|
81 | + if (!is_null($schema)) |
|
82 | + { |
|
82 | 83 | $this->bootRepositories($schema); |
83 | 84 | } |
84 | 85 | } |
@@ -88,9 +89,11 @@ discard block |
||
88 | 89 | */ |
89 | 90 | public function bootRepositories(SchemaInterface $schema) |
90 | 91 | { |
91 | - foreach ($schema->getRoles() as $role) { |
|
92 | + foreach ($schema->getRoles() as $role) |
|
93 | + { |
|
92 | 94 | $repository = $schema->define($role, Schema::REPOSITORY); |
93 | - if ($repository === Repository::class || $repository === null) { |
|
95 | + if ($repository === Repository::class || $repository === null) |
|
96 | + { |
|
94 | 97 | // default repository can not be wired |
95 | 98 | continue; |
96 | 99 | } |
@@ -128,10 +131,14 @@ discard block |
||
128 | 131 | public function getGenerators(): array |
129 | 132 | { |
130 | 133 | $result = []; |
131 | - foreach ($this->generators as $generator) { |
|
132 | - if (is_object($generator) && !$generator instanceof Container\Autowire) { |
|
134 | + foreach ($this->generators as $generator) |
|
135 | + { |
|
136 | + if (is_object($generator) && !$generator instanceof Container\Autowire) |
|
137 | + { |
|
133 | 138 | $result[] = $generator; |
134 | - } else { |
|
139 | + } |
|
140 | + else |
|
141 | + { |
|
135 | 142 | $result[] = $this->container->get($generator); |
136 | 143 | } |
137 | 144 | } |
@@ -146,7 +153,8 @@ discard block |
||
146 | 153 | protected function schema(MemoryInterface $memory): ?SchemaInterface |
147 | 154 | { |
148 | 155 | $schema = $memory->loadData('cycle'); |
149 | - if (is_null($schema)) { |
|
156 | + if (is_null($schema)) |
|
157 | + { |
|
150 | 158 | return null; |
151 | 159 | } |
152 | 160 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | string $header, |
94 | 94 | string $footer = '', |
95 | 95 | array $options = [] |
96 | - ) { |
|
96 | + ){ |
|
97 | 97 | $this->config->modify( |
98 | 98 | 'console', |
99 | 99 | $this->sequence('configure', $sequence, $header, $footer, $options) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | string $header, |
112 | 112 | string $footer = '', |
113 | 113 | array $options = [] |
114 | - ) { |
|
114 | + ){ |
|
115 | 115 | $this->config->modify( |
116 | 116 | 'console', |
117 | 117 | $this->sequence('update', $sequence, $header, $footer, $options) |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | string $footer, |
134 | 134 | array $options |
135 | 135 | ): Append { |
136 | - if (is_array($sequence) || $sequence instanceof \Closure) { |
|
136 | + if (is_array($sequence) || $sequence instanceof \Closure){ |
|
137 | 137 | return new Append( |
138 | 138 | $target, |
139 | 139 | null, |
@@ -133,7 +133,8 @@ |
||
133 | 133 | string $footer, |
134 | 134 | array $options |
135 | 135 | ): Append { |
136 | - if (is_array($sequence) || $sequence instanceof \Closure) { |
|
136 | + if (is_array($sequence) || $sequence instanceof \Closure) |
|
137 | + { |
|
137 | 138 | return new Append( |
138 | 139 | $target, |
139 | 140 | null, |
@@ -37,13 +37,13 @@ |
||
37 | 37 | ConfiguratorInterface $config, |
38 | 38 | HttpBootloader $http, |
39 | 39 | DirectoriesInterface $directories |
40 | - ) { |
|
40 | + ){ |
|
41 | 41 | $config->setDefaults('session', [ |
42 | 42 | 'lifetime' => 86400, |
43 | 43 | 'cookie' => 'sid', |
44 | 44 | 'secure' => false, |
45 | 45 | 'handler' => new Autowire(FileHandler::class, [ |
46 | - 'directory' => $directories->get('runtime') . 'session', |
|
46 | + 'directory' => $directories->get('runtime').'session', |
|
47 | 47 | 'lifetime' => 86400 |
48 | 48 | ] |
49 | 49 | ) |