Skip to content

Commit c6417cb

Browse files
committed
setup typing correctly
1 parent ffe3645 commit c6417cb

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"symfony/yaml": "^6.2",
3838
"vimeo/psalm": "^5.12",
3939
"kubawerlos/php-cs-fixer-custom-fixers": "^3.0",
40-
"friendsofphp/php-cs-fixer": "^3.0"
40+
"friendsofphp/php-cs-fixer": "^3.0",
41+
"psalm/plugin-phpunit": "^0.18"
4142
},
4243
"autoload": {
4344
"psr-4": {

psalm.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xmlns="https://getpsalm.org/schema/config"
66
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7-
findUnusedCode="true"
7+
findUnusedCode="false"
88
findUnusedBaselineEntry="true"
99
>
1010
<projectFiles>
@@ -18,5 +18,6 @@
1818
<pluginClass class="Psalm\SymfonyPsalmPlugin\Plugin">
1919
<containerXml>var/cache/test/Neo4j_Neo4jBundle_Tests_App_TestKernelTestDebugContainer.xml</containerXml>
2020
</pluginClass>
21+
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/>
2122
</plugins>
2223
</psalm>

src/Collector/Twig/Neo4jResultExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function getFilters(): array
2323
];
2424
}
2525

26-
public function getType($object): string
26+
public function getType(mixed $object): string
2727
{
2828
return $this->doGetType($object, true);
2929
}
@@ -33,7 +33,7 @@ public function getName(): string
3333
return 'neo4j.result';
3434
}
3535

36-
private function doGetType($object, bool $recursive): string
36+
private function doGetType(mixed $object, bool $recursive): string
3737
{
3838
if ($object instanceof Node) {
3939
return sprintf('%s: %s', $object->getId(), $object->getLabels()->join(', '));

tests/Unit/Collector/Twig/Neo4jResultExtensionTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,47 @@
1515
*/
1616
class Neo4jResultExtensionTest extends TestCase
1717
{
18-
public function testEmptyArray()
18+
public function testEmptyArray(): void
1919
{
2020
$o = new Neo4jResultExtension();
2121
$result = $o->getType([]);
2222

2323
$this->assertEquals('Empty array', $result);
2424
}
2525

26-
public function testObject()
26+
public function testObject(): void
2727
{
2828
$o = new Neo4jResultExtension();
2929
$result = $o->getType($o);
3030

3131
$this->assertEquals(Neo4jResultExtension::class, $result);
3232
}
3333

34-
public function testScalar()
34+
public function testScalar(): void
3535
{
3636
$o = new Neo4jResultExtension();
3737
$result = $o->getType(3);
3838

3939
$this->assertEquals('int', $result);
4040
}
4141

42-
public function testScalarArray()
42+
public function testScalarArray(): void
4343
{
4444
$o = new Neo4jResultExtension();
4545
$result = $o->getType([3, 6.3]);
4646

4747
$this->assertEquals('[int, float]', $result);
4848
}
4949

50-
public function testArrayArray()
50+
public function testArrayArray(): void
5151
{
5252
$o = new Neo4jResultExtension();
5353
$result = $o->getType([[]]);
5454

5555
$this->assertEquals('[array]', $result);
5656
}
5757

58-
public function testNode()
58+
public function testNode(): void
5959
{
6060
$o = new Neo4jResultExtension();
6161
$result = $o->getType(new Node(1, new CypherList(['Label']), new CypherMap(), null));

tests/Unit/DependencyInjection/Neo4jExtensionTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected function getMinimalConfiguration(): array
1919
return ['drivers' => ['default' => ['dsn' => 'bolt://localhost']]];
2020
}
2121

22-
public function testDataCollectorLoaded()
22+
public function testDataCollectorLoaded(): void
2323
{
2424
$this->setParameter('kernel.debug', true);
2525
$this->load();
@@ -29,15 +29,15 @@ public function testDataCollectorLoaded()
2929
);
3030
}
3131

32-
public function testDataCollectorNotLoadedInNonDebug()
32+
public function testDataCollectorNotLoadedInNonDebug(): void
3333
{
3434
$this->setParameter('kernel.debug', false);
3535
$this->load();
3636

3737
$this->assertContainerBuilderNotHasService('neo4j.collector.debug_collector');
3838
}
3939

40-
public function testDataCollectorNotLoadedWhenDisabled()
40+
public function testDataCollectorNotLoadedWhenDisabled(): void
4141
{
4242
$this->setParameter('kernel.debug', true);
4343
$this->load(['profiling' => ['enabled' => false]]);

0 commit comments

Comments
 (0)