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

PHP 8.1 compatibility #10038

Closed
jrfnl opened this issue Aug 5, 2021 · 10 comments · Fixed by #10061
Closed

PHP 8.1 compatibility #10038

jrfnl opened this issue Aug 5, 2021 · 10 comments · Fixed by #10061
Milestone

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Aug 5, 2021

While trying to figure out whether there are any tests covering a particular PHP 8.1 issue I'd encountered elsewhere (see #10037), I toggled the value for SYMFONY_DEPRECATIONS_HELPER in the phpunit.xml.dist file from weak to max[self]=0 and found there are still some 458 deprecation notices to be addressed, with only 11 of those related to underlying dependencies of Composer.

I've already fixed a few in #10036 (fixes 176 notices).

I'm willing to spend some more time on creating fixes for these issues, but wanted to check first if there is already work ongoing for this or not, to prevent interfering with ongoing efforts/double work.

As a side-note: fixing these issues is kind of slow going as I need to go via the CI to get the issue details as I have not been able to get the tests running locally on PHP 8.1 with Symfony PHPUnit Bridge.

It might be an idea to add some additional information to the CONTRIBUTING doc to guide people on how to get the tests running locally on PHP 8.0+ ?


Summary list of deprecation notices found in the test run (fold out for details)
Unsilenced deprecation notices (458)

  205x: preg_split(): Passing null to parameter #3 ($limit) of type int is deprecated
    157x in InstallerTest::getIntegrationTests from Composer\Test
    18x in PoolBuilderTest::getIntegrationTests from Composer\Test\DependencyResolver
    8x in NoProxyPatternTest::testHostName from Composer\Test\Util
    6x in NoProxyPatternTest::testIpAddress from Composer\Test\Util
    6x in NoProxyPatternTest::testIpRange from Composer\Test\Util
    4x in NoProxyPatternTest::testPort from Composer\Test\Util
    3x in ProxyManagerTest::testGetProxyForRequest from Composer\Test\Util\Http
    1x in InstallerTest::getSlowIntegrationTests from Composer\Test
    1x in StreamContextFactoryTest::testHttpProxyWithNoProxy from Composer\Test\Util
    1x in StreamContextFactoryTest::testHttpProxyWithNoProxyWildcard from Composer\Test\Util

  128x: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated
    95x in InstallerTest::testIntegration from Composer\Test
    25x in VersionSelectorTest::testFindRecommendedRequireVersion from Composer\Test\Package\Version
    5x in GitDownloaderTest::testDownloadThrowsRuntimeExceptionIfGitCommandFails from Composer\Test\Downloader
    1x in SolverTest::testConflictResultEmpty from Composer\Test\DependencyResolver
    1x in SolverTest::testRequireMismatchException from Composer\Test\DependencyResolver
    1x in LibraryInstallerTest::testUninstall from Composer\Test\Installer

  28x: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
    7x in InstallerTest::testIntegration from Composer\Test
    3x in GitDownloaderTest::testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover from Composer\Test\Downloader
    3x in ArchiveManagerTest::testArchiveTar from Composer\Test\Package\Archiver
    2x in PoolBuilderTest::testPoolBuilder from Composer\Test\DependencyResolver
    2x in GitDownloaderTest::testDownload from Composer\Test\Downloader
    2x in GitDownloaderTest::testDownloadWithCache from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdate from Composer\Test\Downloader
    2x in GitDownloaderTest::testDowngradeShowsAppropriateMessage from Composer\Test\Downloader
    2x in GitDownloaderTest::testNotUsingDowngradingWithReferences from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateWithNewRepoUrl from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateThrowsRuntimeExceptionIfGitCommandFails from Composer\Test\Downloader
    1x in ArchiveManagerTest::testArchiveCustomFileName from Composer\Test\Package\Archiver

  20x: trim(): Passing null to parameter #1 ($string) of type string is deprecated
    2x in GitDownloaderTest::testUpdate from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdateWithNewRepoUrl from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdateThrowsRuntimeExceptionIfGitCommandFails from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover from Composer\Test\Downloader
    2x in GitDownloaderTest::testDowngradeShowsAppropriateMessage from Composer\Test\Downloader
    2x in GitDownloaderTest::testNotUsingDowngradingWithReferences from Composer\Test\Downloader
    2x in VersionGuesserTest::testHgGuessVersionReturnsData from Composer\Test\Package\Version
    1x in FossilDownloaderTest::testUpdate from Composer\Test\Downloader
    1x in HgDownloaderTest::testUpdate from Composer\Test\Downloader
    1x in BitbucketTest::testAuthorizeOAuthInteractivelyWithEmptyUsername from Composer\Test\Util
    1x in BitbucketTest::testAuthorizeOAuthInteractivelyWithEmptyPassword from Composer\Test\Util
    1x in BitbucketTest::testAuthorizeOAuthWithAvailableGitConfigToken from Composer\Test\Util
    1x in ProcessExecutorTest::testSplitLines from Composer\Test\Util

  17x: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated
    2x in PerforceDriverTest::testInitializeCapturesVariablesFromRepoConfig from Composer\Test\Repository\Vcs
    2x in PerforceTest::testWriteP4ClientSpecWithoutStream from Composer\Test\Util
    2x in PerforceTest::testGetBranchesWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetClientWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetStreamWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetClientSpec from Composer\Test\Util
    1x in PerforceTest::testGenerateP4Command from Composer\Test\Util
    1x in PerforceTest::testConnectClient from Composer\Test\Util
    1x in PerforceTest::testGetTagsWithoutStream from Composer\Test\Util
    1x in PerforceTest::testCheckStreamWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetComposerInformationWithoutLabelWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetComposerInformationWithLabelWithoutStream from Composer\Test\Util
    1x in PerforceTest::testSyncCodeBaseWithoutStream from Composer\Test\Util
    1x in PerforceTest::testCleanupClientSpecShouldDeleteClient from Composer\Test\Util

  10x: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
    2x in InstallerTest::testIntegration from Composer\Test
    2x in PerforceTest::testQueryP4UserQueriesForUser from Composer\Test\Util
    2x in PerforceTest::testQueryP4UserStoresResponseToQueryForUserWithWindows from Composer\Test\Util
    1x in PerforceTest::testQueryP4UserWithUserSetInP4VariablesWithWindowsOS from Composer\Test\Util
    1x in PerforceTest::testQueryP4UserWithUserSetInP4VariablesNotWindowsOS from Composer\Test\Util
    1x in PerforceTest::testQueryP4UserStoresResponseToQueryForUserWithoutWindows from Composer\Test\Util
    1x in PerforceTest::testQueryP4PasswordQueriesForPassword from Composer\Test\Util

  10x: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated
    5x in GitLabTest::testUsernamePasswordFailure from Composer\Test\Util
    3x in GitBitbucketDriverTest::testDriver from Composer\Test\Repository\Vcs
    1x in GitBitbucketDriverTest::testGetRootIdentifierWrongScmType from Composer\Test\Repository\Vcs
    1x in GitLabTest::testUsernamePasswordAuthenticationFlow from Composer\Test\Util

  7x: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
    1x in GitDownloaderTest::testUpdate from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateWithNewRepoUrl from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover from Composer\Test\Downloader
    1x in GitDownloaderTest::testDowngradeShowsAppropriateMessage from Composer\Test\Downloader
    1x in GitDownloaderTest::testNotUsingDowngradingWithReferences from Composer\Test\Downloader
    1x in GitTest::testRunCommandPrivateGitHubRepositoryNotInitialCloneNotInteractiveWithoutAuthentication from Composer\Test\Util
    1x in GitTest::testRunCommandPrivateGitHubRepositoryNotInitialCloneNotInteractiveWithAuthentication from Composer\Test\Util

  5x: is_dir(): Passing null to parameter #1 ($filename) of type string is deprecated
    3x in InstallerTest::tearDown from Composer\Test
    2x in InstallerTest::testInstaller from Composer\Test

  5x: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
    5x in GitLabTest::testUsernamePasswordFailure from Composer\Test\Util

  4x: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated
    4x in InstallerTest::testIntegration from Composer\Test

  4x: PharData::__construct(): Passing null to parameter #2 ($flags) of type int is deprecated
    1x in ArchiveManagerTest::testArchiveTar from Composer\Test\Package\Archiver
    1x in ArchiveManagerTest::testArchiveCustomFileName from Composer\Test\Package\Archiver
    1x in PharArchiverTest::testTarArchive from Composer\Test\Package\Archiver
    1x in PharArchiverTest::testZipArchive from Composer\Test\Package\Archiver

  1x: Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Finder::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: The Serializable interface is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)
    1x in ClassLoader::loadClass from Composer\Autoload

  1x: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in ApplicationTest::testDevWarning from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\DepthRangeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in XzDownloaderTest::testErrorMessages from Composer\Test\Downloader

  1x: Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated
    1x in JsonValidationExceptionTest::testGetErrors from Composer\Test\Json

  1x: Return type of Composer\Package\Archiver\ArchivableFilesFinder::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in ArchivableFilesFinderTest::testManualExcludes from Composer\Test\Package\Archiver

  1x: Return type of Symfony\Component\Finder\Iterator\CustomFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in ArchivableFilesFinderTest::testManualExcludes from Composer\Test\Package\Archiver

  1x: Return type of Composer\Package\Archiver\ArchivableFilesFilter::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in ArchiveManagerTest::testArchiveTar from Composer\Test\Package\Archiver


