From 016fa03ac22595af4cfd8c71230122b508f0dd15 Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Wed, 24 Nov 2021 19:31:59 +0100 Subject: [PATCH] Updated to PHP 8.0. - Release version 1.3.3. - Most property, argument and return types have been defined and are now enforced. - Drone now performs tests for both PHP 7.4 and 8.0. Extend for future versions. --- .drone.yml | 19 ++++++++++++-- .gitattributes | 1 + composer.json | 10 +++---- src/Config/config.routes.php | 4 +-- src/FuzeWorks/Controller.php | 10 +++---- src/FuzeWorks/Controllers.php | 4 +-- src/FuzeWorks/Event/ControllerGetEvent.php | 10 +++---- src/FuzeWorks/Event/ModelGetEvent.php | 10 +++---- src/FuzeWorks/Event/RouterCallViewEvent.php | 14 +++++----- .../Event/RouterLoadCallableEvent.php | 12 ++++----- .../RouterLoadViewAndControllerEvent.php | 18 ++++++------- src/FuzeWorks/Event/ViewGetEvent.php | 14 +++++----- src/FuzeWorks/Model.php | 10 +++---- src/FuzeWorks/Models.php | 4 +-- src/FuzeWorks/Router.php | 26 +++++++++---------- src/FuzeWorks/View.php | 12 ++++----- src/FuzeWorks/Views.php | 6 ++--- test/bootstrap.php | 13 +++++----- ...ler.testdifferentcomponentpathpriority.php | 2 +- ...ler.testdifferentcomponentpathpriority.php | 2 +- test/mcr/ControllersTest.php | 2 +- test/mcr/ModelsTest.php | 2 +- test/mcr/RouterTest.php | 4 +-- test/mcr/ViewsTest.php | 2 +- ...del.testdifferentcomponentpathpriority.php | 2 +- ...del.testdifferentcomponentpathpriority.php | 2 +- ...ard.testdifferentcomponentpathpriority.php | 4 +-- ...ard.testdifferentcomponentpathpriority.php | 4 +-- test/views/view.test.testdefaultcallable.php | 4 +-- ...w.test.testdefaultcallablechangemethod.php | 6 ++--- ...est.testdefaultcallablecustomnamespace.php | 4 +-- .../view.test.testdefaultcallablehalt.php | 4 +-- 32 files changed, 126 insertions(+), 115 deletions(-) diff --git a/.drone.yml b/.drone.yml index 686d8e4..ec6e2a6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,8 +8,23 @@ steps: commands: - composer install - - name: test + - name: php74test image: registry.i15.nl/i15/fuzephp:7.4-alpine commands: - docker-php-ext-enable xdebug - - vendor/bin/phpunit -c test/phpunit.xml \ No newline at end of file + - vendor/bin/phpunit -c test/phpunit.xml + + - name: php80test + image: registry.i15.nl/i15/fuzephp:8.0-alpine + commands: + - docker-php-ext-enable xdebug + - vendor/bin/phpunit -c test/phpunit.xml + + - name: coverage + image: registry.i15.nl/i15/fuzephp:8.0-alpine + commands: + - docker-php-ext-enable xdebug + - vendor/bin/phpunit -c test/phpunit.xml --coverage-text + +image_pull_secrets: + - dockerconfig \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index c7b07b0..12d6755 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ .gitattributes export-ignore .gitignore export-ignore .gitlab-ci.yml export-ignore +.drone.yml export-ignore test/ export-ignore \ No newline at end of file diff --git a/composer.json b/composer.json index 0493d2d..d5ae3a9 100644 --- a/composer.json +++ b/composer.json @@ -4,17 +4,13 @@ "license": ["MIT"], "authors": [ { - "name": "TechFuze", - "homepage": "https://techfuze.net" - }, - { - "name": "FuzeWorks Community", - "homepage": "https://techfuze.net/fuzeworks/contributors" + "name": "Abel Hoogeveen", + "homepage": "https://i15.nl" } ], "require": { "php": ">=7.4.0", - "fuzeworks/core": "~1.2.0" + "fuzeworks/core": "~1.3.0" }, "require-dev": { "phpunit/phpunit": "^9", diff --git a/src/Config/config.routes.php b/src/Config/config.routes.php index 3f4a2e3..1cb9878 100644 --- a/src/Config/config.routes.php +++ b/src/Config/config.routes.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ /** @@ -44,7 +44,7 @@ * Custom callable: Adds a route that sends all matches to the provided callable. Allows user to replace defaultCallable * 'routingString' => array('callable' => array(CALLABLE)) * - * Dynamic rewrite: Adds a route that rewrites an URL to a specific controller and method configuration, using a callable. The callable can dynamically determine which page to load. + * Dynamic rewrite: Adds a route that rewrites a URL to a specific controller and method configuration, using a callable. The callable can dynamically determine which page to load. * 'routingString' => CALLABLE * * Static rewrite: Adds a route that rewrites and URL to a specific controller and method using a fixed route. This allows for pre-determined rewrites of pages. diff --git a/src/FuzeWorks/Controller.php b/src/FuzeWorks/Controller.php index f171162..186fc27 100644 --- a/src/FuzeWorks/Controller.php +++ b/src/FuzeWorks/Controller.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks; @@ -49,22 +49,22 @@ abstract class Controller /** * @var Plugins */ - protected $plugins; + protected Plugins $plugins; /** * @var Libraries */ - protected $libraries; + protected Libraries $libraries; /** * @var Helpers */ - protected $helpers; + protected Helpers $helpers; /** * @var Config */ - protected $config; + protected Config $config; /** * @var Controllers diff --git a/src/FuzeWorks/Controllers.php b/src/FuzeWorks/Controllers.php index 2d54308..dc1c123 100644 --- a/src/FuzeWorks/Controllers.php +++ b/src/FuzeWorks/Controllers.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks; @@ -45,7 +45,7 @@ use FuzeWorks\Exception\NotFoundException; * Controllers Class. * * Simple loader class for MVC Controllers. - * Typically loads controllers from Application\Controller unless otherwise specified. + * Typically, loads controllers from Application\Controller unless otherwise specified. * * @author Abel Hoogeveen * @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net) diff --git a/src/FuzeWorks/Event/ControllerGetEvent.php b/src/FuzeWorks/Event/ControllerGetEvent.php index c9a5782..d2d9085 100644 --- a/src/FuzeWorks/Event/ControllerGetEvent.php +++ b/src/FuzeWorks/Event/ControllerGetEvent.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks\Event; @@ -52,28 +52,28 @@ class ControllerGetEvent extends Event * * @var array */ - public $controllerPaths = array(); + public array $controllerPaths = array(); /** * The name of the controller to be loaded. * * @var string|null */ - public $controllerName = null; + public ?string $controllerName = null; /** * The namespace of the controller to be loaded. Defaults to Application\Controller * * @var string */ - public $namespace = '\Application\Controller\\'; + public string $namespace = '\Application\Controller\\'; /** * Arguments provided to the constructor * * @var array */ - public $arguments = []; + public array $arguments = []; public function init($controllerName, $controllerPaths, $namespace, $arguments) { diff --git a/src/FuzeWorks/Event/ModelGetEvent.php b/src/FuzeWorks/Event/ModelGetEvent.php index 0562149..067512e 100644 --- a/src/FuzeWorks/Event/ModelGetEvent.php +++ b/src/FuzeWorks/Event/ModelGetEvent.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks\Event; @@ -53,28 +53,28 @@ class ModelGetEvent extends Event * * @var array */ - public $modelPaths = array(); + public array $modelPaths = array(); /** * The name of the model to be loaded. * * @var string|null */ - public $modelName = null; + public ?string $modelName = null; /** * The namespace of the model to be loaded. Defaults to Application\Model * * @var string */ - public $namespace = '\Application\Model\\'; + public string $namespace = '\Application\Model\\'; /** * Arguments provided to the constructor * * @var array */ - public $arguments = []; + public array $arguments = []; public function init($modelName, $modelPaths, $namespace, $arguments) { diff --git a/src/FuzeWorks/Event/RouterCallViewEvent.php b/src/FuzeWorks/Event/RouterCallViewEvent.php index 01f5ae4..c3d5940 100644 --- a/src/FuzeWorks/Event/RouterCallViewEvent.php +++ b/src/FuzeWorks/Event/RouterCallViewEvent.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks\Event; @@ -46,7 +46,7 @@ use FuzeWorks\View; * * Use this to cancel the calling of a view method. * - * Currently only used by Router::defaultCallable(); + * Currently, only used by Router::defaultCallable(); * * This event is currently used in the WebComponent project. It allows the component to stop loading when * a CSRFException is thrown, and the view has no method of handling this request @@ -61,35 +61,35 @@ class RouterCallViewEvent extends Event * * @var array */ - public $viewMethods; + public array $viewMethods; /** * The parameters that will be provided to the function in the view * * @var array */ - public $viewParameters; + public array $viewParameters; /** * The route that resulted in this controller and view * * @var string */ - public $route; + public string $route; /** * The view the method will be called on * * @var View */ - public $view; + public View $view; /** * The controller that's associated with this View * * @var Controller */ - public $controller; + public Controller $controller; public function init(View $view, Controller $controller, array $viewMethods, array $viewParameters, string $route) { diff --git a/src/FuzeWorks/Event/RouterLoadCallableEvent.php b/src/FuzeWorks/Event/RouterLoadCallableEvent.php index 96c564f..1a18858 100644 --- a/src/FuzeWorks/Event/RouterLoadCallableEvent.php +++ b/src/FuzeWorks/Event/RouterLoadCallableEvent.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks\Event; @@ -41,9 +41,9 @@ use FuzeWorks\Event; /** * Event that gets fired when a callable is to be loaded by the Router class * - * Use this to cancel the modify the loading of a custom callable or the defaultCallable + * Use this to cancel the modification the loading of a custom callable or the defaultCallable * - * Currently only used by Router::loadCallable(); + * Currently, only used by Router::loadCallable(); * * @author Abel Hoogeveen * @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net) @@ -63,21 +63,21 @@ class RouterLoadCallableEvent extends Event * * @var array */ - public $matches; + public array $matches; /** * The static route configuration * * @var array */ - public $routeData; + public array $routeData; /** * The route which resulted in this callable being loaded * * @var string */ - public $route; + public string $route; public function init(callable $callable, array $matches, array $routeData, string $route) { diff --git a/src/FuzeWorks/Event/RouterLoadViewAndControllerEvent.php b/src/FuzeWorks/Event/RouterLoadViewAndControllerEvent.php index 0bd574d..c4dbaeb 100644 --- a/src/FuzeWorks/Event/RouterLoadViewAndControllerEvent.php +++ b/src/FuzeWorks/Event/RouterLoadViewAndControllerEvent.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks\Event; @@ -44,7 +44,7 @@ use FuzeWorks\Priority; * * Use this to cancel the loading of a combination, or change the details of what is loaded. * - * Currently only used by Router::defaultCallable(); + * Currently, only used by Router::defaultCallable(); * * @author Abel Hoogeveen * @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net) @@ -56,49 +56,49 @@ class RouterLoadViewAndControllerEvent extends Event * * @var string */ - public $viewName; + public string $viewName; /** * The type of view to be loaded * * @var string */ - public $viewType; + public string $viewType; /** * The function that will be loaded in the view * * @var array */ - public $viewMethods; + public array $viewMethods; /** * The parameters that will be provided to the function in the view * * @var array */ - public $viewParameters; + public array $viewParameters; /** * The namespace to use to load the View and Controller * * @var string */ - public $namespacePrefix; + public string $namespacePrefix; /** * The route that resulted in this controller and view * * @var string */ - public $route; + public string $route; /** * A controller to be injected. * * @var Controller|null */ - public $controller; + public ?Controller $controller = null; public function init(string $viewName, string $viewType, array $viewMethods, array $viewParameters, string $namespacePrefix, string $route) { diff --git a/src/FuzeWorks/Event/ViewGetEvent.php b/src/FuzeWorks/Event/ViewGetEvent.php index 9b222fe..b1131b7 100644 --- a/src/FuzeWorks/Event/ViewGetEvent.php +++ b/src/FuzeWorks/Event/ViewGetEvent.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks\Event; @@ -53,40 +53,40 @@ class ViewGetEvent extends Event * * @var array */ - public $viewPaths = []; + public array $viewPaths = []; /** * The name of the view to be loaded. * * @var string|null */ - public $viewName = null; + public ?string $viewName = null; /** * The type of view to be loaded. Eg: html, json, cli. * * @var string|null */ - public $viewType = null; + public ?string $viewType = null; /** * The namespace of the View to be loaded. Defaults to Application\View * * @var string */ - public $namespace = '\Application\View\\'; + public string $namespace = '\Application\View\\'; /** * Arguments provided to the constructor * * @var array */ - public $arguments = []; + public array $arguments = []; /** * @var Controller */ - public $controller; + public Controller $controller; public function init($viewName, $viewType, $viewPaths, $namespace, $controller, $arguments) { diff --git a/src/FuzeWorks/Model.php b/src/FuzeWorks/Model.php index 97278ab..5617493 100644 --- a/src/FuzeWorks/Model.php +++ b/src/FuzeWorks/Model.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks; @@ -50,22 +50,22 @@ abstract class Model /** * @var Plugins */ - protected $plugins; + protected Plugins $plugins; /** * @var Libraries */ - protected $libraries; + protected Libraries $libraries; /** * @var Helpers */ - protected $helpers; + protected Helpers $helpers; /** * @var Config */ - protected $config; + protected Config $config; /** * @var Models diff --git a/src/FuzeWorks/Models.php b/src/FuzeWorks/Models.php index 3ccad6b..37da9d5 100644 --- a/src/FuzeWorks/Models.php +++ b/src/FuzeWorks/Models.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks; @@ -45,7 +45,7 @@ use FuzeWorks\Exception\NotFoundException; * Models Class. * * Simple loader class for MVC Models. - * Typically loads models from Application\Model unless otherwise specified. + * Typically, loads models from Application\Model unless otherwise specified. * * @author Abel Hoogeveen * @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net) diff --git a/src/FuzeWorks/Router.php b/src/FuzeWorks/Router.php index 3aff36b..840b43f 100644 --- a/src/FuzeWorks/Router.php +++ b/src/FuzeWorks/Router.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks; @@ -54,7 +54,7 @@ class Router * * @var array */ - protected $routes = []; + protected array $routes = []; /** * The current callable used @@ -68,10 +68,10 @@ class Router * * @var array|null */ - protected $matches = null; + protected ?array $matches = null; /** - * @var array|null + * @var array|Closure|null */ protected $routeData = null; @@ -80,36 +80,36 @@ class Router * * @var string|null */ - protected $route = null; + protected ?string $route = null; /** * The current View * * @var View|null */ - protected $view = null; + protected ?View $view = null; /** * The current Controller * * @var Controller|null */ - protected $controller = null; + protected ?Controller $controller = null; /** * @var Config */ - private $config; + private Config $config; /** * @var Controllers */ - private $controllers; + private Controllers $controllers; /** * @var Views */ - private $views; + private Views $views; /** * Router constructor. @@ -156,7 +156,7 @@ class Router $routeConfig = ['callable' => [$this, 'defaultCallable']]; } - // Finally add the route + // Finally, add the route $this->addRoute($route, $routeConfig); } } @@ -219,7 +219,7 @@ class Router public function route(string $path, string $category = 'default', array $routes = []) { // Select the routes to use - $globalRoutes = isset($this->routes[$category]) ? $this->routes[$category] : []; + $globalRoutes = $this->routes[$category] ?? []; $routes = empty($routes) ? $globalRoutes : $routes; // Check all the provided custom paths, ordered by priority @@ -423,7 +423,7 @@ class Router if (method_exists($this->view, $method)) { // Execute this method on the view - Logger::newLevel("Calling method '{$method}' on " . get_class($this->view) . ' with ' . get_class($this->controller)); + Logger::newLevel("Calling method '$method' on " . get_class($this->view) . ' with ' . get_class($this->controller)); $output = call_user_func_array([$this->view, $method], $event->viewParameters); Logger::stopLevel(); return $output; diff --git a/src/FuzeWorks/View.php b/src/FuzeWorks/View.php index 268d4e8..87556ad 100644 --- a/src/FuzeWorks/View.php +++ b/src/FuzeWorks/View.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks; @@ -61,29 +61,29 @@ abstract class View /** * @var Plugins */ - protected $plugins; + protected Plugins $plugins; /** * @var Libraries */ - protected $libraries; + protected Libraries $libraries; /** * @var Helpers */ - protected $helpers; + protected Helpers $helpers; /** * @var Config */ - protected $config; + protected Config $config; /** * The controller associated with this view * * @var Controller */ - protected $controller; + protected Controller $controller; /** * Provide the View with its associated Controller diff --git a/src/FuzeWorks/Views.php b/src/FuzeWorks/Views.php index 80638d9..1dcc05c 100644 --- a/src/FuzeWorks/Views.php +++ b/src/FuzeWorks/Views.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace FuzeWorks; @@ -44,7 +44,7 @@ use FuzeWorks\Exception\ViewException; * Views Class. * * Simple loader class for MVC Views. - * Typically loads views from Application\View unless otherwise specified. + * Typically, loads views from Application\View unless otherwise specified. * * @author Abel Hoogeveen * @copyright Copyright (c) 2013 - 2019, TechFuze. (http://techfuze.net) @@ -130,7 +130,7 @@ class Views // If the class already exists, return a new instance directly $class = ucfirst($class); - $className = $namespace . $class . $viewType . 'View'; + $className = $namespace . $class . ucfirst($viewType) . 'View'; if (class_exists($className, true)) { /** @var View $view */ $view = new $className(...$arguments); diff --git a/test/bootstrap.php b/test/bootstrap.php index 7fbe9d7..629626a 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -31,9 +31,11 @@ * @link http://techfuze.net/fuzeworks * @since Version 0.0.1 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ +use FuzeWorks\MVCRComponent; + require_once(dirname(__DIR__) . '/vendor/autoload.php'); $configurator = new FuzeWorks\Configurator(); @@ -44,14 +46,11 @@ $configurator->setLogDirectory(dirname(__FILE__) . '/temp'); // Other values $configurator->setTimeZone('Europe/Amsterdam'); -$configurator->setDebugAddress('NONE'); +$configurator->setDebugAddress(); // Implement the MVCR Component -$configurator->addComponent(new \FuzeWorks\MVCRComponent()); +$configurator->addComponent(new MVCRComponent()); // Create container -$container = $configurator->createContainer(); - -// And return the result -return $container; +return $configurator->createContainer(); diff --git a/test/controllers/TestDifferentComponentPathPriority/Highest/controller.testdifferentcomponentpathpriority.php b/test/controllers/TestDifferentComponentPathPriority/Highest/controller.testdifferentcomponentpathpriority.php index 55e9a81..bf7332f 100644 --- a/test/controllers/TestDifferentComponentPathPriority/Highest/controller.testdifferentcomponentpathpriority.php +++ b/test/controllers/TestDifferentComponentPathPriority/Highest/controller.testdifferentcomponentpathpriority.php @@ -40,5 +40,5 @@ use FuzeWorks\Controller; class TestDifferentComponentPathPriorityController extends Controller { - public $type = 'highest'; + public string $type = 'highest'; } \ No newline at end of file diff --git a/test/controllers/TestDifferentComponentPathPriority/Lowest/controller.testdifferentcomponentpathpriority.php b/test/controllers/TestDifferentComponentPathPriority/Lowest/controller.testdifferentcomponentpathpriority.php index fb552ae..b3c7ea3 100644 --- a/test/controllers/TestDifferentComponentPathPriority/Lowest/controller.testdifferentcomponentpathpriority.php +++ b/test/controllers/TestDifferentComponentPathPriority/Lowest/controller.testdifferentcomponentpathpriority.php @@ -40,5 +40,5 @@ use FuzeWorks\Controller; class TestDifferentComponentPathPriorityController extends Controller { - public $type = 'lowest'; + public string $type = 'lowest'; } \ No newline at end of file diff --git a/test/mcr/ControllersTest.php b/test/mcr/ControllersTest.php index 89a3a45..23c40ff 100644 --- a/test/mcr/ControllersTest.php +++ b/test/mcr/ControllersTest.php @@ -53,7 +53,7 @@ class ControllersTest extends TestCase /** * @var Controllers */ - protected $controllers; + protected Controllers $controllers; public function setUp(): void { diff --git a/test/mcr/ModelsTest.php b/test/mcr/ModelsTest.php index fdd01c8..5c467ca 100644 --- a/test/mcr/ModelsTest.php +++ b/test/mcr/ModelsTest.php @@ -54,7 +54,7 @@ class ModelsTest extends TestCase /** * @var Models */ - protected $models; + protected Models $models; public function setUp(): void { diff --git a/test/mcr/RouterTest.php b/test/mcr/RouterTest.php index b3651c7..15eba5b 100644 --- a/test/mcr/RouterTest.php +++ b/test/mcr/RouterTest.php @@ -55,14 +55,14 @@ class RouterTest extends TestCase * * @var Router */ - protected $router; + protected Router $router; /** * Holds the Config object * * @var Config */ - protected $config; + protected Config $config; public function setUp(): void { diff --git a/test/mcr/ViewsTest.php b/test/mcr/ViewsTest.php index 02515ad..6880ffe 100644 --- a/test/mcr/ViewsTest.php +++ b/test/mcr/ViewsTest.php @@ -55,7 +55,7 @@ class ViewsTest extends TestCase /** * @var Views */ - protected $views; + protected Views $views; /** * @var Controller diff --git a/test/models/TestDifferentComponentPathPriority/Highest/model.testdifferentcomponentpathpriority.php b/test/models/TestDifferentComponentPathPriority/Highest/model.testdifferentcomponentpathpriority.php index c45fee3..6416c15 100644 --- a/test/models/TestDifferentComponentPathPriority/Highest/model.testdifferentcomponentpathpriority.php +++ b/test/models/TestDifferentComponentPathPriority/Highest/model.testdifferentcomponentpathpriority.php @@ -40,5 +40,5 @@ use FuzeWorks\Model; class TestDifferentComponentPathPriorityModel extends Model { - public $type = 'highest'; + public string $type = 'highest'; } \ No newline at end of file diff --git a/test/models/TestDifferentComponentPathPriority/Lowest/model.testdifferentcomponentpathpriority.php b/test/models/TestDifferentComponentPathPriority/Lowest/model.testdifferentcomponentpathpriority.php index b5e8ead..1067586 100644 --- a/test/models/TestDifferentComponentPathPriority/Lowest/model.testdifferentcomponentpathpriority.php +++ b/test/models/TestDifferentComponentPathPriority/Lowest/model.testdifferentcomponentpathpriority.php @@ -40,5 +40,5 @@ use FuzeWorks\Model; class TestDifferentComponentPathPriorityModel extends Model { - public $type = 'lowest'; + public string $type = 'lowest'; } \ No newline at end of file diff --git a/test/views/TestDifferentComponentPathPriority/Highest/view.standard.testdifferentcomponentpathpriority.php b/test/views/TestDifferentComponentPathPriority/Highest/view.standard.testdifferentcomponentpathpriority.php index 796c52f..2ef4fba 100644 --- a/test/views/TestDifferentComponentPathPriority/Highest/view.standard.testdifferentcomponentpathpriority.php +++ b/test/views/TestDifferentComponentPathPriority/Highest/view.standard.testdifferentcomponentpathpriority.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace Application\View; @@ -40,5 +40,5 @@ use FuzeWorks\View; class TestDifferentComponentPathPriorityStandardView extends View { - public $type = 'highest'; + public string $type = 'highest'; } \ No newline at end of file diff --git a/test/views/TestDifferentComponentPathPriority/Lowest/view.standard.testdifferentcomponentpathpriority.php b/test/views/TestDifferentComponentPathPriority/Lowest/view.standard.testdifferentcomponentpathpriority.php index 7f6d0b2..6dabdac 100644 --- a/test/views/TestDifferentComponentPathPriority/Lowest/view.standard.testdifferentcomponentpathpriority.php +++ b/test/views/TestDifferentComponentPathPriority/Lowest/view.standard.testdifferentcomponentpathpriority.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace Application\View; @@ -40,5 +40,5 @@ use FuzeWorks\View; class TestDifferentComponentPathPriorityStandardView extends View { - public $type = 'lowest'; + public string $type = 'lowest'; } \ No newline at end of file diff --git a/test/views/view.test.testdefaultcallable.php b/test/views/view.test.testdefaultcallable.php index 77af446..b4c1978 100644 --- a/test/views/view.test.testdefaultcallable.php +++ b/test/views/view.test.testdefaultcallable.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace Application\View; @@ -41,7 +41,7 @@ use FuzeWorks\View; class TestDefaultCallableTestView extends View { - public function someMethod() + public function someMethod(): string { return "Verify Output"; } diff --git a/test/views/view.test.testdefaultcallablechangemethod.php b/test/views/view.test.testdefaultcallablechangemethod.php index 6943eac..42e55aa 100644 --- a/test/views/view.test.testdefaultcallablechangemethod.php +++ b/test/views/view.test.testdefaultcallablechangemethod.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace Application\View; @@ -40,12 +40,12 @@ use FuzeWorks\View; class TestDefaultCallableChangeMethodTestView extends View { - public function index() + public function index(): string { return "Not altered!"; } - public function altered(string $param1, string $param2) + public function altered(string $param1, string $param2): array { return ["Altered", $param1, $param2]; } diff --git a/test/views/view.test.testdefaultcallablecustomnamespace.php b/test/views/view.test.testdefaultcallablecustomnamespace.php index 9683beb..d822277 100644 --- a/test/views/view.test.testdefaultcallablecustomnamespace.php +++ b/test/views/view.test.testdefaultcallablecustomnamespace.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace Custom\View; @@ -41,7 +41,7 @@ use FuzeWorks\View; class TestDefaultCallableCustomNamespaceTestView extends View { - public function someMethod() + public function someMethod(): string { return "Verify Output, with custom namespace!"; } diff --git a/test/views/view.test.testdefaultcallablehalt.php b/test/views/view.test.testdefaultcallablehalt.php index bd2fb1f..26e5954 100644 --- a/test/views/view.test.testdefaultcallablehalt.php +++ b/test/views/view.test.testdefaultcallablehalt.php @@ -31,7 +31,7 @@ * @link http://techfuze.net/fuzeworks * @since Version 1.2.0 * - * @version Version 1.2.0 + * @version Version 1.3.3 */ namespace Application\View; @@ -40,6 +40,6 @@ use FuzeWorks\View; class TestDefaultCallableHaltTestView extends View { - public $halt = true; + public bool $halt = true; } \ No newline at end of file