mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-11-30 04:29:08 +01:00
commit
059684417f
@ -14,5 +14,6 @@ class Plugin implements PluginEntryPointInterface
|
||||
$psalm->addStubFile(__DIR__ . '/stubs/TestCase.php');
|
||||
$psalm->addStubFile(__DIR__ . '/stubs/MockBuilder.php');
|
||||
$psalm->addStubFile(__DIR__ . '/stubs/InvocationMocker.php');
|
||||
$psalm->addStubFile(__DIR__ . '/stubs/Prophecy.php');
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,6 @@
|
||||
"scripts" : {
|
||||
"check": [
|
||||
"@cs-check",
|
||||
"@test",
|
||||
"@analyze"
|
||||
],
|
||||
"analyze": "psalm",
|
||||
|
@ -9,6 +9,7 @@
|
||||
<directory name="." />
|
||||
<ignoreFiles>
|
||||
<directory name="vendor" />
|
||||
<directory name="stubs" />
|
||||
</ignoreFiles>
|
||||
</projectFiles>
|
||||
|
||||
@ -16,17 +17,5 @@
|
||||
|
||||
<LessSpecificReturnType errorLevel="info" />
|
||||
|
||||
<PropertyNotSetInConstructor>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="tests" />
|
||||
</errorLevel>
|
||||
</PropertyNotSetInConstructor>
|
||||
|
||||
<TypeCoercion>
|
||||
<errorLevel type="suppress">
|
||||
<directory name="tests" />
|
||||
</errorLevel>
|
||||
</TypeCoercion>
|
||||
|
||||
</issueHandlers>
|
||||
</psalm>
|
||||
|
26
stubs/Prophecy.php
Normal file
26
stubs/Prophecy.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Prophecy\Prophecy {
|
||||
/** @template T */
|
||||
class ObjectProphecy implements ProphecyInterface
|
||||
{
|
||||
/** @return T */
|
||||
public function reveal() {}
|
||||
}
|
||||
|
||||
class MethodProphecy
|
||||
{
|
||||
public function willReturn(...$values): self {}
|
||||
}
|
||||
}
|
||||
|
||||
namespace Prophecy {
|
||||
use Prophecy\Argument\Token;
|
||||
class Argument
|
||||
{
|
||||
/** @param callable():bool $callback */
|
||||
public static function that(callable $callback): Token\CallbackToken {}
|
||||
|
||||
/** @param mixed ...$tokens */
|
||||
public static function allOf(...$tokens): Token\LogicalAndToken {}
|
||||
}
|
||||
}
|
@ -24,4 +24,12 @@ abstract class TestCase extends Assert implements Test, SelfDescribing
|
||||
* @return MockBuilder<T>
|
||||
*/
|
||||
public function getMockBuilder(string $className) {}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @template-typeof T $classOrInterface
|
||||
* @param class-string $classOrInterface
|
||||
* @return ObjectProphecy<T>
|
||||
*/
|
||||
public function prophesize($classOrInterface): ObjectProphecy {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user