@@ -1,54 +1,54 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | return [ |
| 3 | 3 | |
| 4 | - 'logger'=>[ |
|
| 5 | - 'level'=>'debug' |
|
| 6 | - ], |
|
| 4 | + 'logger'=>[ |
|
| 5 | + 'level'=>'debug' |
|
| 6 | + ], |
|
| 7 | 7 | |
| 8 | - 'view'=>[ |
|
| 9 | - 'path'=>[ |
|
| 10 | - '../templates/' |
|
| 11 | - ], |
|
| 8 | + 'view'=>[ |
|
| 9 | + 'path'=>[ |
|
| 10 | + '../templates/' |
|
| 11 | + ], |
|
| 12 | 12 | 'default_template'=>'default', |
| 13 | - 'default_engine'=>'mustache' |
|
| 14 | - ], |
|
| 13 | + 'default_engine'=>'mustache' |
|
| 14 | + ], |
|
| 15 | 15 | |
| 16 | - 'routes' => [ |
|
| 17 | - 'templates' => [ |
|
| 18 | - 'default' => [ |
|
| 19 | - 'ident'=>'default' |
|
| 20 | - ], |
|
| 21 | - 'example' => [ |
|
| 22 | - 'ident'=>'example', |
|
| 23 | - 'controller'=>null, |
|
| 24 | - 'methods'=>['GET'], |
|
| 25 | - 'group'=>null, |
|
| 26 | - 'template'=>'example', |
|
| 27 | - 'engine'=>'mustache', |
|
| 28 | - 'cache'=>[ |
|
| 29 | - 'active'=>true, |
|
| 30 | - 'key'=>'route/{{ident}}/{{lang}}/' |
|
| 31 | - ], |
|
| 32 | - 'options'=>[] |
|
| 33 | - ] |
|
| 34 | - ], |
|
| 35 | - 'actions' => [ |
|
| 36 | - 'default' => [], |
|
| 37 | - 'example' => [ |
|
| 38 | - 'ident'=>'example', |
|
| 39 | - 'controller'=>null, |
|
| 40 | - 'methods'=>['POST'], |
|
| 41 | - 'group'=>null |
|
| 42 | - ] |
|
| 43 | - ], |
|
| 44 | - 'scripts' => [ |
|
| 45 | - 'example' => [ |
|
| 46 | - 'ident'=>'example', |
|
| 47 | - 'controller'=>null, |
|
| 48 | - 'methods'=>['GET'], |
|
| 49 | - 'group'=>null |
|
| 50 | - ] |
|
| 51 | - ] |
|
| 52 | - ] |
|
| 16 | + 'routes' => [ |
|
| 17 | + 'templates' => [ |
|
| 18 | + 'default' => [ |
|
| 19 | + 'ident'=>'default' |
|
| 20 | + ], |
|
| 21 | + 'example' => [ |
|
| 22 | + 'ident'=>'example', |
|
| 23 | + 'controller'=>null, |
|
| 24 | + 'methods'=>['GET'], |
|
| 25 | + 'group'=>null, |
|
| 26 | + 'template'=>'example', |
|
| 27 | + 'engine'=>'mustache', |
|
| 28 | + 'cache'=>[ |
|
| 29 | + 'active'=>true, |
|
| 30 | + 'key'=>'route/{{ident}}/{{lang}}/' |
|
| 31 | + ], |
|
| 32 | + 'options'=>[] |
|
| 33 | + ] |
|
| 34 | + ], |
|
| 35 | + 'actions' => [ |
|
| 36 | + 'default' => [], |
|
| 37 | + 'example' => [ |
|
| 38 | + 'ident'=>'example', |
|
| 39 | + 'controller'=>null, |
|
| 40 | + 'methods'=>['POST'], |
|
| 41 | + 'group'=>null |
|
| 42 | + ] |
|
| 43 | + ], |
|
| 44 | + 'scripts' => [ |
|
| 45 | + 'example' => [ |
|
| 46 | + 'ident'=>'example', |
|
| 47 | + 'controller'=>null, |
|
| 48 | + 'methods'=>['GET'], |
|
| 49 | + 'group'=>null |
|
| 50 | + ] |
|
| 51 | + ] |
|
| 52 | + ] |
|
| 53 | 53 | ]; |
| 54 | 54 | |
@@ -19,18 +19,18 @@ |
||
| 19 | 19 | use LoggerAwareTrait; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * @var array |
|
| 23 | - */ |
|
| 22 | + * @var array |
|
| 23 | + */ |
|
| 24 | 24 | private $config = []; |
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | - * @var SlimApp |
|
| 28 | - */ |
|
| 27 | + * @var SlimApp |
|
| 28 | + */ |
|
| 29 | 29 | private $app; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @param array $data The dependencies container |
|
| 33 | - */ |
|
| 32 | + * @param array $data The dependencies container |
|
| 33 | + */ |
|
| 34 | 34 | public function __construct(array $data) |
| 35 | 35 | { |
| 36 | 36 | $this->set_config($data['config']); |
@@ -20,19 +20,19 @@ discard block |
||
| 20 | 20 | const DEFAULT_MODE = self::MODE_REDIRECT; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * @var string $mode |
|
| 24 | - */ |
|
| 23 | + * @var string $mode |
|
| 24 | + */ |
|
| 25 | 25 | private $mode = self::DEFAULT_MODE; |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * @var boolean $success |
|
| 29 | - */ |
|
| 28 | + * @var boolean $success |
|
| 29 | + */ |
|
| 30 | 30 | private $success = false; |
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | - * @param array $data |
|
| 34 | - * @return AbstractAction Chainable |
|
| 35 | - */ |
|
| 33 | + * @param array $data |
|
| 34 | + * @return AbstractAction Chainable |
|
| 35 | + */ |
|
| 36 | 36 | public function set_data(array $data) |
| 37 | 37 | { |
| 38 | 38 | foreach ($data as $prop => $val) { |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - * @param string $mode |
|
| 57 | - * @throws InvalidArgumentException if mode is not a string |
|
| 58 | - * @return ActionInterface Chainable |
|
| 59 | - */ |
|
| 56 | + * @param string $mode |
|
| 57 | + * @throws InvalidArgumentException if mode is not a string |
|
| 58 | + * @return ActionInterface Chainable |
|
| 59 | + */ |
|
| 60 | 60 | public function set_mode($mode) |
| 61 | 61 | { |
| 62 | 62 | if (!is_string($mode)) { |
@@ -69,18 +69,18 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * @return string |
|
| 73 | - */ |
|
| 72 | + * @return string |
|
| 73 | + */ |
|
| 74 | 74 | public function mode() |
| 75 | 75 | { |
| 76 | 76 | return $this->mode; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | - * @param bool $success |
|
| 81 | - * @throws InvalidArgumentException if success is not a boolean |
|
| 82 | - * @return ActionInterface Chainable |
|
| 83 | - */ |
|
| 80 | + * @param bool $success |
|
| 81 | + * @throws InvalidArgumentException if success is not a boolean |
|
| 82 | + * @return ActionInterface Chainable |
|
| 83 | + */ |
|
| 84 | 84 | public function set_success($success) |
| 85 | 85 | { |
| 86 | 86 | if (!is_bool($success)) { |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | - * @return bool |
|
| 97 | - */ |
|
| 96 | + * @return bool |
|
| 97 | + */ |
|
| 98 | 98 | public function success() |
| 99 | 99 | { |
| 100 | 100 | return $this->success; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | - * @return string |
|
| 105 | - */ |
|
| 104 | + * @return string |
|
| 105 | + */ |
|
| 106 | 106 | abstract public function response(); |
| 107 | 107 | } |
@@ -6,29 +6,29 @@ |
||
| 6 | 6 | { |
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | - * @param string $mode |
|
| 10 | - * @return ActionInterface Chainable |
|
| 11 | - */ |
|
| 9 | + * @param string $mode |
|
| 10 | + * @return ActionInterface Chainable |
|
| 11 | + */ |
|
| 12 | 12 | public function set_mode($mode); |
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | - * @return string |
|
| 16 | - */ |
|
| 15 | + * @return string |
|
| 16 | + */ |
|
| 17 | 17 | public function mode(); |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | - * @param boolean $success |
|
| 21 | - * @return ActionInterface Chainable |
|
| 22 | - */ |
|
| 20 | + * @param boolean $success |
|
| 21 | + * @return ActionInterface Chainable |
|
| 22 | + */ |
|
| 23 | 23 | public function set_success($success); |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | - * @return boolean |
|
| 27 | - */ |
|
| 26 | + * @return boolean |
|
| 27 | + */ |
|
| 28 | 28 | public function success(); |
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | - * @return array |
|
| 32 | - */ |
|
| 31 | + * @return array |
|
| 32 | + */ |
|
| 33 | 33 | public function response(); |
| 34 | 34 | } |
@@ -45,36 +45,36 @@ discard block |
||
| 45 | 45 | use ConfigurableTrait; |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * @var SlimApp $app |
|
| 49 | - */ |
|
| 48 | + * @var SlimApp $app |
|
| 49 | + */ |
|
| 50 | 50 | private $app; |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * @var ModuleManager |
|
| 54 | - */ |
|
| 53 | + * @var ModuleManager |
|
| 54 | + */ |
|
| 55 | 55 | private $module_manager; |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * @var RouteManager |
|
| 59 | - */ |
|
| 58 | + * @var RouteManager |
|
| 59 | + */ |
|
| 60 | 60 | private $route_manager; |
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | - * @var MiddlewareManager |
|
| 64 | - */ |
|
| 63 | + * @var MiddlewareManager |
|
| 64 | + */ |
|
| 65 | 65 | private $middleware_manager; |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * @var LanguageManager |
|
| 69 | - */ |
|
| 68 | + * @var LanguageManager |
|
| 69 | + */ |
|
| 70 | 70 | private $language_manager; |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * # Required dependencies |
|
| 74 | - * - `logger` A PSR-3 logger. |
|
| 75 | - * |
|
| 76 | - * @param array $data |
|
| 77 | - */ |
|
| 73 | + * # Required dependencies |
|
| 74 | + * - `logger` A PSR-3 logger. |
|
| 75 | + * |
|
| 76 | + * @param array $data |
|
| 77 | + */ |
|
| 78 | 78 | public function __construct(array $data) |
| 79 | 79 | { |
| 80 | 80 | $this->set_logger($data['app']->logger); |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | - * @param SlimApp $app |
|
| 89 | - * @return App Chainable |
|
| 90 | - */ |
|
| 88 | + * @param SlimApp $app |
|
| 89 | + * @return App Chainable |
|
| 90 | + */ |
|
| 91 | 91 | public function set_app(SlimApp $app) |
| 92 | 92 | { |
| 93 | 93 | $this->app = $app; |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
| 98 | - * @return ModuleManager |
|
| 99 | - */ |
|
| 98 | + * @return ModuleManager |
|
| 99 | + */ |
|
| 100 | 100 | public function module_manager() |
| 101 | 101 | { |
| 102 | 102 | if ($this->module_manager == null) { |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
| 115 | - * @return RouteManager |
|
| 116 | - */ |
|
| 115 | + * @return RouteManager |
|
| 116 | + */ |
|
| 117 | 117 | public function route_manager() |
| 118 | 118 | { |
| 119 | 119 | if ($this->route_manager === null) { |
@@ -129,8 +129,8 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
| 132 | - * @return MiddlewareManager |
|
| 133 | - */ |
|
| 132 | + * @return MiddlewareManager |
|
| 133 | + */ |
|
| 134 | 134 | public function middleware_manager() |
| 135 | 135 | { |
| 136 | 136 | if ($this->middleware_manager === null) { |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
| 149 | - * @return LanguageManager |
|
| 150 | - */ |
|
| 149 | + * @return LanguageManager |
|
| 150 | + */ |
|
| 151 | 151 | public function language_manager() |
| 152 | 152 | { |
| 153 | 153 | if (!isset($this->language_manager)) { |
@@ -174,8 +174,8 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
| 177 | - * @return App Chainable |
|
| 178 | - */ |
|
| 177 | + * @return App Chainable |
|
| 178 | + */ |
|
| 179 | 179 | public function setup() |
| 180 | 180 | { |
| 181 | 181 | $this->setup_languages(); |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
| 190 | - * @return void |
|
| 191 | - */ |
|
| 190 | + * @return void |
|
| 191 | + */ |
|
| 192 | 192 | protected function setup_languages() |
| 193 | 193 | { |
| 194 | 194 | $language_manager = $this->language_manager(); |
@@ -196,8 +196,8 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | - * @return void |
|
| 200 | - */ |
|
| 199 | + * @return void |
|
| 200 | + */ |
|
| 201 | 201 | protected function setup_middlewares() |
| 202 | 202 | { |
| 203 | 203 | $middleware_manager = $this->middleware_manager(); |
@@ -205,10 +205,10 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
| 208 | - * Set up the app's "global" routes, via a RouteManager |
|
| 209 | - * |
|
| 210 | - * @return void |
|
| 211 | - */ |
|
| 208 | + * Set up the app's "global" routes, via a RouteManager |
|
| 209 | + * |
|
| 210 | + * @return void |
|
| 211 | + */ |
|
| 212 | 212 | protected function setup_routes() |
| 213 | 213 | { |
| 214 | 214 | $route_manager = $this->route_manager(); |
@@ -216,11 +216,11 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /** |
| 219 | - * Set up the app's "global" routables. |
|
| 220 | - * Routables can only be defined globally (app-level) for now. |
|
| 221 | - * |
|
| 222 | - * @return void |
|
| 223 | - */ |
|
| 219 | + * Set up the app's "global" routables. |
|
| 220 | + * Routables can only be defined globally (app-level) for now. |
|
| 221 | + * |
|
| 222 | + * @return void |
|
| 223 | + */ |
|
| 224 | 224 | protected function setup_routables() |
| 225 | 225 | { |
| 226 | 226 | $charcoal = $this; |
@@ -252,8 +252,8 @@ discard block |
||
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | /** |
| 255 | - * @return void |
|
| 256 | - */ |
|
| 255 | + * @return void |
|
| 256 | + */ |
|
| 257 | 257 | protected function setup_modules() |
| 258 | 258 | { |
| 259 | 259 | $module_manager = $this->module_manager(); |
@@ -261,11 +261,11 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
| 264 | - * ConfigurableTrait > create_config() |
|
| 265 | - * |
|
| 266 | - * @param array $data |
|
| 267 | - * @return AppConfig |
|
| 268 | - */ |
|
| 264 | + * ConfigurableTrait > create_config() |
|
| 265 | + * |
|
| 266 | + * @param array $data |
|
| 267 | + * @return AppConfig |
|
| 268 | + */ |
|
| 269 | 269 | public function create_config(array $data = null) |
| 270 | 270 | { |
| 271 | 271 | return new AppConfig($data); |
@@ -13,30 +13,30 @@ discard block |
||
| 13 | 13 | class Language implements LanguageInterface |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * The language identifier, commonly a ISO 639 code |
|
| 17 | - * |
|
| 18 | - * @var string $ident |
|
| 19 | - */ |
|
| 16 | + * The language identifier, commonly a ISO 639 code |
|
| 17 | + * |
|
| 18 | + * @var string $ident |
|
| 19 | + */ |
|
| 20 | 20 | private $ident; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | - * The language name |
|
| 24 | - * |
|
| 25 | - * @var TranslationString $name; |
|
| 26 | - */ |
|
| 23 | + * The language name |
|
| 24 | + * |
|
| 25 | + * @var TranslationString $name; |
|
| 26 | + */ |
|
| 27 | 27 | private $name; |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * The language locale |
|
| 31 | - * |
|
| 32 | - * @var string $locale; |
|
| 33 | - */ |
|
| 30 | + * The language locale |
|
| 31 | + * |
|
| 32 | + * @var string $locale; |
|
| 33 | + */ |
|
| 34 | 34 | private $locale; |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | - * @param array $data |
|
| 38 | - * @return self |
|
| 39 | - */ |
|
| 37 | + * @param array $data |
|
| 38 | + * @return self |
|
| 39 | + */ |
|
| 40 | 40 | public function set_data(array $data) |
| 41 | 41 | { |
| 42 | 42 | if (isset($data['ident']) && $data['ident'] !== null) { |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | - * Set the language identifier |
|
| 53 | - * |
|
| 54 | - * A valid ISO 639 code is recommended (either 639-1, 639-2, or 639-3). |
|
| 55 | - * Within a routable application, the identifier is most often used |
|
| 56 | - * as a base URI path. |
|
| 57 | - * |
|
| 58 | - * @param string $ident Language identifier |
|
| 59 | - * @return self |
|
| 60 | - */ |
|
| 52 | + * Set the language identifier |
|
| 53 | + * |
|
| 54 | + * A valid ISO 639 code is recommended (either 639-1, 639-2, or 639-3). |
|
| 55 | + * Within a routable application, the identifier is most often used |
|
| 56 | + * as a base URI path. |
|
| 57 | + * |
|
| 58 | + * @param string $ident Language identifier |
|
| 59 | + * @return self |
|
| 60 | + */ |
|
| 61 | 61 | public function set_ident($ident) |
| 62 | 62 | { |
| 63 | 63 | $this->ident = $ident; |
@@ -65,30 +65,30 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | - * Get the language identifier |
|
| 69 | - * |
|
| 70 | - * @return string |
|
| 71 | - */ |
|
| 68 | + * Get the language identifier |
|
| 69 | + * |
|
| 70 | + * @return string |
|
| 71 | + */ |
|
| 72 | 72 | public function ident() |
| 73 | 73 | { |
| 74 | 74 | return $this->ident; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Set the name of the language and, optionally, |
|
| 79 | - * the name translated in other languages. |
|
| 80 | - * |
|
| 81 | - * @param TranslationString|array|string $name { |
|
| 82 | - * The language's name in one or more languages. |
|
| 83 | - * |
|
| 84 | - * Accept 3 types of arguments: |
|
| 85 | - * - object (TranslationStringInterface): The data will be copied from the object's. |
|
| 86 | - * - array: All languages available in the array. The format of the array should |
|
| 87 | - * be a hash in the `lang` => `string` format. |
|
| 88 | - * - string: The value will be assigned to the current language. |
|
| 89 | - * } |
|
| 90 | - * @return self |
|
| 91 | - */ |
|
| 78 | + * Set the name of the language and, optionally, |
|
| 79 | + * the name translated in other languages. |
|
| 80 | + * |
|
| 81 | + * @param TranslationString|array|string $name { |
|
| 82 | + * The language's name in one or more languages. |
|
| 83 | + * |
|
| 84 | + * Accept 3 types of arguments: |
|
| 85 | + * - object (TranslationStringInterface): The data will be copied from the object's. |
|
| 86 | + * - array: All languages available in the array. The format of the array should |
|
| 87 | + * be a hash in the `lang` => `string` format. |
|
| 88 | + * - string: The value will be assigned to the current language. |
|
| 89 | + * } |
|
| 90 | + * @return self |
|
| 91 | + */ |
|
| 92 | 92 | public function set_name($name) |
| 93 | 93 | { |
| 94 | 94 | if ($name instanceof TranslationStringInterface) { |
@@ -103,35 +103,35 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | - * Get the name of the language |
|
| 107 | - * |
|
| 108 | - * @return TranslationString |
|
| 109 | - */ |
|
| 106 | + * Get the name of the language |
|
| 107 | + * |
|
| 108 | + * @return TranslationString |
|
| 109 | + */ |
|
| 110 | 110 | public function name() |
| 111 | 111 | { |
| 112 | 112 | return $this->name; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * Alias of self::name() |
|
| 117 | - * |
|
| 118 | - * @return string |
|
| 119 | - */ |
|
| 116 | + * Alias of self::name() |
|
| 117 | + * |
|
| 118 | + * @return string |
|
| 119 | + */ |
|
| 120 | 120 | public function __toString() |
| 121 | 121 | { |
| 122 | 122 | return (string)$this->name(); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | - * Set the language's locale |
|
| 127 | - * |
|
| 128 | - * @link http://www.faqs.org/rfcs/rfc4646.html Tags for Identifying Languages |
|
| 129 | - * @link http://www.faqs.org/rfcs/rfc4647.html Matching of Language Tags |
|
| 130 | - * @param string $ident Language identifier |
|
| 131 | - * @return self |
|
| 132 | - * |
|
| 133 | - * @todo Implement proper ISO 639 sanitization |
|
| 134 | - */ |
|
| 126 | + * Set the language's locale |
|
| 127 | + * |
|
| 128 | + * @link http://www.faqs.org/rfcs/rfc4646.html Tags for Identifying Languages |
|
| 129 | + * @link http://www.faqs.org/rfcs/rfc4647.html Matching of Language Tags |
|
| 130 | + * @param string $ident Language identifier |
|
| 131 | + * @return self |
|
| 132 | + * |
|
| 133 | + * @todo Implement proper ISO 639 sanitization |
|
| 134 | + */ |
|
| 135 | 135 | public function set_locale($locale) |
| 136 | 136 | { |
| 137 | 137 | $this->locale = $locale; |
@@ -139,24 +139,24 @@ discard block |
||
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /** |
| 142 | - * Get the language's locale |
|
| 143 | - * |
|
| 144 | - * @return string |
|
| 145 | - */ |
|
| 142 | + * Get the language's locale |
|
| 143 | + * |
|
| 144 | + * @return string |
|
| 145 | + */ |
|
| 146 | 146 | public function locale() |
| 147 | 147 | { |
| 148 | 148 | return $this->locale; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | - * Get the language's ISO 639-1 (alpha-2) code. |
|
| 153 | - * |
|
| 154 | - * @link http://www.iso.org/iso/home/standards/language_codes.htm for specification |
|
| 155 | - * @return string |
|
| 156 | - * |
|
| 157 | - * @todo Implement proper ISO 639 sanitization |
|
| 158 | - * @todo Added support for retrieving codes in 639-1, 639-2/B, 639-2/T, and 639-3 |
|
| 159 | - */ |
|
| 152 | + * Get the language's ISO 639-1 (alpha-2) code. |
|
| 153 | + * |
|
| 154 | + * @link http://www.iso.org/iso/home/standards/language_codes.htm for specification |
|
| 155 | + * @return string |
|
| 156 | + * |
|
| 157 | + * @todo Implement proper ISO 639 sanitization |
|
| 158 | + * @todo Added support for retrieving codes in 639-1, 639-2/B, 639-2/T, and 639-3 |
|
| 159 | + */ |
|
| 160 | 160 | public function iso639() |
| 161 | 161 | { |
| 162 | 162 | return $this->ident(); |
@@ -5,61 +5,61 @@ |
||
| 5 | 5 | interface LanguageInterface |
| 6 | 6 | { |
| 7 | 7 | /** |
| 8 | - * @param array $data |
|
| 9 | - * @return LanguageInterface Chainable |
|
| 10 | - */ |
|
| 8 | + * @param array $data |
|
| 9 | + * @return LanguageInterface Chainable |
|
| 10 | + */ |
|
| 11 | 11 | public function set_data(array $data); |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * Set the language identifier |
|
| 15 | - * |
|
| 16 | - * @param string $ident |
|
| 17 | - * @return LanguageInterface Chainable |
|
| 18 | - */ |
|
| 14 | + * Set the language identifier |
|
| 15 | + * |
|
| 16 | + * @param string $ident |
|
| 17 | + * @return LanguageInterface Chainable |
|
| 18 | + */ |
|
| 19 | 19 | public function set_ident($ident); |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * Get the language identifier |
|
| 23 | - * |
|
| 24 | - * @return string |
|
| 25 | - */ |
|
| 22 | + * Get the language identifier |
|
| 23 | + * |
|
| 24 | + * @return string |
|
| 25 | + */ |
|
| 26 | 26 | public function ident(); |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * Set the name of the language and, optionally, |
|
| 30 | - * the name translated in other languages. |
|
| 31 | - * |
|
| 32 | - * @param TranslationString|array|string $name |
|
| 33 | - * @return LanguageInterface Chainable |
|
| 34 | - */ |
|
| 29 | + * Set the name of the language and, optionally, |
|
| 30 | + * the name translated in other languages. |
|
| 31 | + * |
|
| 32 | + * @param TranslationString|array|string $name |
|
| 33 | + * @return LanguageInterface Chainable |
|
| 34 | + */ |
|
| 35 | 35 | public function set_name($name); |
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | - * Get the name of the language |
|
| 39 | - * |
|
| 40 | - * @return string |
|
| 41 | - */ |
|
| 38 | + * Get the name of the language |
|
| 39 | + * |
|
| 40 | + * @return string |
|
| 41 | + */ |
|
| 42 | 42 | public function name(); |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Set the language's locale |
|
| 46 | - * |
|
| 47 | - * @param string $ident |
|
| 48 | - * @return LanguageInterface Chainable |
|
| 49 | - */ |
|
| 45 | + * Set the language's locale |
|
| 46 | + * |
|
| 47 | + * @param string $ident |
|
| 48 | + * @return LanguageInterface Chainable |
|
| 49 | + */ |
|
| 50 | 50 | public function set_locale($locale); |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * Get the language's locale |
|
| 54 | - * |
|
| 55 | - * @return string |
|
| 56 | - */ |
|
| 53 | + * Get the language's locale |
|
| 54 | + * |
|
| 55 | + * @return string |
|
| 56 | + */ |
|
| 57 | 57 | public function locale(); |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | - * Get the language's ISO 639 code. |
|
| 61 | - * |
|
| 62 | - * @return string |
|
| 63 | - */ |
|
| 60 | + * Get the language's ISO 639 code. |
|
| 61 | + * |
|
| 62 | + * @return string |
|
| 63 | + */ |
|
| 64 | 64 | public function iso639(); |
| 65 | 65 | } |
@@ -10,8 +10,8 @@ |
||
| 10 | 10 | class MiddlewareManager extends AbstractManager |
| 11 | 11 | { |
| 12 | 12 | /** |
| 13 | - * Set up the middlewares |
|
| 14 | - */ |
|
| 13 | + * Set up the middlewares |
|
| 14 | + */ |
|
| 15 | 15 | public function setup_middlewares() |
| 16 | 16 | { |
| 17 | 17 | // ... |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | // ... |
| 29 | 29 | /** |
| 30 | - * @return void |
|
| 31 | - */ |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | 32 | public function setup() |
| 33 | 33 | { |
| 34 | 34 | $this->setup_middlewares(); |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | - * @return void |
|
| 40 | - */ |
|
| 39 | + * @return void |
|
| 40 | + */ |
|
| 41 | 41 | protected function setup_middlewares() |
| 42 | 42 | { |
| 43 | 43 | $middlewares = $this->config['middlewares']; |
@@ -53,10 +53,10 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | - * Set up the app's "global" routes, via a RouteManager |
|
| 57 | - * |
|
| 58 | - * @return void |
|
| 59 | - */ |
|
| 56 | + * Set up the app's "global" routes, via a RouteManager |
|
| 57 | + * |
|
| 58 | + * @return void |
|
| 59 | + */ |
|
| 60 | 60 | protected function setup_routes() |
| 61 | 61 | { |
| 62 | 62 | $routes = $this->config['routes']; |