diff --git a/.composer.json b/.composer.json
index bf51e7a4cf..fede7a4122 100644
--- a/.composer.json
+++ b/.composer.json
@@ -8,8 +8,9 @@
"../../flow doctrine:migrate --quiet",
"../../bin/behat -f progress -c Neos.Flow/Tests/Behavior/behat.yml"
],
+ "lint:phpstan": "../../bin/phpstan analyse",
"lint": [
- "../../bin/phpstan analyse"
+ "@lint:phpstan"
]
},
"require": {
diff --git a/Neos.Cache/Classes/Frontend/FrontendInterface.php b/Neos.Cache/Classes/Frontend/FrontendInterface.php
index 2b4ac9408b..8de9127f6c 100644
--- a/Neos.Cache/Classes/Frontend/FrontendInterface.php
+++ b/Neos.Cache/Classes/Frontend/FrontendInterface.php
@@ -62,7 +62,7 @@ public function set(string $entryIdentifier, $data, array $tags = [], int $lifet
* Finds and returns data from the cache.
*
* @param string $entryIdentifier Something which identifies the cache entry - depends on concrete cache
- * @return mixed
+ * @return mixed The value or false if the cache entry could not be loaded
* @api
*/
public function get(string $entryIdentifier);
diff --git a/Neos.Cache/Classes/Frontend/StringFrontend.php b/Neos.Cache/Classes/Frontend/StringFrontend.php
index 1663f91eba..6d0a33568d 100644
--- a/Neos.Cache/Classes/Frontend/StringFrontend.php
+++ b/Neos.Cache/Classes/Frontend/StringFrontend.php
@@ -58,7 +58,7 @@ public function set(string $entryIdentifier, $string, array $tags = [], int $lif
* Finds and returns a variable value from the cache.
*
* @param string $entryIdentifier Identifier of the cache entry to fetch
- * @return string The value
+ * @return string|false The value or false if the cache entry could not be loaded
* @throws \InvalidArgumentException
* @api
*/
diff --git a/Neos.Flow/Classes/Cache/CacheFactory.php b/Neos.Flow/Classes/Cache/CacheFactory.php
index 123bd70731..1b2f885775 100644
--- a/Neos.Flow/Classes/Cache/CacheFactory.php
+++ b/Neos.Flow/Classes/Cache/CacheFactory.php
@@ -38,13 +38,6 @@ class CacheFactory extends \Neos\Cache\CacheFactory
*/
protected $context;
- /**
- * A reference to the cache manager
- *
- * @var CacheManager
- */
- protected $cacheManager;
-
/**
* @var Environment
*/
@@ -55,16 +48,6 @@ class CacheFactory extends \Neos\Cache\CacheFactory
*/
protected $environmentConfiguration;
- /**
- * @param CacheManager $cacheManager
- *
- * @Flow\Autowiring (enabled=false)
- */
- public function injectCacheManager(CacheManager $cacheManager): void
- {
- $this->cacheManager = $cacheManager;
- }
-
/**
* @param EnvironmentConfiguration $environmentConfiguration
*
diff --git a/Neos.Flow/Classes/Cache/CacheManager.php b/Neos.Flow/Classes/Cache/CacheManager.php
index 1ca19ca382..ede879875d 100644
--- a/Neos.Flow/Classes/Cache/CacheManager.php
+++ b/Neos.Flow/Classes/Cache/CacheManager.php
@@ -11,6 +11,7 @@
* source code.
*/
+use Neos\Cache\CacheFactoryInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Cache\Backend\FileBackend;
use Neos\Cache\Exception\DuplicateIdentifierException;
@@ -37,7 +38,7 @@
class CacheManager
{
/**
- * @var CacheFactory
+ * @var CacheFactoryInterface
*/
protected $cacheFactory;
@@ -100,10 +101,10 @@ public function injectLogger(LoggerInterface $logger)
}
/**
- * @param CacheFactory $cacheFactory
+ * @param CacheFactoryInterface $cacheFactory
* @return void
*/
- public function injectCacheFactory(CacheFactory $cacheFactory): void
+ public function injectCacheFactory(CacheFactoryInterface $cacheFactory): void
{
$this->cacheFactory = $cacheFactory;
}
@@ -496,6 +497,7 @@ protected function createCache(string $identifier): void
$backend = isset($this->cacheConfigurations[$identifier]['backend']) ? $this->cacheConfigurations[$identifier]['backend'] : $this->cacheConfigurations['Default']['backend'];
$backendOptions = isset($this->cacheConfigurations[$identifier]['backendOptions']) ? $this->cacheConfigurations[$identifier]['backendOptions'] : $this->cacheConfigurations['Default']['backendOptions'];
$persistent = isset($this->cacheConfigurations[$identifier]['persistent']) ? $this->cacheConfigurations[$identifier]['persistent'] : $this->cacheConfigurations['Default']['persistent'];
+ // @phpstan-ignore-next-line - $persistent is not yet part of the CacheFactoryInterface
$cache = $this->cacheFactory->create($identifier, $frontend, $backend, $backendOptions, $persistent);
$this->registerCache($cache, $persistent);
}
diff --git a/Neos.Flow/Classes/Command/RoutingCommandController.php b/Neos.Flow/Classes/Command/RoutingCommandController.php
index acb33fe95c..ae43d4907a 100644
--- a/Neos.Flow/Classes/Command/RoutingCommandController.php
+++ b/Neos.Flow/Classes/Command/RoutingCommandController.php
@@ -17,7 +17,6 @@
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Cli\CommandController;
use Neos\Flow\Cli\Exception\StopCommandException;
-use Neos\Flow\Configuration\ConfigurationManager;
use Neos\Flow\Http\Helper\RequestInformationHelper;
use Neos\Flow\Mvc\Exception\InvalidRoutePartValueException;
use Neos\Flow\Mvc\Routing\Dto\ResolveContext;
@@ -26,7 +25,7 @@
use Neos\Flow\Mvc\Routing\Dto\RouteTags;
use Neos\Flow\Mvc\Routing\Dto\UriConstraints;
use Neos\Flow\Mvc\Routing\Route;
-use Neos\Flow\Mvc\Routing\Router;
+use Neos\Flow\Mvc\Routing\RoutesProviderInterface;
use Neos\Flow\ObjectManagement\ObjectManagerInterface;
use Neos\Http\Factories\ServerRequestFactory;
use Neos\Utility\Arrays;
@@ -40,15 +39,9 @@ class RoutingCommandController extends CommandController
{
/**
* @Flow\Inject
- * @var ConfigurationManager
+ * @var RoutesProviderInterface
*/
- protected $configurationManager;
-
- /**
- * @Flow\Inject
- * @var Router
- */
- protected $router;
+ protected $routesProvider;
/**
* @Flow\Inject
@@ -73,8 +66,7 @@ public function listCommand(): void
{
$this->outputLine('Currently registered routes:');
$rows = [];
- /** @var Route $route */
- foreach ($this->router->getRoutes() as $index => $route) {
+ foreach ($this->routesProvider->getRoutes() as $index => $route) {
$routeNumber = $index + 1;
$rows[] = [
'#' => $routeNumber,
@@ -99,15 +91,12 @@ public function listCommand(): void
*/
public function showCommand(int $index): void
{
- /** @var Route[] $routes */
- $routes = $this->router->getRoutes();
- if (!isset($routes[$index - 1])) {
+ $route = $this->routesProvider->getRoutes()[$index - 1] ?? null;
+ if ($route === null) {
$this->outputLine('
' . nl2br(htmlspecialchars($exceptionMessageParts['body'])) . '
'; + ['subject' => $exceptionMessageSubject, 'body' => $exceptionMessageBody] = $this->splitExceptionMessage($exception->getMessage()); + + $exceptionHeader .= '' . htmlspecialchars($exceptionMessageBody) . '
'; + } else { + $exceptionHeader .= '' . nl2br(htmlspecialchars($exceptionMessageBody)) . '
'; + } } $exceptionHeader .= '