Skip to content

Commit

Permalink
chore: adds php 8.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Oct 15, 2024
1 parent 3b28045 commit a9359bc
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class Handler extends AbstractHandler
/**
* Creates an instance of the Handler.
*/
public function __construct(Writer $writer = null)
public function __construct(?Writer $writer = null)
{
$this->writer = $writer ?: new Writer();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Highlighter.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class Highlighter
/**
* Creates an instance of the Highlighter.
*/
public function __construct(ConsoleColor $color = null, bool $UTF8 = true)
public function __construct(?ConsoleColor $color = null, bool $UTF8 = true)
{
$this->color = $color ?: new ConsoleColor();

Expand Down Expand Up @@ -249,7 +249,7 @@ private function colorLines(array $tokenLines): array
return $lines;
}

private function lineNumbers(array $lines, int $markLine = null): string
private function lineNumbers(array $lines, ?int $markLine = null): string
{
$lineStrlen = strlen((string) ((int) array_key_last($lines) + 1));
$lineStrlen = $lineStrlen < self::WIDTH ? self::WIDTH : $lineStrlen;
Expand Down
2 changes: 1 addition & 1 deletion src/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ final class Provider
/**
* Creates a new instance of the Provider.
*/
public function __construct(RunInterface $run = null, Handler $handler = null)
public function __construct(?RunInterface $run = null, ?Handler $handler = null)
{
$this->run = $run ?: new Run();
$this->handler = $handler ?: new Handler();
Expand Down
8 changes: 4 additions & 4 deletions src/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ final class Writer
* Creates an instance of the writer.
*/
public function __construct(
SolutionsRepository $solutionsRepository = null,
OutputInterface $output = null,
ArgumentFormatter $argumentFormatter = null,
Highlighter $highlighter = null
?SolutionsRepository $solutionsRepository = null,
?OutputInterface $output = null,
?ArgumentFormatter $argumentFormatter = null,
?Highlighter $highlighter = null
) {
$this->solutionsRepository = $solutionsRepository ?: new NullSolutionsRepository();
$this->output = $output ?: new ConsoleOutput();
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Adapters/ArtisanTestCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

class ArtisanTestCommandTest extends TestCase
{
public function setUp(): void
{
if (PHP_VERSION_ID >= 80400) {
$this->markTestSkipped('Skipped on PHP 8.4');
}
}

/** @test */
public function testCoverage(): void
{
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Adapters/LaravelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@

class LaravelTest extends TestCase
{
public function setUp(): void
{
if (PHP_VERSION_ID >= 80400) {
$this->markTestSkipped('Skipped on PHP 8.4');
}
}

/** @test */
public function itIsRegisteredOnArtisan(): void
{
Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/Adapters/PhpunitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

class PhpunitTest extends TestCase
{
public function setUp(): void
{
if (PHP_VERSION_ID >= 80400) {
$this->markTestSkipped('Skipped on PHP 8.4');
}
}

/** @test */
public function itIsAPrinter(): void
{
Expand Down
6 changes: 0 additions & 6 deletions tests/Unit/CoverageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,4 @@ public function testGetPath(): void

$this->assertSame($temporaryDirectory, Coverage::getPath());
}

/** @test */
public function testUsingXdebug(): void
{
$this->assertTrue(Coverage::usingXdebug());
}
}

0 comments on commit a9359bc

Please sign in to comment.