diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index 37fe9c9..aecc899 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -21,43 +21,8 @@
-
-
- tests/
-
-
-
-
- tests/
-
-
- tests/
-
-
tests/
-
-
-
- tests/
-
-
- tests/
-
-
-
-
- tests/
-
-
- tests/
-
-
- tests/
-
-
- tests/
-
diff --git a/tests/DbTest.php b/tests/DbTest.php
index cf2dfe8..53c0581 100644
--- a/tests/DbTest.php
+++ b/tests/DbTest.php
@@ -15,7 +15,7 @@
#[CoversClass(Db::class)]
class DbTest extends TestCase
{
- protected $object;
+ protected Db $object;
protected function setUp(): void
{
@@ -53,17 +53,17 @@ public function testFetchingAll(): void
public function testFetchingClass(): void
{
- $line = $this->object->select('*')->from('unit')->fetch('Respect\Relational\testFetchingClass');
- $this->assertInstanceOF('Respect\Relational\testFetchingClass', $line);
+ $line = $this->object->select('*')->from('unit')->fetch('Respect\Relational\TestFetchingClass');
+ $this->assertInstanceOF('Respect\Relational\TestFetchingClass', $line);
}
public function testFetchingClassArgs(): void
{
$line = $this->object->select('*')->from('unit')->fetch(
- 'Respect\Relational\testFetchingClassArgs',
+ 'Respect\Relational\TestFetchingClassArgs',
['foo'],
);
- $this->assertInstanceOF('Respect\Relational\testFetchingClassArgs', $line);
+ $this->assertInstanceOF('Respect\Relational\TestFetchingClassArgs', $line);
$this->assertEquals('foo', $line->testd);
}
@@ -81,7 +81,7 @@ static function ($row) {
public function testFetchingInto(): void
{
- $x = new testFetchingInto();
+ $x = new TestFetchingInto();
$this->object->select('*')->from('unit')->where(['testb' => 'abc'])->fetch($x);
$this->assertEquals('abc', $x->testb);
}
@@ -94,7 +94,8 @@ public function testRawSql(): void
public function testFetchingArray(): void
{
- $line = $this->object->select('*')->from('unit')->where(['testb' => 'abc'])->fetch(PDO::FETCH_ASSOC);
+ $line = $this->object->select('*')->from('unit')
+ ->where(['testb' => 'abc'])->fetch(PDO::FETCH_ASSOC);
$this->assertTrue(is_array($line));
}
@@ -123,19 +124,27 @@ protected function tearDown(): void
}
}
-class testFetchingClass
+class TestFetchingClass
{
- public $testa, $testb, $testez;
+ public int|null $testa = null;
+
+ public string|null $testb = null;
+
+ public int|null $testez = null;
}
-class testFetchingInto
+class TestFetchingInto
{
- public $testa, $testb, $testez;
+ public int|null $testa = null;
+
+ public string|null $testb = null;
+
+ public int|null $testez = null;
}
-class testFetchingClassArgs
+class TestFetchingClassArgs
{
- public function __construct(public $testd)
+ public function __construct(public string|null $testd = null)
{
}
}
diff --git a/tests/MapperTest.php b/tests/MapperTest.php
index fea367f..5512b15 100644
--- a/tests/MapperTest.php
+++ b/tests/MapperTest.php
@@ -31,7 +31,27 @@
#[CoversClass(Mapper::class)]
class MapperTest extends TestCase
{
- protected $conn, $mapper, $posts, $authors, $comments, $categories, $postsCategories, $issues;
+ protected PDO $conn;
+
+ protected Mapper $mapper;
+
+ /** @var list