Skip to content

Commit

Permalink
Fix deprecation and add baseline (#1096)
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse committed Sep 11, 2021
1 parent a0cced8 commit f357ad5
Show file tree
Hide file tree
Showing 7 changed files with 127 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,12 @@ jobs:
- name: Run tests
env:
SYMFONY_PHPUNIT_VERSION: ${{ matrix.phpunit_version }}
SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.strategy == 'lowest' && '9999' || '1' }}
OVERRIDE_SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.strategy == 'lowest' && 'max[self]=9999' || '' }}
run: |
ok=0
if [ -n "$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER" ]; then
export SYMFONY_DEPRECATIONS_HELPER=$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER
fi
for COMPONENT in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$COMPONENT
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ini name="error_reporting" value="-1"/>
<env name="AWS_SHARED_CREDENTIALS_FILE" value="/dev/null" />
<env name="AWS_CONFIG_FILE" value="/dev/null" />
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=21&amp;max[indirect]=4" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="baselineFile=./tests/baseline.json&amp;max[self]=0&amp;verbose=0" />
</php>
<testsuites>
<testsuite name="Test Suite">
Expand Down
18 changes: 18 additions & 0 deletions src/Integration/Aws/DynamoDbSession/src/SessionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ public function setUp(): void
]);
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function close()
{
Expand All @@ -108,6 +111,9 @@ public function close()
return $this->sessionWritten;
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function destroy($sessionId)
{
Expand All @@ -121,13 +127,19 @@ public function destroy($sessionId)
return $this->sessionWritten = true;
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function gc($maxLifetime)
{
// DynamoDB takes care of garbage collection
return true;
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function open($savePath, $name)
{
Expand All @@ -136,6 +148,9 @@ public function open($savePath, $name)
return true;
}

/**
* @return string
*/
#[\ReturnTypeWillChange]
public function read($sessionId)
{
Expand All @@ -161,6 +176,9 @@ public function read($sessionId)
return $this->dataRead;
}

/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function write($sessionId, $sessionData)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Integration/Laravel/Queue/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</include>
</coverage>
<php>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
<ini name="error_reporting" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;verbose=0" />
</php>
<testsuites>
<testsuite name="Test Suite">
Expand Down
1 change: 0 additions & 1 deletion src/Integration/Symfony/Bundle/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0" />
</php>
<testsuites>
<testsuite name="Test Suite">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public function testIssue793()
self::assertSame('./docker/dynamodb/credentials', $x->getConfiguration()->get('sharedCredentialsFile'));
}

protected function getBundleClass()
protected function getBundleClass(): string
{
return AsyncAwsBundle::class;
}
Expand Down
102 changes: 102 additions & 0 deletions tests/baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
[
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::write()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::update()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::rename()\" might add \"bool\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::delete()\" might add \"bool\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::deleteDir()\" might add \"bool\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::createDir()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::has()\" might add \"array|bool|null\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::read()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::listContents()\" might add \"array\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::getMetadata()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::getSize()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::getMimetype()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::getTimestamp()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::writeStream()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::updateStream()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::copy()\" might add \"bool\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::readStream()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\AdapterInterface::setVisibility()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\ReadInterface::getVisibility()\" might add \"array|false\" as a native return type declaration in the future. Do the same in implementation \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Flysystem\\S3\\Tests\\Integration\\AsyncAwsS3AdapterTest::testWrite",
"message": "Method \"League\\Flysystem\\Adapter\\AbstractAdapter::applyPathPrefix()\" might add \"string\" as a native return type declaration in the future. Do the same in child class \"AsyncAws\\Flysystem\\S3\\AsyncAwsS3Adapter\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
}
]

0 comments on commit f357ad5

Please sign in to comment.