1 | <?php |
||
8 | class MultilingualRoutePendingRegistration |
||
9 | { |
||
10 | /** |
||
11 | * The handle of the routes. |
||
12 | * |
||
13 | * @var mixed |
||
14 | */ |
||
15 | protected $handle; |
||
16 | |||
17 | /** |
||
18 | * The translation key of the routes. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $key; |
||
23 | |||
24 | /** |
||
25 | * The list of locales for the route. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $locales = []; |
||
30 | |||
31 | /** |
||
32 | * The options of the routes. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $options = []; |
||
37 | |||
38 | /** |
||
39 | * The resource's registration status. |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | protected $registered = false; |
||
44 | |||
45 | /** |
||
46 | * The resource registrar. |
||
47 | * |
||
48 | * @var \Illuminate\Routing\ResourceRegistrar |
||
49 | */ |
||
50 | protected $registrar; |
||
51 | |||
52 | /** |
||
53 | * Constructor of the class. |
||
54 | * |
||
55 | * @param \ChinLeung\LaravelMultilingualRoutes\MultilingualRegistrar $registrar |
||
56 | * @param string $key |
||
57 | * @param mixed $handle |
||
58 | * @param array $locales |
||
59 | * @return void |
||
|
|||
60 | */ |
||
61 | public function __construct(MultilingualRegistrar $registrar, string $key, $handle, array $locales = []) |
||
68 | |||
69 | /** |
||
70 | * Register the resource route. |
||
71 | * |
||
72 | * @return \Illuminate\Routing\RouteCollection |
||
73 | */ |
||
74 | public function register() : RouteCollection |
||
85 | |||
86 | /** |
||
87 | * Add one or many locale to the exception. |
||
88 | * |
||
89 | * @param string|array $locales |
||
90 | * @return self |
||
91 | */ |
||
92 | public function except($locales) : self |
||
101 | |||
102 | /** |
||
103 | * Set the name of the routes. |
||
104 | * |
||
105 | * @param string $name |
||
106 | * @return self |
||
107 | */ |
||
108 | public function name(string $name) : self |
||
114 | |||
115 | /** |
||
116 | * Set the method of the routes. |
||
117 | * |
||
118 | * @param string $method |
||
119 | * @return self |
||
120 | */ |
||
121 | public function method(string $method) : self |
||
127 | |||
128 | /** |
||
129 | * Set the name of each locale for the routes. |
||
130 | * |
||
131 | * @param array $names |
||
132 | * @return self |
||
133 | */ |
||
134 | public function names(array $names) : self |
||
140 | |||
141 | /** |
||
142 | * Set the route for a list of locales only. |
||
143 | * |
||
144 | * @param string|array $locales |
||
145 | * @return self |
||
146 | */ |
||
147 | public function only($locales) : self |
||
156 | |||
157 | /** |
||
158 | * Handle the object's destruction. |
||
159 | * |
||
160 | * @return void |
||
161 | */ |
||
162 | public function __destruct() |
||
168 | } |
||
169 |
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.