mirror of
https://github.com/composer/composer
synced 2025-05-10 17:12:51 +00:00
Add void types where no return statement is present
This commit is contained in:
parent
32852304d0
commit
abdc6893a6
213 changed files with 1129 additions and 1130 deletions
|
@ -20,44 +20,44 @@ use Composer\Test\TestCase;
|
|||
*/
|
||||
class TarTest extends TestCase
|
||||
{
|
||||
public function testReturnsNullifTheTarIsNotFound()
|
||||
public function testReturnsNullifTheTarIsNotFound(): void
|
||||
{
|
||||
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/invalid.zip');
|
||||
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
public function testReturnsNullIfTheTarIsEmpty()
|
||||
public function testReturnsNullIfTheTarIsEmpty(): void
|
||||
{
|
||||
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/empty.tar.gz');
|
||||
$this->assertNull($result);
|
||||
}
|
||||
|
||||
public function testThrowsExceptionIfTheTarHasNoComposerJson()
|
||||
public function testThrowsExceptionIfTheTarHasNoComposerJson(): void
|
||||
{
|
||||
self::expectException('RuntimeException');
|
||||
Tar::getComposerJson(__DIR__.'/Fixtures/Tar/nojson.tar.gz');
|
||||
}
|
||||
|
||||
public function testThrowsExceptionIfTheComposerJsonIsInASubSubfolder()
|
||||
public function testThrowsExceptionIfTheComposerJsonIsInASubSubfolder(): void
|
||||
{
|
||||
self::expectException('RuntimeException');
|
||||
Tar::getComposerJson(__DIR__.'/Fixtures/Tar/subfolders.tar.gz');
|
||||
}
|
||||
|
||||
public function testReturnsComposerJsonInTarRoot()
|
||||
public function testReturnsComposerJsonInTarRoot(): void
|
||||
{
|
||||
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/root.tar.gz');
|
||||
$this->assertEquals("{\n \"name\": \"foo/bar\"\n}\n", $result);
|
||||
}
|
||||
|
||||
public function testReturnsComposerJsonInFirstFolder()
|
||||
public function testReturnsComposerJsonInFirstFolder(): void
|
||||
{
|
||||
$result = Tar::getComposerJson(__DIR__.'/Fixtures/Tar/folder.tar.gz');
|
||||
$this->assertEquals("{\n \"name\": \"foo/bar\"\n}\n", $result);
|
||||
}
|
||||
|
||||
public function testMultipleTopLevelDirsIsInvalid()
|
||||
public function testMultipleTopLevelDirsIsInvalid(): void
|
||||
{
|
||||
self::expectException('RuntimeException');
|
||||
Tar::getComposerJson(__DIR__.'/Fixtures/Tar/multiple.tar.gz');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue