Skip to content

Commit

Permalink
FEATURE: Increase PHP 8 compatibility
Browse files Browse the repository at this point in the history
Related: #2233
  • Loading branch information
bwaidelich authored and albe committed Feb 25, 2021
1 parent d84c96b commit 0da755f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Neos.Flow/Classes/Core/LockManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ public function unlockSite()
fclose($this->lockResource);
unlink($this->lockPathAndFilename);
}
@unlink($this->lockFlagPathAndFilename);
if (file_exists($this->lockFlagPathAndFilename)) {
@unlink($this->lockFlagPathAndFilename);
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Neos.Flow/Classes/Reflection/ParameterReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public function getClass()
public function getBuiltinType()
{
$type = $this->getType();
if ($type === null || !$type->isBuiltin()) {
if (!$type instanceof \ReflectionNamedType) {
return null;
}
return $type instanceof \ReflectionNamedType ? $type->getName() : (string)$type;
return $type->isBuiltin() ? $type->getName() : null;
}
}
2 changes: 1 addition & 1 deletion Neos.Flow/Classes/SignalSlot/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function dispatch(string $signalClassName, string $signalName, array $sig
}

foreach ($this->slots[$signalClassName][$signalName] as $slotInformation) {
$finalSignalArguments = $signalArguments;
$finalSignalArguments = array_values($signalArguments);
if (isset($slotInformation['object'])) {
$object = $slotInformation['object'];
} elseif (strpos($slotInformation['method'], '::') === 0) {
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow/Classes/Utility/PhpAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function extractNamespace(): ?string
return ltrim($value, '\\');
}
if ($type === T_STRING) {
$namespaceParts[] = $value;
$namespaceParts[] = ltrim($value, '\\');
continue;
}
if ($type !== T_NS_SEPARATOR && $type !== T_WHITESPACE) {
Expand Down

0 comments on commit 0da755f

Please sign in to comment.