@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | * @throws Route_Exception (code 101) |
36 | 36 | */ |
37 | 37 | private function get_namespace(): string { |
38 | - if ( ! is_string( $this->namespace ) || mb_strlen( $this->namespace ) === 0 ) { |
|
39 | - throw Route_Exception::namespace_not_defined( get_class( $this ) ); |
|
38 | + if ( ! is_string($this->namespace) || mb_strlen($this->namespace) === 0) { |
|
39 | + throw Route_Exception::namespace_not_defined(get_class($this)); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | return $this->namespace; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @throws Route_Exception (code 101) |
50 | 50 | */ |
51 | 51 | private function get_factory(): Route_Factory { |
52 | - return Route_Factory::for( $this->get_namespace() ); |
|
52 | + return Route_Factory::for ($this->get_namespace()); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | * @param Route_Collection $collection |
59 | 59 | * @return Route_Collection |
60 | 60 | */ |
61 | - final public function get_routes( Route_Collection $collection ): Route_Collection { |
|
62 | - $routes = $this->define_routes( $this->get_factory() ); |
|
63 | - foreach ( $routes as $route ) { |
|
64 | - $collection->add_route( $route ); |
|
61 | + final public function get_routes(Route_Collection $collection): Route_Collection { |
|
62 | + $routes = $this->define_routes($this->get_factory()); |
|
63 | + foreach ($routes as $route) { |
|
64 | + $collection->add_route($route); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $collection; |
@@ -73,6 +73,6 @@ discard block |
||
73 | 73 | * @param Route_Factory $factory |
74 | 74 | * @return array<Route|Route_Group> |
75 | 75 | */ |
76 | - abstract protected function define_routes( Route_Factory $factory): array; |
|
76 | + abstract protected function define_routes(Route_Factory $factory): array; |
|
77 | 77 | |
78 | 78 | } |