mirror of
https://github.com/danog/psalm-plugin-phpunit.git
synced 2024-12-02 09:27:56 +01:00
commit
059684417f
@ -14,5 +14,6 @@ class Plugin implements PluginEntryPointInterface
|
|||||||
$psalm->addStubFile(__DIR__ . '/stubs/TestCase.php');
|
$psalm->addStubFile(__DIR__ . '/stubs/TestCase.php');
|
||||||
$psalm->addStubFile(__DIR__ . '/stubs/MockBuilder.php');
|
$psalm->addStubFile(__DIR__ . '/stubs/MockBuilder.php');
|
||||||
$psalm->addStubFile(__DIR__ . '/stubs/InvocationMocker.php');
|
$psalm->addStubFile(__DIR__ . '/stubs/InvocationMocker.php');
|
||||||
|
$psalm->addStubFile(__DIR__ . '/stubs/Prophecy.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
"scripts" : {
|
"scripts" : {
|
||||||
"check": [
|
"check": [
|
||||||
"@cs-check",
|
"@cs-check",
|
||||||
"@test",
|
|
||||||
"@analyze"
|
"@analyze"
|
||||||
],
|
],
|
||||||
"analyze": "psalm",
|
"analyze": "psalm",
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
<directory name="." />
|
<directory name="." />
|
||||||
<ignoreFiles>
|
<ignoreFiles>
|
||||||
<directory name="vendor" />
|
<directory name="vendor" />
|
||||||
|
<directory name="stubs" />
|
||||||
</ignoreFiles>
|
</ignoreFiles>
|
||||||
</projectFiles>
|
</projectFiles>
|
||||||
|
|
||||||
@ -16,17 +17,5 @@
|
|||||||
|
|
||||||
<LessSpecificReturnType errorLevel="info" />
|
<LessSpecificReturnType errorLevel="info" />
|
||||||
|
|
||||||
<PropertyNotSetInConstructor>
|
|
||||||
<errorLevel type="suppress">
|
|
||||||
<directory name="tests" />
|
|
||||||
</errorLevel>
|
|
||||||
</PropertyNotSetInConstructor>
|
|
||||||
|
|
||||||
<TypeCoercion>
|
|
||||||
<errorLevel type="suppress">
|
|
||||||
<directory name="tests" />
|
|
||||||
</errorLevel>
|
|
||||||
</TypeCoercion>
|
|
||||||
|
|
||||||
</issueHandlers>
|
</issueHandlers>
|
||||||
</psalm>
|
</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>
|
* @return MockBuilder<T>
|
||||||
*/
|
*/
|
||||||
public function getMockBuilder(string $className) {}
|
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