@@ -29,8 +29,8 @@ |
||
| 29 | 29 | public function create(string $moduleName) : LocatorProxyInterface |
| 30 | 30 | { |
| 31 | 31 | $proxy = new LocatorProxy($this->searchableNamespaces, $moduleName); |
| 32 | - if(get_class($proxy->factory()) === EmptyFactory::class |
|
| 33 | - && get_class($proxy->facade()) === EmptyFacade::class){ |
|
| 32 | + if (get_class($proxy->factory()) === EmptyFactory::class |
|
| 33 | + && get_class($proxy->facade()) === EmptyFacade::class) { |
|
| 34 | 34 | throw new NotFoundException(sprintf('Module %s was not found. You need at least a factory or a facade', $moduleName)); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function locate(string $moduleName) : LocatorProxyInterface |
| 36 | 36 | { |
| 37 | - if(!isset($this->proxies[$moduleName])){ |
|
| 37 | + if (!isset($this->proxies[$moduleName])) { |
|
| 38 | 38 | $this->proxies[$moduleName] = $this->factory->create($moduleName); |
| 39 | 39 | } |
| 40 | 40 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function factory(): FactoryInterface |
| 53 | 53 | { |
| 54 | - if($this->factory === null) { |
|
| 54 | + if ($this->factory === null) { |
|
| 55 | 55 | try { |
| 56 | 56 | $className = $this->searchInNamespaces('Factory', FactoryInterface::class); |
| 57 | 57 | } catch (NotFoundException $e) { |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function facade(): FacadeInterface |
| 71 | 71 | { |
| 72 | - if($this->facade === null) { |
|
| 72 | + if ($this->facade === null) { |
|
| 73 | 73 | try { |
| 74 | 74 | $className = $this->searchInNamespaces('Facade', FacadeInterface::class); |
| 75 | 75 | } catch (NotFoundException $e) { |
@@ -90,10 +90,10 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | private function searchInNamespaces(string $expectedClassBaseName, string $expectedInterface) |
| 92 | 92 | { |
| 93 | - foreach($this->searchableNamespaces as $namespace){ |
|
| 93 | + foreach ($this->searchableNamespaces as $namespace) { |
|
| 94 | 94 | $expectedClassName = $namespace . sprintf(self::$classNameSchema, $this->locateName, $expectedClassBaseName); |
| 95 | - if(class_exists($expectedClassName) === true |
|
| 96 | - && in_array($expectedInterface, class_implements($expectedClassName))){ |
|
| 95 | + if (class_exists($expectedClassName) === true |
|
| 96 | + && in_array($expectedInterface, class_implements($expectedClassName))) { |
|
| 97 | 97 | return $expectedClassName; |
| 98 | 98 | } |
| 99 | 99 | } |