1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Add void types where no return statement is present

This commit is contained in:
Jordi Boggiano 2022-02-18 10:38:54 +01:00
parent 32852304d0
commit abdc6893a6
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
213 changed files with 1129 additions and 1130 deletions

View file

@ -17,7 +17,7 @@ use Composer\Test\TestCase;
class InitCommandTest extends TestCase
{
public function testParseValidAuthorString()
public function testParseValidAuthorString(): void
{
$command = new InitCommand;
$author = $command->parseAuthorString('John Smith <john@example.com>');
@ -25,7 +25,7 @@ class InitCommandTest extends TestCase
$this->assertEquals('john@example.com', $author['email']);
}
public function testParseValidAuthorStringWithoutEmail()
public function testParseValidAuthorStringWithoutEmail(): void
{
$command = new InitCommand;
$author = $command->parseAuthorString('John Smith');
@ -33,7 +33,7 @@ class InitCommandTest extends TestCase
$this->assertNull($author['email']);
}
public function testParseValidUtf8AuthorString()
public function testParseValidUtf8AuthorString(): void
{
$command = new InitCommand;
$author = $command->parseAuthorString('Matti Meikäläinen <matti@example.com>');
@ -41,7 +41,7 @@ class InitCommandTest extends TestCase
$this->assertEquals('matti@example.com', $author['email']);
}
public function testParseValidUtf8AuthorStringWithNonSpacingMarks()
public function testParseValidUtf8AuthorStringWithNonSpacingMarks(): void
{
// \xCC\x88 is UTF-8 for U+0308 diaeresis (umlaut) combining mark
$utf8_expected = "Matti Meika\xCC\x88la\xCC\x88inen";
@ -51,7 +51,7 @@ class InitCommandTest extends TestCase
$this->assertEquals('matti@example.com', $author['email']);
}
public function testParseNumericAuthorString()
public function testParseNumericAuthorString(): void
{
$command = new InitCommand;
$author = $command->parseAuthorString('h4x0r <h4x@example.com>');
@ -63,7 +63,7 @@ class InitCommandTest extends TestCase
* Test scenario for issue #5631
* @link https://github.com/composer/composer/issues/5631 Issue #5631
*/
public function testParseValidAlias1AuthorString()
public function testParseValidAlias1AuthorString(): void
{
$command = new InitCommand;
$author = $command->parseAuthorString(
@ -77,7 +77,7 @@ class InitCommandTest extends TestCase
* Test scenario for issue #5631
* @link https://github.com/composer/composer/issues/5631 Issue #5631
*/
public function testParseValidAlias2AuthorString()
public function testParseValidAlias2AuthorString(): void
{
$command = new InitCommand;
$author = $command->parseAuthorString(
@ -87,35 +87,35 @@ class InitCommandTest extends TestCase
$this->assertEquals('john@example.com', $author['email']);
}
public function testParseEmptyAuthorString()
public function testParseEmptyAuthorString(): void
{
$command = new InitCommand;
self::expectException('InvalidArgumentException');
$command->parseAuthorString('');
}
public function testParseAuthorStringWithInvalidEmail()
public function testParseAuthorStringWithInvalidEmail(): void
{
$command = new InitCommand;
self::expectException('InvalidArgumentException');
$command->parseAuthorString('John Smith <john>');
}
public function testNamespaceFromValidPackageName()
public function testNamespaceFromValidPackageName(): void
{
$command = new InitCommand;
$namespace = $command->namespaceFromPackageName('new_projects.acme-extra/package-name');
$this->assertEquals('NewProjectsAcmeExtra\PackageName', $namespace);
}
public function testNamespaceFromInvalidPackageName()
public function testNamespaceFromInvalidPackageName(): void
{
$command = new InitCommand;
$namespace = $command->namespaceFromPackageName('invalid-package-name');
$this->assertNull($namespace);
}
public function testNamespaceFromMissingPackageName()
public function testNamespaceFromMissingPackageName(): void
{
$command = new InitCommand;
$namespace = $command->namespaceFromPackageName('');