Skip to content

Commit b33c9b9

Browse files
committed
uses nette/phpstan-rules
1 parent 4e93cca commit b33c9b9

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"require-dev": {
2323
"nette/tester": "^2.6",
2424
"tracy/tracy": "^2.9",
25-
"phpstan/phpstan-nette": "^2.0@stable"
25+
"phpstan/phpstan": "^2.1@stable",
26+
"phpstan/extension-installer": "^1.4@stable",
27+
"nette/phpstan-rules": "^1.0"
2628
},
2729
"autoload": {
2830
"classmap": ["src/"],
@@ -39,5 +41,10 @@
3941
"branch-alias": {
4042
"dev-master": "4.1-dev"
4143
}
44+
},
45+
"config": {
46+
"allow-plugins": {
47+
"phpstan/extension-installer": true
48+
}
4249
}
4350
}

tests/types/TypesTest.phpt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php declare(strict_types=1);
2+
3+
require __DIR__ . '/../bootstrap.php';
4+
5+
use Nette\PHPStan\Tester\TypeAssert;
6+
7+
TypeAssert::assertTypes(__DIR__ . '/robotloader-types.php');

tests/types/robotloader-types.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types=1);
2+
3+
/**
4+
* PHPStan type tests.
5+
*/
6+
7+
use Nette\Loaders\RobotLoader;
8+
use function PHPStan\Testing\assertType;
9+
10+
11+
function testGetIndexedClasses(RobotLoader $loader): void
12+
{
13+
$result = $loader->getIndexedClasses();
14+
assertType('array<class-string, string>', $result);
15+
}

0 commit comments

Comments
 (0)