Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ before_script:
- mkdir -p build/logs
script:
- composer cs-check
- composer phpstan
- ./vendor/bin/phpunit

after_script:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"scripts": {
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"phpstan": "phpstan analyse src -c phpstan.neon --level=0 --no-progress -vvv"
"phpstan": "phpstan analyse src -c phpstan.neon --level=5 --no-progress -vvv"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
23 changes: 0 additions & 23 deletions src/TheCodingMachine/Splash/Controllers/Controller.php

This file was deleted.

26 changes: 0 additions & 26 deletions src/TheCodingMachine/Splash/Controllers/DefaultSplashTemplate.php

This file was deleted.

86 changes: 0 additions & 86 deletions src/TheCodingMachine/Splash/HtmlResponse.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/TheCodingMachine/Splash/Routers/ControllerHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ControllerHandler implements RequestHandlerInterface
*/
private $splashRoute;
/**
* @var
* @var object
*/
private $controller;
/**
Expand Down
14 changes: 4 additions & 10 deletions src/TheCodingMachine/Splash/Routers/SplashRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use TheCodingMachine\Splash\Services\ParameterFetcher;
use TheCodingMachine\Splash\Services\ParameterFetcherRegistry;
use TheCodingMachine\Splash\Services\SplashRoute;
use TheCodingMachine\Splash\Services\SplashRouteInterface;
use TheCodingMachine\Splash\Services\UrlProviderInterface;
use TheCodingMachine\Splash\Utils\SplashException;
use Psr\Cache\CacheItemPoolInterface;
Expand Down Expand Up @@ -71,7 +72,7 @@ class SplashRouter implements MiddlewareInterface
private $debug;

/**
* @var ParameterFetcher[]
* @var ParameterFetcherRegistry
*/
private $parameterFetcherRegistry;

Expand Down Expand Up @@ -131,14 +132,7 @@ public function setHttp400Handler($http400Handler)
return $this;
}

/**
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @param callable|null $out
*
* @return ResponseInterface
*/
private function route(ServerRequestInterface $request, RequestHandlerInterface $next = null, $retry = false) : ResponseInterface
private function route(ServerRequestInterface $request, RequestHandlerInterface $next = null, bool $retry = false) : ResponseInterface
{
$this->purgeExpiredRoutes();

Expand Down Expand Up @@ -274,7 +268,7 @@ public function getSplashActionsList(): array
* Generates the URLNodes from the list of URLS.
* URLNodes are a very efficient way to know whether we can access our page or not.
*
* @param UrlProviderInterface[] $urlsList
* @param SplashRouteInterface[] $urlsList
*
* @return SplashUrlNode
*/
Expand Down
7 changes: 3 additions & 4 deletions src/TheCodingMachine/Splash/Services/ControllerAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use TheCodingMachine\Splash\Annotations\Put;
use TheCodingMachine\Splash\Annotations\Title;
use ReflectionMethod;
use TheCodingMachine\Splash\Utils\SplashException;

/**
* This class is in charge of analyzing a controller instance and returning the routes it contains.
Expand Down Expand Up @@ -72,11 +73,9 @@ public function isController(string $className) : bool
/**
* Returns an array of SplashRoute for the controller passed in parameter.
*
* @param object $controller
*
* @return SplashRoute[]
*
* @throws \Mouf\Mvc\Splash\Utils\SplashException
* @throws SplashException
*/
public function analyzeController(string $controllerInstanceName) : array
{
Expand All @@ -90,9 +89,9 @@ public function analyzeController(string $controllerInstanceName) : array
foreach ($refClass->getMethods() as $refMethod) {
$title = null;
// Now, let's check the "Title" annotation (note: we do not support multiple title annotations for the same method)
/** @var Title */
$titleAnnotation = $this->annotationReader->getMethodAnnotation($refMethod, Title::class);
if ($titleAnnotation !== null) {
/* @var $titleAnnotation TitleAnnotation */
$title = $titleAnnotation->getTitle();
}

Expand Down
2 changes: 0 additions & 2 deletions src/TheCodingMachine/Splash/Services/ControllerDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public function getControllerIdentifiers(ControllerAnalyzer $controllerAnalyzer)
* If the tag changes, the cache is flushed by Splash.
*
* Important! This must be quick to compute.
*
* @return mixed
*/
public function getExpirationTag() : string;
}
7 changes: 3 additions & 4 deletions src/TheCodingMachine/Splash/Services/ControllerRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace TheCodingMachine\Splash\Services;

use TheCodingMachine\Splash\Annotations\Action;
use TheCodingMachine\Splash\Utils\SplashException;

/**
* This class is in charge of registering controller's routes.
Expand All @@ -12,7 +13,7 @@ class ControllerRegistry implements UrlProviderInterface
private $controllers;

/**
* @var ControllerDetector
* @var ControllerDetector|null
*/
private $controllerDetector;

Expand Down Expand Up @@ -58,7 +59,7 @@ public function addController(string $controller) : ControllerRegistry
*
* @return SplashRoute[]
*
* @throws \Mouf\Mvc\Splash\Utils\SplashException
* @throws SplashException
*/
public function getUrlsList($instanceName)
{
Expand Down Expand Up @@ -88,8 +89,6 @@ public function getUrlsList($instanceName)
* If the tag changes, the cache is flushed by Splash.
*
* Important! This must be quick to compute.
*
* @return mixed
*/
public function getExpirationTag() : string
{
Expand Down
52 changes: 0 additions & 52 deletions src/TheCodingMachine/Splash/Services/MoufExplorerUrlProvider.php

This file was deleted.

Loading