diff --git a/src/Aviat/AnimeClient/Config.php b/src/Aviat/AnimeClient/Config.php index 1429660f..2b129750 100644 --- a/src/Aviat/AnimeClient/Config.php +++ b/src/Aviat/AnimeClient/Config.php @@ -17,7 +17,7 @@ class Config { /** * Config object * - * @var Aviat\Ion\Type\ArrayType + * @var \Aviat\Ion\Type\ArrayType */ protected $map = []; @@ -84,7 +84,7 @@ class Config { { $this->map->set($key, $value); } - else throw + else throw new InvalidArgumentException("Key must be integer, string, or array, and cannot be empty"); return $this; diff --git a/src/Aviat/AnimeClient/Controller.php b/src/Aviat/AnimeClient/Controller.php index 949b945a..be74da07 100644 --- a/src/Aviat/AnimeClient/Controller.php +++ b/src/Aviat/AnimeClient/Controller.php @@ -198,7 +198,7 @@ class Controller { * * @param string $template * @param array $data - * @param HtmlView $view + * @param HtmlView|null $view * @return void */ protected function outputHTML($template, array $data = [], $view = NULL) diff --git a/src/Aviat/AnimeClient/UrlGenerator.php b/src/Aviat/AnimeClient/UrlGenerator.php index 73a401a4..b2e0806d 100644 --- a/src/Aviat/AnimeClient/UrlGenerator.php +++ b/src/Aviat/AnimeClient/UrlGenerator.php @@ -74,9 +74,10 @@ class UrlGenerator extends RoutingBase { // Remove any optional parameters from the route // and replace them with existing route parameters, if they exist $path_segments = explode('/', $path); + $segment_count = count($path_segments); $segments = $this->segments(); - for ($i = 0; $i < count($path_segments); $i++) + for ($i = 0; $i < $segment_count; $i++) { if ( ! array_key_exists($i + 1, $segments)) {