Closed
Conversation
Contributor
|
@xaav As I said in your previous PR, you are only setting an error handler for the testsuite, which is totally useless as this is already done by PHPUnit when you configure it to do it (and it let the user change it through its PHPUnit config). So this change is just useless |
Member
naderman
referenced
this pull request
in naderman/composer
Sep 25, 2011
naderman
added a commit
that referenced
this pull request
Apr 29, 2012
Closed
digitalkaoz
pushed a commit
to digitalkaoz/composer
that referenced
this pull request
Nov 22, 2013
digitalkaoz
pushed a commit
to digitalkaoz/composer
that referenced
this pull request
Nov 22, 2013
digitalkaoz
pushed a commit
to digitalkaoz/composer
that referenced
this pull request
Nov 22, 2013
Whitelist dependencies
This was referenced Dec 22, 2014
Closed
jrfnl
added a commit
to jrfnl/composer
that referenced
this pull request
Aug 12, 2021
…ly fix) Not all tests in the `InstallerTest` class actually create a temporary directory and set the `$this->tempComposerHome` property. Those tests which didn't, throw a notice in PHP 8.1. Fixes 3 notices along the lines of: ``` Deprecation triggered by Composer\Test\InstallerTest::tearDown: is_dir(): Passing null to parameter composer#1 ($filename) of type string is deprecated Stack trace: 0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 53) 1 tests/Composer/Test/InstallerTest.php(53): is_dir(NULL) ... ```
jrfnl
added a commit
to jrfnl/composer
that referenced
this pull request
Aug 12, 2021
The default state for the `ProcessExecutor::$errorOutput` property is "not set" and if there has been no error during the execution of the process, it may well still be, resulting in the return value of `$this->process->getErrorOutput()` being `null`. In that case, we may as well bypass the whole `foreach` as it will never match any of the recognized authentication failure messages. Fixes a total of 5 deprecation notices along the lines of: ``` Deprecation triggered by Composer\Test\Downloader\GitDownloaderTest::testDownloadThrowsRuntimeExceptionIfGitCommandFails: strpos(): Passing null to parameter composer#1 ($haystack) of type string is deprecated Stack trace: 0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 340) 1 src/Composer/Util/Git.php(340): strpos(NULL, '...') 2 src/Composer/Util/Git.php(200): Composer\Util\Git->isAuthenticationFailure('...', Array) 3 src/Composer/Downloader/GitDownloader.php(121): Composer\Util\Git->runCommand(Object(Closure), '...', NULL, true) 4 src/Composer/Downloader/VcsDownloader.php(137): Composer\Downloader\GitDownloader->doInstall(Object(Mock_PackageInterface_f8be9ebd), '...', '...') 5 tests/Composer/Test/Downloader/GitDownloaderTest.php(349): Composer\Downloader\VcsDownloader->install(Object(Mock_PackageInterface_f8be9ebd), '...') ... ```
jrfnl
added a commit
to jrfnl/composer
that referenced
this pull request
Aug 12, 2021
The `LibraryInstallerTest::testUninstall()` method mocks a `Package` object, but did not set an expectation for a call to `getName()`, while that method _is_ called in the `LibraryInstaller::uninstall()` method. Without expectation, the mock returns `null`, which was subsequently being passed on to `strpos()` leading to the below error. Fixes: ``` Deprecation triggered by Composer\Test\Installer\LibraryInstallerTest::testUninstall: strpos(): Passing null to parameter composer#1 ($haystack) of type string is deprecated Stack trace: 0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 202) 1 src/Composer/Installer/LibraryInstaller.php(202): strpos(NULL, '...') 2 vendor/react/promise/src/FulfilledPromise.php(28): Composer\Installer\LibraryInstaller->Composer\Installer\{closure}(NULL) 3 src/Composer/Installer/LibraryInstaller.php(208): React\Promise\FulfilledPromise->then(Object(Closure)) 4 tests/Composer/Test/Installer/LibraryInstallerTest.php(221): Composer\Installer\LibraryInstaller->uninstall(Object(Mock_InstalledRepositoryInterface_e3699f95), Object(Mock_Package_e4571076)) ... ```
jrfnl
added a commit
to jrfnl/composer
that referenced
this pull request
Aug 12, 2021
The default state for the `ProcessExecutor::$errorOutput` property is "not set" and if there has been no error during the execution of the process, it may well still be, resulting in the return value of `$this->process->getErrorOutput()` being `null`. In that case, we may as well bypass the whole `foreach` as it will never match any of the recognized authentication failure messages. Includes correcting the return type for the `ProcessExecutor::getErrorOutput()` method. There are several alternative solutions possible here: * Set a default value for the `ProcessExecutor::$errorOutput` property of an empty string. * Check within the `ProcessExecutor::getErrorOutput()` method whether the property is set and if not, return an empty string. Not sure what is the best solution, please provide guidance. Fixes a total of 5 deprecation notices along the lines of: ``` Deprecation triggered by Composer\Test\Downloader\GitDownloaderTest::testDownloadThrowsRuntimeExceptionIfGitCommandFails: strpos(): Passing null to parameter composer#1 ($haystack) of type string is deprecated Stack trace: 0 [internal function]: Symfony\Bridge\PhpUnit\DeprecationErrorHandler->handleError(8192, '...', '...', 340) 1 src/Composer/Util/Git.php(340): strpos(NULL, '...') 2 src/Composer/Util/Git.php(200): Composer\Util\Git->isAuthenticationFailure('...', Array) 3 src/Composer/Downloader/GitDownloader.php(121): Composer\Util\Git->runCommand(Object(Closure), '...', NULL, true) 4 src/Composer/Downloader/VcsDownloader.php(137): Composer\Downloader\GitDownloader->doInstall(Object(Mock_PackageInterface_f8be9ebd), '...', '...') 5 tests/Composer/Test/Downloader/GitDownloaderTest.php(349): Composer\Downloader\VcsDownloader->install(Object(Mock_PackageInterface_f8be9ebd), '...') ... ```
glaubinix
added a commit
to glaubinix/composer
that referenced
this pull request
Feb 9, 2022
…of type array, null given
glaubinix
added a commit
to glaubinix/composer
that referenced
this pull request
Feb 9, 2022
…of type array, null given
glaubinix
added a commit
to glaubinix/composer
that referenced
this pull request
Jun 24, 2022
…mposer#1 () must be of type string, int given
glaubinix
added a commit
to glaubinix/composer
that referenced
this pull request
Jun 24, 2022
…mposer#1 () must be of type string, int given
glaubinix
added a commit
to glaubinix/composer
that referenced
this pull request
Jun 24, 2022
…mposer#1 () must be of type string, int given
Seldaek
pushed a commit
that referenced
this pull request
Jun 24, 2022
…ust be of type string, int given (#10897)
Closed
ktomk
referenced
this pull request
in ktomk/composer
Jun 30, 2022
Fix string type requirement in case of NULL value:
[TypeError]
Composer\Command\InitCommand::parseAuthorString(): Argument #1 ($author) must be of type string, null given, called in phar:///composer.phar/src/Composer/Command/InitCommand.php on line 345
Seldaek
pushed a commit
that referenced
this pull request
Jul 1, 2022
Fix string type requirement in case of NULL value:
[TypeError]
Composer\Command\InitCommand::parseAuthorString(): Argument #1 ($author) must be of type string, null given, called in phar:///composer.phar/src/Composer/Command/InitCommand.php on line 345
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed errors to exceptions, because: