Skip to content

Commit

Permalink
MERGE: Merge branch '8.4' into 9.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	Neos.Flow/Classes/ObjectManagement/Proxy/Compiler.php
#	Neos.Flow/Classes/ObjectManagement/Proxy/ProxyConstructorGenerator.php
#	Neos.Flow/Classes/Reflection/ReflectionService.php
#	Neos.Flow/Configuration/Settings.Log.yaml
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/AnnotationReference.rst
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/FluidAdaptorViewHelperReference.rst
#	Neos.Flow/Documentation/TheDefinitiveGuide/PartV/TYPO3FluidViewHelperReference.rst
#	Neos.FluidAdaptor/Classes/Core/ViewHelper/TemplateVariableContainer.php
#	composer.json
  • Loading branch information
robertlemke committed Jun 17, 2024
2 parents f1d1d80 + ecb20f6 commit ad1ab8e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,18 @@ protected function autowireProperties(array &$objectConfigurations)
);
}

foreach ($this->reflectionService->getPropertyNamesByAnnotation($className, InjectCache::class) as $propertyName) {
if ($this->reflectionService->isPropertyPrivate($className, $propertyName)) {
throw new ObjectException(sprintf('The property "%s" in class "%s" must not be private when annotated for cache injection.', $propertyName, $className), 1416765599);
}
if (array_key_exists($propertyName, $properties)) {
continue;
}
/** @var InjectCache $injectCacheAnnotation */
$injectCacheAnnotation = $this->reflectionService->getPropertyAnnotation($className, $propertyName, InjectCache::class);
$properties[$propertyName] = new ConfigurationProperty($propertyName, ['identifier' => $injectCacheAnnotation->identifier], ConfigurationProperty::PROPERTY_TYPES_CACHE);
}

foreach ($this->reflectionService->getPropertyNamesByAnnotation($className, InjectCache::class) as $propertyName) {
if ($this->reflectionService->isPropertyPrivate($className, $propertyName)) {
throw new ObjectException(sprintf('The property "%s" in class "%s" must not be private when annotated for cache injection.', $propertyName, $className), 1416765599);
Expand Down
3 changes: 2 additions & 1 deletion Neos.Flow/Classes/ObjectManagement/Proxy/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function injectReflectionService(ReflectionService $reflectionService): v
*/
public function getProxyClass(string $fullClassName): ProxyClass|false
{
/** @phpstan-ignore-next-line Class BaseTestCase not found */
if (interface_exists($fullClassName) || (class_exists(BaseTestCase::class) && in_array(BaseTestCase::class, class_parents($fullClassName), true))) {

Check failure on line 132 in Neos.Flow/Classes/ObjectManagement/Proxy/Compiler.php

View workflow job for this annotation

GitHub Actions / PHP 8.2 Test static analysis (deps: highest)

No error to ignore is reported on line 132.
return false;
}
Expand Down Expand Up @@ -406,7 +407,7 @@ private function getClassNameTokenIndex(array $tokens): ?int
$previousToken = null;
foreach ($tokens as $i => $token) {
# $token is an array: [0] => token id, [1] => token text, [2] => line number
if (isset($classToken) && is_array($token) && $token[0] === T_STRING) {
if (!empty($classToken) && is_array($token) && $token[0] === T_STRING) {
return $i;
}
# search first T_CLASS token that is not a `Foo::class` class name resolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class ProxyConstructorGenerator extends ProxyMethodGenerator
{
private ?string $originalVisibility = null;

/** @phpstan-ignore-next-line */
/** @phpstan-ignore constructor.unusedParameter */
public function __construct($name = null, array $parameters = [], $flags = self::FLAG_PUBLIC, $body = null, $docBlock = null)
{
if ($docBlock === null) {
Expand Down

0 comments on commit ad1ab8e

Please sign in to comment.