Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK: PHP 7.4 compatibility #1872

Merged
merged 4 commits into from Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 24 additions & 8 deletions .travis.yml
Expand Up @@ -10,24 +10,40 @@ matrix:
addons:
mariadb: '10.2'
- php: 7.1
env: DB=pgsql
sudo: required
env: DB=mysql BEHAT=true
addons:
postgresql: "9.4"
- php: 7.1
mariadb: '10.2'
- php: 7.2
env: DB=mysql
addons:
mariadb: '10.2'
- php: 7.2
env: DB=mysql BEHAT=true
addons:
mariadb: '10.2'
- php: 7.1
- php: 7.3
env: DB=mysql
addons:
mariadb: '10.2'
- php: 7.3
env: DB=mysql BEHAT=true
addons:
mariadb: '10.2'
- php: 7.4snapshot
env: DB=pgsql
sudo: required
addons:
postgresql: "9.4"
- php: 7.4snapshot
env: DB=pgsql BEHAT=true
sudo: required
addons:
postgresql: "9.4"
- php: 7.2
- php: 7.4snapshot
env: DB=mysql
addons:
mariadb: '10.2'
- php: 7.2
- php: 7.4snapshot
env: DB=mysql BEHAT=true
addons:
mariadb: '10.2'
Expand All @@ -38,7 +54,7 @@ before_install:
- export NEOS_TARGET_REPOSITORY=neos/flow-development-collection
- export NEOS_TARGET_VERSION=5.3
- if [ "$DB" = "pgsql" ]; then sudo mount -o remount,size=25% /var/ramfs ; fi
- phpenv config-rm xdebug.ini
- phpenv config-rm xdebug.ini || echo "xdebug not available"
- env
- sudo add-apt-repository ppa:git-core/ppa -y
- sudo apt-get update
Expand Down
1 change: 0 additions & 1 deletion Neos.Eel/Tests/Unit/Helper/StringHelperTest.php
Expand Up @@ -118,7 +118,6 @@ public function chrExamples()
return [
['value' => 65, 'expected' => 'A'],
['value' => 256, 'expected' => chr(256)],
['value' => 'not a number', 'expected' => chr('not a number')],
['value' => 0, 'expected' => chr(0)],
];
}
Expand Down
Expand Up @@ -408,7 +408,7 @@ protected function getSubstringBetweenParentheses(string $string): string
$openParentheses--;
}
if ($openParentheses > 0) {
$substring .= $string{$i};
$substring .= $string[$i];
}
if ($string[$i] === '(') {
$openParentheses++;
Expand Down
4 changes: 2 additions & 2 deletions Neos.Flow/Classes/Http/Helper/UploadedFilesHelper.php
Expand Up @@ -40,10 +40,10 @@ public static function untangleFilesArray(array $convolutedFiles): array

foreach ($fieldPaths as $fieldPath) {
if (count($fieldPath) === 1) {
$fileInformation = $convolutedFiles[$fieldPath{0}];
$fileInformation = $convolutedFiles[$fieldPath[0]];
} else {
$fileInformation = [];
foreach ($convolutedFiles[$fieldPath{0}] as $key => $subStructure) {
foreach ($convolutedFiles[$fieldPath[0]] as $key => $subStructure) {
$fileInformation[$key] = Arrays::getValueByPath($subStructure, array_slice($fieldPath, 1));
}
}
Expand Down
15 changes: 9 additions & 6 deletions Neos.Flow/Classes/Session/Session.php
Expand Up @@ -630,14 +630,17 @@ public function collectGarbage()
if ($sessionIdentifier === '_garbage-collection-running') {
continue;
}
if (!is_array($sessionInfo)) {
$sessionInfo = [
'sessionMetaData' => $sessionInfo,
'lastActivityTimestamp' => 0,
'storageIdentifier' => null
];
$this->logger->warning('SESSION INFO INVALID: ' . $sessionIdentifier, $sessionInfo + LogEnvironment::fromMethodName(__METHOD__));
}
$lastActivitySecondsAgo = $this->now - $sessionInfo['lastActivityTimestamp'];
if ($lastActivitySecondsAgo > $this->inactivityTimeout) {
if ($sessionInfo['storageIdentifier'] === null) {
if (!is_array($sessionInfo)) {
$sessionInfo = ['sessionMetaData' => $sessionInfo];
}
$this->logger->warning('SESSION INFO INVALID: ' . $sessionIdentifier, $sessionInfo + LogEnvironment::fromMethodName(__METHOD__));
} else {
if ($sessionInfo['storageIdentifier'] !== null) {
$this->storageCache->flushByTag($sessionInfo['storageIdentifier']);
$sessionRemovalCount++;
}
Expand Down
2 changes: 1 addition & 1 deletion Neos.Flow/Tests/Unit/Mvc/Routing/RouteTest.php
Expand Up @@ -409,7 +409,7 @@ public function setDefaultsAllowsToSetTheDefaultPackageControllerAndActionName()
$this->routeMatchesPath('SomePackage');
$matchResults = $this->route->getMatchResults();

$this->assertEquals($defaults['@controller'], $matchResults{'@controller'});
$this->assertEquals($defaults['@controller'], $matchResults['@controller']);
$this->assertEquals($defaults['@action'], $matchResults['@action']);
}

Expand Down
12 changes: 11 additions & 1 deletion Neos.Flow/Tests/Unit/Persistence/Generic/SessionTest.php
Expand Up @@ -151,8 +151,18 @@ public function isDirtyReturnsFalseForNullInBothCurrentAndCleanValue()
eval('class ' . $className . ' { public $foo; }');
$object = new $className();

$cleanData = [
'identifier' => 'fakeUuid',
'properties' => [
'foo' => [
'type' => 'string',
'multivalue' => false,
'value' => null
]
]
];
$session = $this->getMockBuilder(Persistence\Generic\Session::class)->setMethods(['getIdentifierByObject'])->getMock();
$session->registerReconstitutedEntity($object, ['identifier' => 'fakeUuid']);
$session->registerReconstitutedEntity($object, $cleanData);
$session->expects($this->once())->method('getIdentifierByObject')->will($this->returnValue('fakeUuid'));

$this->assertFalse($session->isDirty($object, 'foo'));
Expand Down