Skip to content

Commit 6f7fa54

Browse files
authored
Merge pull request #6 from cdn77/generic-stub
Make StubFactory::makeStub() generic
2 parents d5073ff + 584a671 commit 6f7fa54

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
composer require --dev cdn77/test-utils
2424
```
2525

26-
For PHPStan support, see [cdn77/PHPStanTestUtilsRule](https://github.com/cdn77/PHPStanTestUtilsRule).
27-
2826
## Features
2927

3028
The utils are separated into smaller units so you can pick only those you wish to use. Each unit is called Feature.

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
},
2020
"require-dev": {
2121
"cdn77/coding-standard": "dev-master#99b5427 as 3.0.0",
22-
"cdn77/phpstan-test-utils-rule": "dev-master@dev",
2322
"jakub-onderka/php-parallel-lint": "^1.0",
2423
"phpstan/extension-installer": "^1.0",
2524
"phpstan/phpstan": "0.12.5",

phpstan.neon.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,4 @@ parameters:
55
paths:
66
- %currentWorkingDirectory%/src
77
- %currentWorkingDirectory%/tests
8-
ignoreErrors:
9-
- "~Parameter #1 \\$argument of class ReflectionClass constructor expects class-string<T of object>\\|T of object, string given~"
108

src/Feature/StubFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ private static function getClosestProperty(ReflectionClass $class, string $prope
2626
}
2727

2828
/**
29-
* @param mixed[] $properties
29+
* @param array<mixed> $properties
30+
*
31+
* @phpstan-template T of object
32+
* @phpstan-param class-string<T> $class
33+
* @phpstan-return T
3034
*/
3135
protected function makeStub(string $class, array $properties = []) : object
3236
{

0 commit comments

Comments
 (0)