1 | <?php |
||
10 | class MultilingualRegistrar |
||
11 | { |
||
12 | /** |
||
13 | * Constructor of the class. |
||
14 | * |
||
15 | * @param \Illuminate\Routing\Router $router |
||
16 | * @return void |
||
|
|||
17 | */ |
||
18 | public function __construct(Router $router) |
||
22 | |||
23 | /** |
||
24 | * Register the routes. |
||
25 | * |
||
26 | * @param string $key |
||
27 | * @param mixed $handle |
||
28 | * @param array $locales |
||
29 | * @param array $options |
||
30 | * @return \Illuminate\Routing\RouteCollection |
||
31 | */ |
||
32 | public function register(string $key, $handle, array $locales, array $options) : RouteCollection |
||
49 | |||
50 | /** |
||
51 | * Register a single route. |
||
52 | * |
||
53 | * @param string $method |
||
54 | * @param string $key |
||
55 | * @param mixed $handle |
||
56 | * @param string $locale |
||
57 | * @return \Illuminate\Routing\Route |
||
58 | */ |
||
59 | protected function registerRoute(string $method, string $key, $handle, string $locale) : Route |
||
66 | |||
67 | /** |
||
68 | * Retrieve the request method from the options. |
||
69 | * |
||
70 | * @param array $options |
||
71 | * @return string |
||
72 | */ |
||
73 | protected function getRequestMethodFromOptions(array $options) : string |
||
77 | |||
78 | /** |
||
79 | * Generate the name of the route based on the options. |
||
80 | * |
||
81 | * @param string $locale |
||
82 | * @param string $key |
||
83 | * @param array $options |
||
84 | * @return string |
||
85 | */ |
||
86 | protected function generateNameForLocaleFromOptions(string $locale, string $key, array $options) : string |
||
98 | |||
99 | /** |
||
100 | * Generate the prefix of the route based on the options. |
||
101 | * |
||
102 | * @param string $locale |
||
103 | * @return string|null |
||
104 | */ |
||
105 | protected function generatePrefixForLocale(string $locale) : ?string |
||
115 | } |
||
116 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.