Skip to content

Commit

Permalink
Fix forward compatibility for php v8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Nov 16, 2023
1 parent a7f3d9c commit e081ef2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/Component/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
*/
class CollectionTest extends \Rougin\Slytherin\Testcase
{
/**
* @var \Rougin\Slytherin\Component\Collection
*/
protected $components;

/**
* Sets up the component class.
*
Expand All @@ -27,7 +32,8 @@ protected function doSetUp()
*/
public function testSetContainerMethod()
{
if (! interface_exists('Psr\Container\ContainerInterface')) {
if (! interface_exists('Psr\Container\ContainerInterface'))
{
$this->markTestSkipped('Container Interop is not installed.');
}

Expand Down Expand Up @@ -75,7 +81,8 @@ public function testSetDebuggerMethod()
*/
public function testSetHttpMethod()
{
if (! interface_exists('Psr\Http\Message\ResponseInterface')) {
if (! interface_exists('Psr\Http\Message\ResponseInterface'))
{
$this->markTestSkipped('PSR HTTP Message is not installed.');
}

Expand All @@ -101,7 +108,8 @@ public function testSetHttpMethod()
*/
public function testSetHttpRequestMethod()
{
if (! interface_exists('Psr\Http\Message\ServerRequestInterface')) {
if (! interface_exists('Psr\Http\Message\ServerRequestInterface'))
{
$this->markTestSkipped('PSR HTTP Message is not installed.');
}

Expand All @@ -126,7 +134,8 @@ public function testSetHttpRequestMethod()
*/
public function testSetHttpResponseMethod()
{
if (! interface_exists('Psr\Http\Message\ResponseInterface')) {
if (! interface_exists('Psr\Http\Message\ResponseInterface'))
{
$this->markTestSkipped('PSR HTTP Message is not installed.');
}

Expand Down Expand Up @@ -168,4 +177,4 @@ public function testGetNullComponent()
{
$this->assertNull($this->components->getDebugger());
}
}
}
5 changes: 5 additions & 0 deletions tests/Fixture/Classes/AnotherClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
*/
class AnotherClass
{
/**
* @var string
*/
protected $text;

/**
* @param string $text
*/
Expand Down

0 comments on commit e081ef2

Please sign in to comment.