@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | public function addPlugin($class) |
| 21 | 21 | { |
| 22 | - if(!is_subclass_of($class, Plugin::class)) { |
|
| 23 | - throw new Exception("Plugin should extend " . Plugin::class . " class"); |
|
| 22 | + if (!is_subclass_of($class, Plugin::class)) { |
|
| 23 | + throw new Exception("Plugin should extend ".Plugin::class." class"); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $plugin = is_object($class) ? $class : new $class($this); |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function findRepository(Entity $instance) |
| 50 | 50 | { |
| 51 | - foreach($this->getSchema()->getSpaces() as $space) { |
|
| 52 | - if($space->getRepository()->knows($instance)) { |
|
| 51 | + foreach ($this->getSchema()->getSpaces() as $space) { |
|
| 52 | + if ($space->getRepository()->knows($instance)) { |
|
| 53 | 53 | return $space->getRepository(); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function getPlugin($class) |
| 71 | 71 | { |
| 72 | - if(!array_key_exists($class, $this->plugins)) { |
|
| 72 | + if (!array_key_exists($class, $this->plugins)) { |
|
| 73 | 73 | throw new Exception("No plugin $class"); |
| 74 | 74 | } |
| 75 | 75 | return $this->plugins[$class]; |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | public function getRepositories() |
| 89 | 89 | { |
| 90 | 90 | $repositories = []; |
| 91 | - foreach($this->getSchema()->getSpaces() as $space) { |
|
| 92 | - if($space->repositoryExists()) { |
|
| 91 | + foreach ($this->getSchema()->getSpaces() as $space) { |
|
| 92 | + if ($space->repositoryExists()) { |
|
| 93 | 93 | $repositories[] = $space->getRepository(); |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | public function remove($space, $params = []) |
| 105 | 105 | { |
| 106 | - if($space instanceof Entity) { |
|
| 106 | + if ($space instanceof Entity) { |
|
| 107 | 107 | $this->findRepository($space)->removeEntity($space); |
| 108 | 108 | |
| 109 | 109 | } else { |