@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function boot(SchemaInterface $schema = null) |
| 76 | 76 | { |
| 77 | - if (!is_null($schema)) { |
|
| 77 | + if (!is_null($schema)){ |
|
| 78 | 78 | $this->bootRepositories($schema); |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function bootRepositories(SchemaInterface $schema) |
| 86 | 86 | { |
| 87 | - foreach ($schema->getRoles() as $role) { |
|
| 87 | + foreach ($schema->getRoles() as $role){ |
|
| 88 | 88 | $repository = $schema->define($role, Schema::REPOSITORY); |
| 89 | - if ($repository === Repository::class || $repository === null) { |
|
| 89 | + if ($repository === Repository::class || $repository === null){ |
|
| 90 | 90 | // default repository can not be wired |
| 91 | 91 | continue; |
| 92 | 92 | } |
@@ -125,11 +125,11 @@ discard block |
||
| 125 | 125 | public function getGenerators(): array |
| 126 | 126 | { |
| 127 | 127 | $result = []; |
| 128 | - foreach ($this->generators as $group) { |
|
| 129 | - foreach ($group as $generator) { |
|
| 130 | - if (is_object($generator) && !$generator instanceof Container\Autowire) { |
|
| 128 | + foreach ($this->generators as $group){ |
|
| 129 | + foreach ($group as $generator){ |
|
| 130 | + if (is_object($generator) && !$generator instanceof Container\Autowire){ |
|
| 131 | 131 | $result[] = $generator; |
| 132 | - } else { |
|
| 132 | + }else{ |
|
| 133 | 133 | $result[] = $this->container->get($generator); |
| 134 | 134 | } |
| 135 | 135 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | protected function schema(MemoryInterface $memory): ?SchemaInterface |
| 146 | 146 | { |
| 147 | 147 | $schema = $memory->loadData('cycle'); |
| 148 | - if (is_null($schema)) { |
|
| 148 | + if (is_null($schema)){ |
|
| 149 | 149 | return null; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -74,7 +74,8 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function boot(SchemaInterface $schema = null) |
| 76 | 76 | { |
| 77 | - if (!is_null($schema)) { |
|
| 77 | + if (!is_null($schema)) |
|
| 78 | + { |
|
| 78 | 79 | $this->bootRepositories($schema); |
| 79 | 80 | } |
| 80 | 81 | } |
@@ -84,9 +85,11 @@ discard block |
||
| 84 | 85 | */ |
| 85 | 86 | public function bootRepositories(SchemaInterface $schema) |
| 86 | 87 | { |
| 87 | - foreach ($schema->getRoles() as $role) { |
|
| 88 | + foreach ($schema->getRoles() as $role) |
|
| 89 | + { |
|
| 88 | 90 | $repository = $schema->define($role, Schema::REPOSITORY); |
| 89 | - if ($repository === Repository::class || $repository === null) { |
|
| 91 | + if ($repository === Repository::class || $repository === null) |
|
| 92 | + { |
|
| 90 | 93 | // default repository can not be wired |
| 91 | 94 | continue; |
| 92 | 95 | } |
@@ -125,11 +128,16 @@ discard block |
||
| 125 | 128 | public function getGenerators(): array |
| 126 | 129 | { |
| 127 | 130 | $result = []; |
| 128 | - foreach ($this->generators as $group) { |
|
| 129 | - foreach ($group as $generator) { |
|
| 130 | - if (is_object($generator) && !$generator instanceof Container\Autowire) { |
|
| 131 | + foreach ($this->generators as $group) |
|
| 132 | + { |
|
| 133 | + foreach ($group as $generator) |
|
| 134 | + { |
|
| 135 | + if (is_object($generator) && !$generator instanceof Container\Autowire) |
|
| 136 | + { |
|
| 131 | 137 | $result[] = $generator; |
| 132 | - } else { |
|
| 138 | + } |
|
| 139 | + else |
|
| 140 | + { |
|
| 133 | 141 | $result[] = $this->container->get($generator); |
| 134 | 142 | } |
| 135 | 143 | } |
@@ -145,7 +153,8 @@ discard block |
||
| 145 | 153 | protected function schema(MemoryInterface $memory): ?SchemaInterface |
| 146 | 154 | { |
| 147 | 155 | $schema = $memory->loadData('cycle'); |
| 148 | - if (is_null($schema)) { |
|
| 156 | + if (is_null($schema)) |
|
| 157 | + { |
|
| 149 | 158 | return null; |
| 150 | 159 | } |
| 151 | 160 | |