Skip to content

Commit b8cab07

Browse files
author
fureev
committed
ci: fix for php 8.4
1 parent cd3b585 commit b8cab07

16 files changed

+88
-161
lines changed

.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
setup: [ 'basic', 'lowest', 'stable' ]
40-
php: [ '8.1' ,'8.2', '8.3' ]
40+
php: [ '8.4' ]
4141

4242
steps:
4343
- uses: actions/checkout@v4

src/Exceptions/MissingPropertyException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class MissingPropertyException extends ConfigException
1111
{
1212
public function __construct(protected(set) ?string $property, ?string $message = null, array $config = [])
1313
{
14-
parent::__construct($message ?? ($this->getName() . ": '$this->property'"), $config);
14+
parent::__construct($message ?? ($this->getName() . ": $this->property"), $config);
1515
}
1616

1717
/**

src/Exceptions/UnknownMethodException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class UnknownMethodException extends BadMethodCallException
1414
public function __construct(protected(set) string $method, ?string $message = null)
1515
{
1616
$this->method = $method;
17-
parent::__construct($message ?? ($this->getName() . ": $this->method "));
17+
parent::__construct($message ?? ($this->getName() . ": $this->method"));
1818
}
1919

2020
/**

tests/enums/WithEnhancesForStringsTest.php renamed to tests/Enums/WithEnhancesForStringsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace Php\Support\Tests\enums;
5+
namespace Php\Support\Tests\Enums;
66

7-
use Php\Support\Tests\enums\data\StringsEnum;
7+
use Php\Support\Tests\Enums\data\StringsEnum;
88
use PHPUnit\Framework\Attributes\Test;
99
use PHPUnit\Framework\TestCase;
1010

tests/enums/data/StringsEnum.php renamed to tests/Enums/data/StringsEnum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Php\Support\Tests\enums\data;
5+
namespace Php\Support\Tests\Enums\data;
66

77
use Php\Support\Enums\WithEnhancesForStrings;
88

tests/exceptions/ExceptionTest.php renamed to tests/Exceptions/ExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Php\Support\Tests;
5+
namespace Php\Support\Tests\Exceptions;
66

77
use Php\Support\Exceptions\Exception;
88
use PHPUnit\Framework\TestCase;

tests/exceptions/InvalidArgumentTest.php renamed to tests/Exceptions/InvalidArgumentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Php\Support\Tests;
5+
namespace Php\Support\Tests\Exceptions;
66

77
use Php\Support\Exceptions\InvalidArgumentException;
88
use PHPUnit\Framework\TestCase;

tests/exceptions/InvalidParamTest.php renamed to tests/Exceptions/InvalidParamTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Php\Support\Tests;
5+
namespace Php\Support\Tests\Exceptions;
66

77
use Php\Support\Exceptions\InvalidParamException;
88
use PHPUnit\Framework\TestCase;

tests/exceptions/MissingClassTest.php renamed to tests/Exceptions/MissingClassTest.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Php\Support\Tests;
5+
namespace Php\Support\Tests\Exceptions;
66

77
use Php\Support\Exceptions\MissingClassException;
88
use PHPUnit\Framework\TestCase;
@@ -15,26 +15,13 @@ final class MissingClassTest extends TestCase
1515
{
1616
public function testThrow()
1717
{
18-
try {
19-
throw new MissingClassException();
20-
} catch (Throwable $e) {
21-
$this->assertInstanceOf(MissingClassException::class, $e);
22-
$this->assertSame('Missing Class', $e->getMessage());
23-
}
24-
2518
try {
2619
throw new MissingClassException(MissingClassException::class);
2720
} catch (Throwable $e) {
2821
$this->assertInstanceOf(MissingClassException::class, $e);
2922
$this->assertSame('Missing Class: ' . MissingClassException::class, $e->getMessage());
3023
}
3124

32-
try {
33-
throw new MissingClassException(null, 'Test Message');
34-
} catch (Throwable $e) {
35-
$this->assertInstanceOf(MissingClassException::class, $e);
36-
$this->assertSame('Test Message', $e->getMessage());
37-
}
3825
try {
3926
throw new MissingClassException(MissingClassException::class, 'Test Message');
4027
} catch (Throwable $e) {
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Php\Support\Tests\Exceptions;
6+
7+
use Php\Support\Exceptions\MissingPropertyException;
8+
use PHPUnit\Framework\TestCase;
9+
use Throwable;
10+
11+
/**
12+
* Class MissingPropertyTest
13+
*/
14+
final class MissingPropertyTest extends TestCase
15+
{
16+
public function testThrow()
17+
{
18+
try {
19+
throw new MissingPropertyException('test');
20+
} catch (Throwable $e) {
21+
$this->assertInstanceOf(MissingPropertyException::class, $e);
22+
$this->assertSame('Missing property: test', $e->getMessage());
23+
$this->assertSame('test', $e->property);
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)