Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
def9815
Adjust Neos.Flow Property subcontext
Apr 7, 2025
a1fc7e3
TASK: Adjust phpstan config to apply level 8 rules to the Flow/Proper…
mficzel Jun 12, 2026
a7bb31a
TASK: Adjust breaking tests and fix stan annotations
mficzel Jun 12, 2026
46fed09
Adjust Neos.Flow Persistence subcontext
Apr 8, 2025
1551321
TASK: Adjust phpstan config to apply level 8 rules to the Flow/Persis…
mficzel Jul 1, 2026
90d23f6
TASK: Reduce breakiness and Increase PhpStan happiness
mficzel Jul 1, 2026
9cb92bc
Adjust Neos.Flow Package subcontext
Apr 8, 2025
bca6be7
TASK: Adjust phpstan config to apply level 8 rules to the Flow/Packag…
mficzel Jul 10, 2026
d2157cb
TASK: Reduce breakiness in Flow\Package subcontext
mficzel Jul 10, 2026
0d99e41
TASK: Adjust phpstan config to apply level 8 rules to the Flow/Object…
mficzel Jul 16, 2026
33e8ef2
TASK: Add composer test:unit command
mficzel Jul 16, 2026
ec8479d
Adjust Neos.Flow.ObjectManagement subcontext
mficzel Jul 16, 2026
368524b
TASK: Adjust to the fact that the class name is "" in cases when the …
mficzel Jul 17, 2026
79e1f07
TASK: Adjust phpstan config to apply level 8 rules to the Neos\Flow\M…
Apr 10, 2025
1fc13f6
Adjust Neos.Flow Mvc subcontext
mficzel Jul 17, 2026
42884f6
TASK: increase memory limit for phpstan
mficzel Jul 17, 2026
61a889a
TASK: Adjust phpstan config to apply level 8 rules to the Neos.Flow M…
mficzel Jul 17, 2026
69cdc48
Adjust Neos.Flow Monitor sub-context
Apr 11, 2025
1de2252
Adjust Neos.Flow Log sub-context
Apr 11, 2025
8f0057b
Revert erroneous JSON errors
May 3, 2025
d3cab95
Adjust phpstan config to apply level 8 rules to the Neos.Flow I18n su…
mficzel Jul 17, 2026
8282ec2
Adjust Neos.Flow I18n subcontext
Apr 11, 2025
896482f
TASK: Reduce breakiness and Increase PhpStan happiness
mficzel Jul 17, 2026
d9a2002
Adjust phpstan config to apply level 8 rules to the Neos.Flow Http su…
mficzel Jul 17, 2026
ceddd02
Adjust Neos.Flow Http subcontext
Apr 12, 2025
879ef3c
TASK: Reduce breakiness and Increase PhpStan happiness
Apr 12, 2025
f270eae
Adjust phpstan config to apply level 8 rules to the Neos.Flow Error s…
mficzel Jul 17, 2026
65563b1
Adjust Neos.Flow Error sub-context
mficzel Jul 17, 2026
e6e11de
TASK: Make style ci happy
mficzel Jul 17, 2026
4099bfa
Adjust phpstan config to apply level 8 rules to the Neos.Flow Core su…
mficzel Jul 17, 2026
79498d7
Adjust Neos.Flow Core sub-context
mficzel Jul 17, 2026
65cecb8
Adjust phpstan config to apply level 8 rules to the Neos.Flow Configu…
mficzel Jul 17, 2026
6193408
Adjust Neos.Flow Configuration subcontext
Apr 12, 2025
b353091
Adjust phpstan config to apply level 8 rules to the Neos.Flow Compose…
mficzel Jul 17, 2026
8e50758
Adjust Neos.Flow Composer subcontext
Apr 12, 2025
4f21879
Adjust phpstan config to apply level 8 rules to the Neos.Flow Command…
mficzel Jul 17, 2026
0a414f8
Adjust Neos.Flow Command subcontext
mficzel Jul 17, 2026
8d4d234
Adjust phpstan config to apply level 8 rules to the Neos.Flow Cli sub…
mficzel Jul 17, 2026
a00cc44
Adjust Neos.Flow Cli subcontext
Apr 12, 2025
553abd1
Adjust phpstan config to apply level 8 rules to the Neos.Flow Cache s…
mficzel Jul 17, 2026
2ec0efa
Adjust Neos.Flow Cache subcontext
Apr 12, 2025
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
2 changes: 1 addition & 1 deletion Neos.Cache/Tests/Unit/Backend/AbstractBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class_exists(AbstractBackend::class);
eval('
#[\AllowDynamicProperties]
class ' . $className . ' extends \Neos\Cache\Backend\AbstractBackend {
public function set(string $entryIdentifier, string $data, array $tags = [], int $lifetime = NULL): void {}
public function set(string $entryIdentifier, string $data, array $tags = [], ?int $lifetime = NULL): void {}
public function get(string $entryIdentifier): string {}
public function has(string $entryIdentifier): bool {}
public function remove(string $entryIdentifier): bool {}
Expand Down
19 changes: 11 additions & 8 deletions Neos.Error.Messages/Classes/Result.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ public function getNotices(?string $messageTypeFilter = null): array
/**
* Get the first error object of the current Result object (non-recursive)
*
* @param string $messageTypeFilter if specified only errors implementing the given class are considered
* @return Error
* @param string|null $messageTypeFilter if specified only errors implementing the given class are considered
* @return Error|false
* @api
*/
public function getFirstError(?string $messageTypeFilter = null)
Expand All @@ -178,8 +178,8 @@ public function getFirstError(?string $messageTypeFilter = null)
/**
* Get the first warning object of the current Result object (non-recursive)
*
* @param string $messageTypeFilter if specified only warnings implementing the given class are considered
* @return Warning
* @param string|null $messageTypeFilter if specified only warnings implementing the given class are considered
* @return Warning|false
* @api
*/
public function getFirstWarning(?string $messageTypeFilter = null)
Expand All @@ -192,8 +192,8 @@ public function getFirstWarning(?string $messageTypeFilter = null)
/**
* Get the first notice object of the current Result object (non-recursive)
*
* @param string $messageTypeFilter if specified only notices implementing the given class are considered
* @return Notice
* @param string|null $messageTypeFilter if specified only notices implementing the given class are considered
* @return Notice|false
* @api
*/
public function getFirstNotice(?string $messageTypeFilter = null)
Expand All @@ -209,7 +209,7 @@ public function getFirstNotice(?string $messageTypeFilter = null)
* $result->forProperty('foo.bar')->getErrors() -- to get all errors
* for property "foo.bar"
*
* @param string $propertyPath
* @param string|null $propertyPath
* @return Result
* @api
*/
Expand Down Expand Up @@ -257,6 +257,7 @@ public function recurseThroughResult(array $pathSegments): Result
/**
* Does the current Result object have Errors? (Recursively)
*
* @phpstan-assert-if-true Error $this->getFirstError()
* @return boolean
* @api
*/
Expand All @@ -282,6 +283,7 @@ protected function setErrorsExist()
/**
* Does the current Result object have Warnings? (Recursively)
*
* @phpstan-assert-if-true Warning $this->getFirstWarning()
* @return boolean
* @api
*/
Expand All @@ -307,7 +309,8 @@ protected function setWarningsExist()
/**
* Does the current Result object have Notices? (Recursively)
*
* @return boolean
* @return bool
* @phpstan-assert-if-true Notice $this->getFirstNotice()
* @api
*/
public function hasNotices()
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow.Log/Tests/Unit/Backend/AbstractBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function setUp(): void
class ' . $this->backendClassName . ' extends \Neos\Flow\Log\Backend\AbstractBackend {
protected $someOption;
public function open(): void {}
public function append(string $message, int $severity = 1, $additionalData = NULL, string $packageKey = NULL, string $className = NULL, string $methodName = NULL): void {}
public function append(string $message, int $severity = 1, $additionalData = NULL, ?string $packageKey = NULL, ?string $className = NULL, ?string $methodName = NULL): void {}
public function close(): void {}
public function setSomeOption($value) {
$this->someOption = $value;
Expand Down
8 changes: 4 additions & 4 deletions Neos.Flow/Classes/Cache/AnnotationsCacheFlusher.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class AnnotationsCacheFlusher
/**
* Caches to flush for a given annotation
*
* @var array in the format [<AnnotationClassName> => [<CacheName_1>, <CacheName_2>]]
* @var array<class-string,list<string>> in the format [<AnnotationClassName> => [<CacheName_1>, <CacheName_2>]]
*/
private $annotationToCachesMap = [];

Expand All @@ -81,8 +81,8 @@ public function injectReflectionService(ReflectionService $reflectionService): v
/**
* Register an annotation that should trigger a cache flush
*
* @param string $annotationClassName fully qualified class name of the annotation
* @param string[] $cacheNames Cache names to flush if a class containing the given annotation is compiled (e.g. ["Flow_Mvc_Routing_Route", Flow_Mvc_Routing_Resolve"])
* @param class-string $annotationClassName fully qualified class name of the annotation
* @param list<string> $cacheNames Cache names to flush if a class containing the given annotation is compiled (e.g. ["Flow_Mvc_Routing_Route", Flow_Mvc_Routing_Resolve"])
*/
public function registerAnnotation(string $annotationClassName, array $cacheNames): void
{
Expand All @@ -92,7 +92,7 @@ public function registerAnnotation(string $annotationClassName, array $cacheName
/**
* A slot that flushes caches as needed if classes with specific annotations have changed @see registerAnnotation()
*
* @param array<string> $classNames The full class names of the classes that got compiled
* @param array<class-string> $classNames The full class names of the classes that got compiled
* @return void
* @throws NoSuchCacheException
*/
Expand Down
4 changes: 2 additions & 2 deletions Neos.Flow/Classes/Cache/CacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function __construct(ApplicationContext $context, Environment $environmen
* @param string $cacheIdentifier
* @param string $cacheObjectName
* @param string $backendObjectName
* @param array $backendOptions
* @param array<mixed> $backendOptions
* @param bool $persistent
* @return FrontendInterface
*/
Expand Down Expand Up @@ -112,7 +112,7 @@ protected function instantiateCache(string $cacheIdentifier, string $cacheObject

/**
* @param string $backendObjectName
* @param array $backendOptions
* @param array<string,mixed> $backendOptions
* @param EnvironmentConfiguration $environmentConfiguration
* @param boolean $persistent
* @return BackendInterface
Expand Down
43 changes: 26 additions & 17 deletions Neos.Flow/Classes/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* source code.
*/

use Neos\Cache\Backend\BackendInterface;
use Neos\Cache\CacheFactoryInterface;
use Neos\Flow\Annotations as Flow;
use Neos\Cache\Backend\FileBackend;
Expand All @@ -32,6 +33,12 @@
/**
* The Cache Manager
*
* @phpstan-type CacheConfiguration array{
* frontend?: class-string<FrontendInterface>,
* backend?: class-string<BackendInterface>,
* backendOptions?: array<mixed>,
* persistent?: bool,
* }
* @Flow\Scope("singleton")
* @api
*/
Expand Down Expand Up @@ -73,12 +80,12 @@ class CacheManager
protected $cacheItemPools = [];

/**
* @var array
* @var array<string,FrontendInterface>
*/
protected $persistentCaches = [];

/**
* @var array
* @var array<string,CacheConfiguration>
*/
protected $cacheConfigurations = [
'Default' => [
Expand Down Expand Up @@ -140,16 +147,14 @@ public function injectEnvironment(Environment $environment): void
* If one of the options is not specified, the default value is assumed.
* Existing cache configurations are preserved.
*
* @param array $cacheConfigurations The cache configurations to set
* @todo enforce via extractor
* @param array<string,CacheConfiguration> $cacheConfigurations The cache configurations to set
* @return void
* @throws \InvalidArgumentException
*/
public function setCacheConfigurations(array $cacheConfigurations): void
{
foreach ($cacheConfigurations as $identifier => $configuration) {
if (!is_array($configuration)) {
throw new \InvalidArgumentException('The cache configuration for cache "' . $identifier . '" was not an array as expected.', 1231259656);
}
$this->cacheConfigurations[$identifier] = $configuration;
}
}
Expand Down Expand Up @@ -301,7 +306,7 @@ public function flushCachesByTag(string $tag, bool $flushPersistentCaches = fals
/**
* Returns an array of cache configurations, indexed by cache identifier
*
* @return array
* @return array<string,mixed>
*/
public function getCacheConfigurations(): array
{
Expand All @@ -320,7 +325,7 @@ public function getCacheConfigurations(): array
* time needed.
*
* @param string $fileMonitorIdentifier Identifier of the File Monitor
* @param array $changedFiles A list of full paths to changed files
* @param array<string,mixed> $changedFiles A list of full paths to changed files
* @return void
*/
public function flushSystemCachesByChangedFiles(string $fileMonitorIdentifier, array $changedFiles): void
Expand All @@ -341,7 +346,7 @@ public function flushSystemCachesByChangedFiles(string $fileMonitorIdentifier, a
/**
* Flushes entries tagged with class names if their class source files have changed.
*
* @param array $changedFiles A list of full paths to changed files
* @param array<string,mixed> $changedFiles A list of full paths to changed files
* @return void
* @see flushSystemCachesByChangedFiles()
*/
Expand All @@ -355,7 +360,7 @@ protected function flushClassCachesByChangedFiles(array $changedFiles): void
if (!file_exists($pathAndFilename)) {
continue;
}
$fileContents = file_get_contents($pathAndFilename);
$fileContents = file_get_contents($pathAndFilename) ?: '';
$className = (new PhpAnalyzer($fileContents))->extractFullyQualifiedClassName();
if ($className === null) {
continue;
Expand Down Expand Up @@ -408,7 +413,7 @@ protected function flushClassCachesByChangedFiles(array $changedFiles): void
/**
* Flushes caches as needed if settings, routes or policies have changed
*
* @param array $changedFiles A list of full paths to changed files
* @param array<string,mixed> $changedFiles A list of full paths to changed files
* @return void
* @see flushSystemCachesByChangedFiles()
*/
Expand Down Expand Up @@ -458,7 +463,7 @@ protected function flushConfigurationCachesByChangedFiles(array $changedFiles):
/**
* Flushes I18n caches if translation files have changed
*
* @param array $changedFiles A list of full paths to changed files
* @param array<string, mixed> $changedFiles A list of full paths to changed files
* @return void
* @see flushSystemCachesByChangedFiles()
*/
Expand Down Expand Up @@ -495,11 +500,15 @@ protected function createAllCaches(): void
*/
protected function createCache(string $identifier): void
{
$frontend = isset($this->cacheConfigurations[$identifier]['frontend']) ? $this->cacheConfigurations[$identifier]['frontend'] : $this->cacheConfigurations['Default']['frontend'];
$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
/** @phpstan-ignore offsetAccess.notFound (always set for Default) */
$frontend = $this->cacheConfigurations[$identifier]['frontend'] ?? $this->cacheConfigurations['Default']['frontend'];
/** @phpstan-ignore offsetAccess.notFound (always set for Default) */
$backend = $this->cacheConfigurations[$identifier]['backend'] ?? $this->cacheConfigurations['Default']['backend'];
/** @phpstan-ignore offsetAccess.notFound (always set for Default) */
$backendOptions = $this->cacheConfigurations[$identifier]['backendOptions'] ?? $this->cacheConfigurations['Default']['backendOptions'];
/** @phpstan-ignore offsetAccess.notFound (always set for Default) */
$persistent = $this->cacheConfigurations[$identifier]['persistent'] ?? $this->cacheConfigurations['Default']['persistent'];
/** @phpstan-ignore arguments.count ($persistent is not part of the interface) */
$cache = $this->cacheFactory->create($identifier, $frontend, $backend, $backendOptions, $persistent);
$this->registerCache($cache, $persistent);
}
Expand Down
24 changes: 15 additions & 9 deletions Neos.Flow/Classes/Cli/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Command
{
/**
* @var string
* @var class-string<CommandControllerInterface>
*/
protected $controllerClassName;

Expand Down Expand Up @@ -54,7 +54,7 @@ class Command
/**
* Constructor
*
* @param string $controllerClassName Class name of the controller providing the command
* @param class-string<CommandControllerInterface> $controllerClassName Class name of the controller providing the command
* @param string $controllerCommandName Command name, i.e. the method name of the command, without the "Command" suffix
* @throws \InvalidArgumentException
*/
Expand All @@ -74,21 +74,21 @@ public function __construct(string $controllerClassName, string $controllerComma
/**
* @param ReflectionService $reflectionService Reflection service
*/
public function injectReflectionService(ReflectionService $reflectionService)
public function injectReflectionService(ReflectionService $reflectionService): void
{
$this->reflectionService = $reflectionService;
}

/**
* @param ObjectManagerInterface $objectManager
*/
public function injectObjectManager(ObjectManagerInterface $objectManager)
public function injectObjectManager(ObjectManagerInterface $objectManager): void
{
$this->objectManager = $objectManager;
}

/**
* @return string
* @return class-string<CommandControllerInterface>
*/
public function getControllerClassName(): string
{
Expand Down Expand Up @@ -122,10 +122,13 @@ public function getShortDescription(): string
{
$commandMethodReflection = $this->getCommandMethodReflection();
$lines = explode(chr(10), $commandMethodReflection->getDescription());
$shortDescription = ((count($lines) > 0) ? trim($lines[0]) : '<no description available>') . ($this->isDeprecated() ? ' <b>(DEPRECATED)</b>' : '');
$shortDescription = ((count($lines) > 1) ? trim($lines[0]) : '<no description available>') . ($this->isDeprecated() ? ' <b>(DEPRECATED)</b>' : '');

if ($commandMethodReflection->getDeclaringClass()->implementsInterface(DescriptionAwareCommandControllerInterface::class)) {
$shortDescription = call_user_func([$this->controllerClassName, 'processDescription'], $this->controllerCommandName, $shortDescription, $this->objectManager);
$callback = [$this->controllerClassName, 'processDescription'];
if (is_callable($callback)) {
$shortDescription = call_user_func($callback, $this->controllerCommandName, $shortDescription, $this->objectManager);
}
}
return $shortDescription;
}
Expand All @@ -151,7 +154,10 @@ public function getDescription(): string
}
$description = implode(chr(10), $descriptionLines);
if ($commandMethodReflection->getDeclaringClass()->implementsInterface(DescriptionAwareCommandControllerInterface::class)) {
$description = call_user_func([$this->controllerClassName, 'processDescription'], $this->controllerCommandName, $description, $this->objectManager);
$callback = [$this->controllerClassName, 'processDescription'];
if (is_callable($callback)) {
$description = call_user_func($callback, $this->controllerCommandName, $description, $this->objectManager);
}
}
return $description;
}
Expand Down Expand Up @@ -239,7 +245,7 @@ public function isFlushingCaches(): bool
* Returns an array of command identifiers which were specified in the "@see"
* annotation of a command method.
*
* @return array
* @return array<int,string>
*/
public function getRelatedCommandIdentifiers(): array
{
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow/Classes/Cli/CommandArgumentDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getName(): string
public function getDashedName(): string
{
$dashedName = ucfirst($this->name);
$dashedName = preg_replace('/([A-Z][a-z0-9]+)/', '$1-', $dashedName);
$dashedName = preg_replace('/([A-Z][a-z0-9]+)/', '$1-', $dashedName) ?: '';
return '--' . strtolower(substr($dashedName, 0, -1));
}

Expand Down
Loading
Loading