Skip to content

Commit

Permalink
MERGE: Merge branch '8.1' into 8.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	Neos.Eel/composer.json
#	Neos.Flow/composer.json
#	Neos.FluidAdaptor/composer.json
#	Neos.Kickstarter/composer.json
  • Loading branch information
kdambekalns committed Jul 17, 2023
2 parents 2d17dbc + e3aa685 commit ce84b41
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 16 deletions.
3 changes: 3 additions & 0 deletions Neos.Cache/Classes/Backend/ApcuBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ public function collectGarbage(): void
* @return mixed
* @api
*/
#[\ReturnTypeWillChange]
public function current()
{
if ($this->cacheEntriesIterator === null) {
Expand All @@ -347,6 +348,7 @@ public function current()
* @return void
* @api
*/
#[\ReturnTypeWillChange]
public function next()
{
if ($this->cacheEntriesIterator === null) {
Expand Down Expand Up @@ -390,6 +392,7 @@ public function valid(): bool
* @return void
* @api
*/
#[\ReturnTypeWillChange]
public function rewind()
{
if ($this->cacheEntriesIterator === null) {
Expand Down
2 changes: 1 addition & 1 deletion Neos.Cache/Classes/Backend/SimpleFileBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ protected function readCacheFile(string $cacheEntryPathAndFilename, int $offset
$length = $maxlen !== null ? $maxlen : filesize($cacheEntryPathAndFilename) - (int)$offset;

// fread requires a positive length. If the file is empty, we just return an empty string.
if ($length === 0) {
if ($length <= 0) {
$data = '';
} else {
$data = fread($file, $length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ protected function evaluateOperator($value, string $operator, $operand)
}
return false;
} else {
return strripos($value, (string)$operand) === strlen($value) - strlen($operand);
return strripos((string)$value, (string)$operand) === strlen((string)$value) - strlen((string)$operand);
}
// no break
case '^=':
Expand Down
3 changes: 3 additions & 0 deletions Neos.Eel/Classes/Helper/MathHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public function abs($x = 'NAN')
if (!is_numeric($x) && $x !== null) {
return NAN;
}
if ($x === null) {
return 0.0;
}
return abs((float)$x);
}

Expand Down
4 changes: 2 additions & 2 deletions Neos.Eel/Classes/Helper/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ public function pregReplace($string, $pattern, $replace, $limit = -1)
* @param integer $limit The maximum amount of items to return, in contrast to split() this will return all remaining characters in the last item (see example)
* @return array An array of the splitted parts, excluding the matched pattern
*/
public function pregSplit($string, $pattern, $limit = null)
public function pregSplit($string, $pattern, $limit = -1)
{
return preg_split($pattern, (string)$string, $limit);
return preg_split($pattern, (string)$string, (int)$limit);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow.Log/Classes/Backend/FileBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function append(string $message, int $severity = LOG_INFO, $additionalDat
}
$ipAddress = ($this->logIpAddress === true) ? str_pad(($_SERVER['REMOTE_ADDR'] ?? ''), 15) : '';
$severityLabel = $this->severityLabels[$severity] ?? 'UNKNOWN ';
$output = date('y-m-d H:i:s') . $processId . ' ' . $ipAddress . $severityLabel . ' ' . str_pad((string)$packageKey, 20) . ' ' . $message;
$output = (new \DateTime())->format('y-m-d H:m:i') . $processId . ' ' . $ipAddress . $severityLabel . ' ' . str_pad((string)$packageKey, 20) . ' ' . $message;

if ($this->logMessageOrigin === true && ($className !== null || $methodName !== null)) {
$output .= ' [logged in ' . $className . '::' . $methodName . '()]';
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow/Classes/Configuration/ConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public function registerConfigurationType(string $configurationType, $configurat
if ($configurationLoader === null) {
$configurationLoader = new MergeLoader(new YamlSource(), $configurationType);

// B/C layer
// B/C layer
} elseif (is_string($configurationLoader)) {
$configurationLoader = $this->convertLegacyProcessingType($configurationType, $configurationLoader);
}
Expand Down
1 change: 1 addition & 0 deletions Neos.Flow/Classes/Http/Headers.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ public function __toString()
/**
* @return string[]|mixed
*/
#[\ReturnTypeWillChange]
public function current(): mixed
{
return $this->getRaw($this->key());
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow/Classes/Http/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected function resolveDependencies()
*/
protected function sendResponse(ResponseInterface $response)
{
ob_implicit_flush(1);
ob_implicit_flush();
foreach (ResponseInformationHelper::prepareHeaders($response) as $prepareHeader) {
header($prepareHeader, false);
}
Expand Down
1 change: 0 additions & 1 deletion Neos.Flow/Classes/Mvc/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Neos\Error\Messages as Error;
use Neos\Flow\Annotations as Flow;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Uri;
use Psr\Http\Message\UriInterface;
use Neos\Flow\Http\Helper\MediaTypeHelper;
Expand Down
1 change: 1 addition & 0 deletions Neos.Flow/Classes/Mvc/Routing/StaticRoutePart.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function getDefaultValue()
*/
public function match(&$routePath)
{
$routePath = (string)$routePath;
$this->value = null;
if ($this->name === null || $this->name === '') {
return false;
Expand Down
9 changes: 9 additions & 0 deletions Neos.Flow/Classes/Persistence/EmptyQueryResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function toArray(): array
/**
* @return object Returns NULL in this case
*/
#[\ReturnTypeWillChange]
public function current()
{
return null;
Expand All @@ -77,13 +78,15 @@ public function current()
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
}

/**
* @return integer Returns 0 in this case
*/
#[\ReturnTypeWillChange]
public function key()
{
return 0;
Expand All @@ -100,6 +103,7 @@ public function valid()
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
}
Expand All @@ -108,6 +112,7 @@ public function rewind()
* @param mixed $offset
* @return boolean Returns false in this case
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return false;
Expand All @@ -117,6 +122,7 @@ public function offsetExists($offset)
* @param mixed $offset
* @return mixed Returns NULL in this case
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return null;
Expand All @@ -127,6 +133,7 @@ public function offsetGet($offset)
* @param mixed $value The value is ignored in this case
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
}
Expand All @@ -135,13 +142,15 @@ public function offsetSet($offset, $value)
* @param mixed $offset The offset is ignored in this case
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
}

/**
* @return integer Returns 0 in this case
*/
#[\ReturnTypeWillChange]
public function count()
{
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow/Resources/Private/Translations/es/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</trans-unit>
<trans-unit id="update" xml:space="preserve">
<source>Update</source>
<target state="translated">Actualizar</target>
<target state="translated">Actualización</target>
</trans-unit>
<trans-unit id="submit" xml:space="preserve">
<source>Submit</source>
Expand Down
2 changes: 2 additions & 0 deletions Neos.Flow/Tests/Unit/Mvc/Controller/ActionControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public function processRequestInjectsControllerContextToView()
$mockView = $this->createMock(Mvc\View\ViewInterface::class);
$mockView->expects(self::once())->method('setControllerContext')->with($this->mockControllerContext);
$this->actionController->expects(self::once())->method('resolveView')->will(self::returnValue($mockView));
$this->actionController->expects(self::once())->method('resolveActionMethodName')->will(self::returnValue('someAction'));

$this->actionController->processRequest($this->mockRequest, $mockResponse);
}
Expand Down Expand Up @@ -254,6 +255,7 @@ public function processRequestInjectsSettingsToView()
$mockView = $this->createMock(Mvc\View\ViewInterface::class);
$mockView->expects(self::once())->method('assign')->with('settings', $mockSettings);
$this->actionController->expects(self::once())->method('resolveView')->will(self::returnValue($mockView));
$this->actionController->expects(self::once())->method('resolveActionMethodName')->will(self::returnValue('someAction'));

$this->actionController->processRequest($this->mockRequest, $mockResponse);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function shouldSkipReturnsTrueIfConfigured()
*/
public function setTypeConverterOptionsCanBeRetrievedAgain()
{
$mockTypeConverterClass = $this->getMockClass(TypeConverterInterface::class);
$mockTypeConverterClass = get_class($this->createMock(TypeConverterInterface::class));

$this->propertyMappingConfiguration->setTypeConverterOptions($mockTypeConverterClass, ['k1' => 'v1', 'k2' => 'v2']);
self::assertEquals('v1', $this->propertyMappingConfiguration->getConfigurationValue($mockTypeConverterClass, 'k1'));
Expand All @@ -138,7 +138,7 @@ public function nonexistentTypeConverterOptionsReturnNull()
*/
public function setTypeConverterOptionsShouldOverrideAlreadySetOptions()
{
$mockTypeConverterClass = $this->getMockClass(TypeConverterInterface::class);
$mockTypeConverterClass = get_class($this->createMock(TypeConverterInterface::class));
$this->propertyMappingConfiguration->setTypeConverterOptions($mockTypeConverterClass, ['k1' => 'v1', 'k2' => 'v2']);
$this->propertyMappingConfiguration->setTypeConverterOptions($mockTypeConverterClass, ['k3' => 'v3']);

Expand All @@ -151,7 +151,7 @@ public function setTypeConverterOptionsShouldOverrideAlreadySetOptions()
*/
public function setTypeConverterOptionShouldOverrideAlreadySetOptions()
{
$mockTypeConverterClass = $this->getMockClass(TypeConverterInterface::class);
$mockTypeConverterClass = get_class($this->createMock(TypeConverterInterface::class));
$this->propertyMappingConfiguration->setTypeConverterOptions($mockTypeConverterClass, ['k1' => 'v1', 'k2' => 'v2']);
$this->propertyMappingConfiguration->setTypeConverterOption($mockTypeConverterClass, 'k1', 'v3');

Expand Down
4 changes: 4 additions & 0 deletions Neos.Flow/Tests/Unit/Reflection/Fixture/ArrayAccessClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,25 @@ public function __construct(array $array)
$this->array = $array;
}

#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return array_key_exists($offset, $this->array);
}

#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->array[$offset];
}

#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->array[$offset] = $value;
}

#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->array[$offset]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ protected function renderOptionTag(mixed $value, string $label)
$output .= ' selected="selected"';
}

$output .= '>' . htmlspecialchars($label) . '</option>';
$output .= '>' . htmlspecialchars((string)$label) . '</option>';

return $output;
}
Expand Down
2 changes: 1 addition & 1 deletion Neos.Utility.Arrays/Classes/Arrays.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public static function unsetValueByPath(array $array, $path): array
* @return boolean true on success, false on failure
* @see asort()
*/
public static function sortKeysRecursively(array &$array, int $sortFlags = SORT_REGULAR): bool
public static function sortKeysRecursively(array &$array, int $sortFlags = \SORT_REGULAR): bool
{
foreach ($array as &$value) {
if (is_array($value)) {
Expand Down
2 changes: 1 addition & 1 deletion Neos.Utility.Files/Classes/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public static function copyDirectoryRecursively(string $sourceDirectory, string
* @return mixed The file content as a string or false if the file could not be opened.
* @api
*/
public static function getFileContents(string $pathAndFilename, int $flags = 0, $context = null, int $offset = null, int $maximumLength = -1)
public static function getFileContents(string $pathAndFilename, int $flags = 0, $context = null, int $offset = 0, int $maximumLength = -1)
{
if ($flags === true) {
$flags = FILE_USE_INCLUDE_PATH;
Expand Down
1 change: 0 additions & 1 deletion Neos.Utility.ObjectHandling/Classes/TypeHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* source code.
*/

use Doctrine\Common\Collections\Collection;
use Doctrine\Persistence\Proxy;
use Neos\Utility\Exception\InvalidTypeException;

Expand Down

0 comments on commit ce84b41

Please sign in to comment.