@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | public function has(Module $module) : bool |
| 37 | 37 | { |
| 38 | 38 | /** @var Module $m */ |
| 39 | - foreach($this->data as $m) { |
|
| 40 | - if($module->equals($m)){ |
|
| 39 | + foreach ($this->data as $m) { |
|
| 40 | + if ($module->equals($m)) { |
|
| 41 | 41 | return true; |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | public function remove(Module $module) : bool |
| 53 | 53 | { |
| 54 | 54 | /** @var Module $m */ |
| 55 | - foreach($this->data as $index => $m) { |
|
| 56 | - if($module->equals($m)){ |
|
| 55 | + foreach ($this->data as $index => $m) { |
|
| 56 | + if ($module->equals($m)) { |
|
| 57 | 57 | unset($this->data[$index]); |
| 58 | 58 | return true; |
| 59 | 59 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $json = $this->filesystem->read($this->moduleFilePath); |
| 77 | 77 | $moduleData = $this->parseJSON($json); |
| 78 | 78 | // convert the catalog data into a Catalog model |
| 79 | - foreach($moduleData as $moduleItem){ |
|
| 79 | + foreach ($moduleData as $moduleItem) { |
|
| 80 | 80 | $this->data[] = ModuleFactory::create($moduleItem); |
| 81 | 81 | } |
| 82 | 82 | } catch (\Exception $e) { |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function equals(Module $module) : bool |
| 52 | 52 | { |
| 53 | - if($module->getName() !== $this->getName()){ |
|
| 53 | + if ($module->getName() !== $this->getName()) { |
|
| 54 | 54 | return false; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if($module->getNamespace() !== $this->getNamespace()){ |
|
| 57 | + if ($module->getNamespace() !== $this->getNamespace()) { |
|
| 58 | 58 | return false; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -64,6 +64,6 @@ discard block |
||
| 64 | 64 | public function __toJson() |
| 65 | 65 | { |
| 66 | 66 | // ToDo: check if we need to use StdClass |
| 67 | - return json_encode( $this ); |
|
| 67 | + return json_encode($this); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | \ No newline at end of file |