Skip to content

Commit

Permalink
Fix deprecation and add baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse committed Sep 10, 2021
1 parent a63a4ea commit cdaae33
Show file tree
Hide file tree
Showing 8 changed files with 184 additions and 6 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,21 @@ 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[total]=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
localExit=0
./vendor/bin/simple-phpunit -c ./$COMPONENT 2>&1 || localExit=1
PHPUNIT=$PWD/vendor/bin/simple-phpunit
cd $COMPONENT
$PHPUNIT 2>&1 || localExit=1
cd -
ok=$(( $localExit || $ok ))
echo ::endgroup::
if [ $localExit -ne 0 ]; then
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[total]=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="baselineFile=./tests/baseline.json&amp;max[total]=0" />
</php>
<testsuites>
<testsuite name="Test Suite">
Expand Down
12 changes: 12 additions & 0 deletions src/Integration/Laravel/Queue/tests/baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"location": "AsyncAws\\Illuminate\\Queue\\Tests\\Unit\\AsyncAwsSqsQueueTest::testPush",
"message": "Ramsey\\Uuid\\Uuid implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Queue\\Tests\\Unit\\AsyncAwsSqsQueueTest::testPush",
"message": "Ramsey\\Uuid\\Lazy\\LazyUuidFromString implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)",
"count": 1
}
]
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
142 changes: 142 additions & 0 deletions tests/baseline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
[
{
"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
},
{
"location": "AsyncAws\\Illuminate\\Mail\\Tests\\Unit\\ServiceProviderTest::testCreateTransport",
"message": "Method \"Swift_Transport::isStarted()\" might add \"bool\" as a native return type declaration in the future. Do the same in implementation \"Illuminate\\Mail\\Transport\\Transport\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Mail\\Tests\\Unit\\ServiceProviderTest::testCreateTransport",
"message": "Method \"Swift_Transport::ping()\" might add \"bool\" as a native return type declaration in the future. Do the same in implementation \"Illuminate\\Mail\\Transport\\Transport\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Mail\\Tests\\Unit\\Transport\\AsyncAwsSesTransportTest::testSend",
"message": "Method \"Swift_Mime_ContentEncoder::getName()\" might add \"string\" as a native return type declaration in the future. Do the same in implementation \"Swift_Mime_ContentEncoder_QpContentEncoderProxy\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Mail\\Tests\\Unit\\Transport\\AsyncAwsSesTransportTest::testSend",
"message": "Method \"Swift_Encoder::encodeString()\" might add \"string\" as a native return type declaration in the future. Do the same in implementation \"Swift_Mime_ContentEncoder_QpContentEncoderProxy\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Mail\\Tests\\Unit\\Transport\\AsyncAwsSesTransportTest::testSend",
"message": "Method \"Swift_InputByteStream::write()\" might add \"int\" as a native return type declaration in the future. Do the same in implementation \"Swift_KeyCache_SimpleKeyCacheInputStream\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Mail\\Tests\\Unit\\Transport\\AsyncAwsSesTransportTest::testSend",
"message": "The \"Swift_Events_EventObject::cancelBubble()\" method will require a new \"bool $cancel,\" argument in the next major version of its interface \"Swift_Events_Event\", not defining it is deprecated.",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Queue\\Tests\\Unit\\AsyncAwsSqsQueueTest::testPop",
"message": "Method \"Psr\\Container\\ContainerInterface::has()\" might add \"bool\" as a native return type declaration in the future. Do the same in implementation \"Illuminate\\Container\\Container\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
},
{
"location": "AsyncAws\\Illuminate\\Queue\\Tests\\Unit\\AsyncAwsSqsQueueTest::testPop",
"message": "Method \"Psr\\Container\\ContainerInterface::get()\" might add \"mixed\" as a native return type declaration in the future. Do the same in implementation \"Illuminate\\Container\\Container\" now to avoid errors or add an explicit @return annotation to suppress this message.",
"count": 1
}
]

0 comments on commit cdaae33

Please sign in to comment.