@Seldaek
Copy link
Member

Seldaek commented Aug 11, 2021

To run locally you probably have to run composer config platform.php --unset && composer update to make sure you get the latest version of symfony/phpunit-bridge. I believe that will fix the issue, but not 100% sure. I usually run the tests locally with php7.4 to avoid problems, but in this case this would definitely not help you.

This will be resolved in composer 2.3 btw once we drop old PHP versions, so not sure it's worth investing much time in making it smoother to run on modern PHP, given the CI does it for us.

@Seldaek
Copy link
Member

Seldaek commented Aug 11, 2021

As for the deprecation warnings, please do feel free to send more fixes if needed (I haven't checked the current state after merging your PRs).

@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 11, 2021

@Seldaek Thanks for getting back to me.

composerdev config platform.php --unset && composer update --ignore-platform-reqs actually gets things installed locally (with composerdev being a local alias to point to the master branch of my cloned local copy of the repo), but that's not the problem.

Symfony bridge does their own install when you run composer test or vendor/bin/simple-phpunit and a test run then ends (or rather never even starts) with a Fatal error: Declaration of Composer\Test\AllFunctionalTest::setUpBeforeClass() must be compatible with PHPUnit\Framework\TestCase::setUpBeforeClass(): void in path/to/composer/tests/Composer/Test/AllFunctionalTest.php on line 48

💦 Test run command output (fold-out for details)
composerdev test
PHP 8.1.0beta2 (cli) (built: Aug  3 2021 14:22:05) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.0-dev, Copyright (c) Zend Technologies

Composer 2.1.999-dev+source @release_date@

> simple-phpunit
No composer.json found in the current directory, showing available packages from packagist.org
Creating a "phpunit/phpunit" project at "./phpunit-8.5-0"
Installing phpunit/phpunit (8.5.19)
Plugins have been disabled.
  - Downloading phpunit/phpunit (8.5.19)
  - Installing phpunit/phpunit (8.5.19): Extracting archive
Created project in path/to/composer/vendor/bin/.phpunit/phpunit-8.5-0
composer.json has been updated
composer.json has been updated
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Lock file operations: 24 installs, 0 updates, 0 removals
  - Locking doctrine/instantiator (1.4.0)
  - Locking myclabs/deep-copy (1.10.2)
  - Locking phar-io/manifest (2.0.3)
  - Locking phar-io/version (3.1.0)
  - Locking phpunit/php-code-coverage (7.0.15)
  - Locking phpunit/php-file-iterator (2.0.4)
  - Locking phpunit/php-text-template (1.2.1)
  - Locking phpunit/php-timer (2.1.3)
  - Locking phpunit/php-token-stream (4.0.4)
  - Locking sebastian/code-unit-reverse-lookup (1.0.2)
  - Locking sebastian/comparator (3.0.3)
  - Locking sebastian/diff (3.0.3)
  - Locking sebastian/environment (4.2.4)
  - Locking sebastian/exporter (3.1.3)
  - Locking sebastian/global-state (3.0.1)
  - Locking sebastian/object-enumerator (3.0.4)
  - Locking sebastian/object-reflector (1.1.2)
  - Locking sebastian/recursion-context (3.0.1)
  - Locking sebastian/resource-operations (2.0.2)
  - Locking sebastian/type (1.1.4)
  - Locking sebastian/version (2.0.1)
  - Locking symfony/deprecation-contracts (v2.4.0)
  - Locking symfony/phpunit-bridge (8.5.99)
  - Locking theseer/tokenizer (1.2.1)
Writing lock file
Installing dependencies from lock file
Package operations: 24 installs, 0 updates, 0 removals
  - Downloading phpunit/php-code-coverage (7.0.15)
  - Installing doctrine/instantiator (1.4.0): Extracting archive
  - Installing myclabs/deep-copy (1.10.2): Extracting archive
  - Installing phar-io/version (3.1.0): Extracting archive
  - Installing phar-io/manifest (2.0.3): Extracting archive
  - Installing theseer/tokenizer (1.2.1): Extracting archive
  - Installing sebastian/version (2.0.1): Extracting archive
  - Installing sebastian/environment (4.2.4): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (1.0.2): Extracting archive
  - Installing phpunit/php-token-stream (4.0.4): Extracting archive
  - Installing phpunit/php-text-template (1.2.1): Extracting archive
  - Installing phpunit/php-file-iterator (2.0.4): Extracting archive
  - Installing phpunit/php-code-coverage (7.0.15): Extracting archive
  - Installing phpunit/php-timer (2.1.3): Extracting archive
  - Installing sebastian/recursion-context (3.0.1): Extracting archive
  - Installing sebastian/exporter (3.1.3): Extracting archive
  - Installing sebastian/diff (3.0.3): Extracting archive
  - Installing sebastian/comparator (3.0.3): Extracting archive
  - Installing sebastian/object-reflector (1.1.2): Extracting archive
  - Installing sebastian/global-state (3.0.1): Extracting archive
  - Installing sebastian/object-enumerator (3.0.4): Extracting archive
  - Installing sebastian/resource-operations (2.0.2): Extracting archive
  - Installing sebastian/type (1.1.4): Extracting archive
  - Installing symfony/deprecation-contracts (v2.4.0): Extracting archive
  - Installing symfony/phpunit-bridge (8.5.99): Mirroring from path/to/composer/vendor/symfony/phpunit-bridge
5 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
19 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

Fatal error: Declaration of Composer\Test\AllFunctionalTest::setUpBeforeClass() must be compatible with PHPUnit\Framework\TestCase::setUpBeforeClass(): void in path/to/composer/Test/AllFunctionalTest.php on line 48
Script simple-phpunit handling the test event returned with error code 255

Exit code is 255

And if I hack the vendor/bin/simple-phpunit.bat file (yes, I'm on Windows) to use PHP 8.1.0-beta2 and not the system default PHP version (7.4.x), I still end up with:

"vendor/bin/simple-phpunit"

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in path/to/composer/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php on line 152

Fatal error: Declaration of Composer\Test\AllFunctionalTest::setUpBeforeClass() must be compatible with PHPUnit\Framework\TestCase::setUpBeforeClass(): void in path/to/composer/tests/Composer/Test/AllFunctionalTest.php on line 48

I tried all sorts last week without luck and to be honest, don't really want to waste much more time on getting that working, so I guess I'll just have to use CI to debug for now.

<rant>The experience trying to get these tests running locally on PHP 8.1 only went to confirm/reiterate everything I don't like about Symfony PHPUnit Bridge.... so glad that things work much simpler with PHPUnit Polyfills, but hey, I'm biased... Once support for PHP < 5.4 has been dropped, Composer may be able to use the Polyfills too 😂 </rant>

Current state after the merges: still some 237 deprecation notices remaining. See the details in the fold-out below.

I'm lining up some more fixes for you, but those will need much more critical review than the previous fixes, which were the obvious ones.


Summary list of deprecation notices found in the test run after previous merges (fold out for details)
Unsilenced deprecation notices (237)

  128x: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated
    95x in InstallerTest::testIntegration from Composer\Test
    25x in VersionSelectorTest::testFindRecommendedRequireVersion from Composer\Test\Package\Version
    5x in GitDownloaderTest::testDownloadThrowsRuntimeExceptionIfGitCommandFails from Composer\Test\Downloader
    1x in SolverTest::testConflictResultEmpty from Composer\Test\DependencyResolver
    1x in SolverTest::testRequireMismatchException from Composer\Test\DependencyResolver
    1x in LibraryInstallerTest::testUninstall from Composer\Test\Installer

  28x: preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
    7x in InstallerTest::testIntegration from Composer\Test
    3x in GitDownloaderTest::testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover from Composer\Test\Downloader
    3x in ArchiveManagerTest::testArchiveTar from Composer\Test\Package\Archiver
    2x in PoolBuilderTest::testPoolBuilder from Composer\Test\DependencyResolver
    2x in GitDownloaderTest::testDownload from Composer\Test\Downloader
    2x in GitDownloaderTest::testDownloadWithCache from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdate from Composer\Test\Downloader
    2x in GitDownloaderTest::testDowngradeShowsAppropriateMessage from Composer\Test\Downloader
    2x in GitDownloaderTest::testNotUsingDowngradingWithReferences from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateWithNewRepoUrl from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateThrowsRuntimeExceptionIfGitCommandFails from Composer\Test\Downloader
    1x in ArchiveManagerTest::testArchiveCustomFileName from Composer\Test\Package\Archiver

  20x: trim(): Passing null to parameter #1 ($string) of type string is deprecated
    2x in GitDownloaderTest::testUpdate from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdateWithNewRepoUrl from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdateThrowsRuntimeExceptionIfGitCommandFails from Composer\Test\Downloader
    2x in GitDownloaderTest::testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover from Composer\Test\Downloader
    2x in GitDownloaderTest::testDowngradeShowsAppropriateMessage from Composer\Test\Downloader
    2x in GitDownloaderTest::testNotUsingDowngradingWithReferences from Composer\Test\Downloader
    2x in VersionGuesserTest::testHgGuessVersionReturnsData from Composer\Test\Package\Version
    1x in FossilDownloaderTest::testUpdate from Composer\Test\Downloader
    1x in HgDownloaderTest::testUpdate from Composer\Test\Downloader
    1x in BitbucketTest::testAuthorizeOAuthInteractivelyWithEmptyUsername from Composer\Test\Util
    1x in BitbucketTest::testAuthorizeOAuthInteractivelyWithEmptyPassword from Composer\Test\Util
    1x in BitbucketTest::testAuthorizeOAuthWithAvailableGitConfigToken from Composer\Test\Util
    1x in ProcessExecutorTest::testSplitLines from Composer\Test\Util

  17x: strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated
    2x in PerforceDriverTest::testInitializeCapturesVariablesFromRepoConfig from Composer\Test\Repository\Vcs
    2x in PerforceTest::testWriteP4ClientSpecWithoutStream from Composer\Test\Util
    2x in PerforceTest::testGetBranchesWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetClientWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetStreamWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetClientSpec from Composer\Test\Util
    1x in PerforceTest::testGenerateP4Command from Composer\Test\Util
    1x in PerforceTest::testConnectClient from Composer\Test\Util
    1x in PerforceTest::testGetTagsWithoutStream from Composer\Test\Util
    1x in PerforceTest::testCheckStreamWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetComposerInformationWithoutLabelWithoutStream from Composer\Test\Util
    1x in PerforceTest::testGetComposerInformationWithLabelWithoutStream from Composer\Test\Util
    1x in PerforceTest::testSyncCodeBaseWithoutStream from Composer\Test\Util
    1x in PerforceTest::testCleanupClientSpecShouldDeleteClient from Composer\Test\Util

  10x: strlen(): Passing null to parameter #1 ($string) of type string is deprecated
    2x in InstallerTest::testIntegration from Composer\Test
    2x in PerforceTest::testQueryP4UserQueriesForUser from Composer\Test\Util
    2x in PerforceTest::testQueryP4UserStoresResponseToQueryForUserWithWindows from Composer\Test\Util
    1x in PerforceTest::testQueryP4UserWithUserSetInP4VariablesWithWindowsOS from Composer\Test\Util
    1x in PerforceTest::testQueryP4UserWithUserSetInP4VariablesNotWindowsOS from Composer\Test\Util
    1x in PerforceTest::testQueryP4UserStoresResponseToQueryForUserWithoutWindows from Composer\Test\Util
    1x in PerforceTest::testQueryP4PasswordQueriesForPassword from Composer\Test\Util

  7x: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
    1x in GitDownloaderTest::testUpdate from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateWithNewRepoUrl from Composer\Test\Downloader
    1x in GitDownloaderTest::testUpdateDoesntThrowsRuntimeExceptionIfGitCommandFailsAtFirstButIsAbleToRecover from Composer\Test\Downloader
    1x in GitDownloaderTest::testDowngradeShowsAppropriateMessage from Composer\Test\Downloader
    1x in GitDownloaderTest::testNotUsingDowngradingWithReferences from Composer\Test\Downloader
    1x in GitTest::testRunCommandPrivateGitHubRepositoryNotInitialCloneNotInteractiveWithoutAuthentication from Composer\Test\Util
    1x in GitTest::testRunCommandPrivateGitHubRepositoryNotInitialCloneNotInteractiveWithAuthentication from Composer\Test\Util

  5x: is_dir(): Passing null to parameter #1 ($filename) of type string is deprecated
    3x in InstallerTest::tearDown from Composer\Test
    2x in InstallerTest::testInstaller from Composer\Test

  5x: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
    5x in GitLabTest::testUsernamePasswordFailure from Composer\Test\Util

  4x: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated
    4x in InstallerTest::testIntegration from Composer\Test

  1x: Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Finder::count() should either be compatible with Countable::count(): int, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::hasChildren() should either be compatible with RecursiveIterator::hasChildren(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator::getChildren() should either be compatible with RecursiveIterator::getChildren(): ?RecursiveIterator, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in AllFunctionalTest::getTestFiles from Composer\Test

  1x: The Serializable interface is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)
    1x in ClassLoader::loadClass from Composer\Autoload

  1x: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in ApplicationTest::testDevWarning from Composer\Test

  1x: Return type of Symfony\Component\Finder\Iterator\DepthRangeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in XzDownloaderTest::testErrorMessages from Composer\Test\Downloader

  1x: Exception::__construct(): Passing null to parameter #1 ($message) of type string is deprecated
    1x in JsonValidationExceptionTest::testGetErrors from Composer\Test\Json

  1x: Return type of Symfony\Component\Finder\Iterator\CustomFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
    1x in ArchivableFilesFinderTest::testManualExcludes from Composer\Test\Package\Archiver

Remaining self deprecation notices (2)

  1x: getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.
    1x in InstalledVersionsTest::testGetRawData from Composer\Test

  1x: Composer\Util\MetadataMinifier is deprecated, use Composer\MetadataMinifier\MetadataMinifier from composer/metadata-minifier instead.
    1x in MetadataMinifierTest::testMinifyExpand from Composer\Test\Util

@Seldaek
Copy link
Member

Seldaek commented Aug 18, 2021

I think your last issue to run tests is that you need export SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 too, sorry I forgot about that.

@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 18, 2021

I think your last issue to run tests is that you need export SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 too, sorry I forgot about that.

Ha! That was the missing piece of the puzzle ;-)

I've submitted PR #10062 with the lessons learned from this to hopefully make this easier for other contributors in the future.

@Seldaek
Copy link
Member

Seldaek commented Aug 19, 2021

The few warnings left are in symfony, and ignored at runtime (only reported in phpunit), so I think it's looking good now 👍🏻

@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 19, 2021

@Seldaek Thank you so much for working with me to get this sorted. Much appreciated!

@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 19, 2021

@Seldaek Want me to have a look at the issue in the test framework still ?

1640x: preg_match(): Passing null to parameter #4 ($flags) of type int is deprecated
1640x in InstallerTest::testIntegration from Composer\Test

@Seldaek
Copy link
Member

Seldaek commented Aug 19, 2021

I looked at that already, it is an issue in symfony/console 2.x, which will not be fixed. That's why it does not happen on the "latest" deps build, only lowest 8.1 build.

@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 19, 2021

@Seldaek Ah, that makes perfect sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants