Skip to content

Commit

Permalink
Additional improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Feb 29, 2024
1 parent 80edc87 commit fb5ca76
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions library/Mockery.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Mockery
/**
* Global container to hold all mocks for the current unit test running.
*
* @var null|Mockery\Container
* @var null|Container
*/
protected static $_container = null;

Expand All @@ -72,7 +72,7 @@ class Mockery
protected static $_loader;

/**
* @var array
* @var list<string>
*/
private static $_filesToCleanUp = [];

Expand Down Expand Up @@ -112,7 +112,9 @@ public static function any()
/**
* Return instance of ANYOF matcher.
*
* @param array ...$args
* @template TAnyOf
*
* @param TAnyOf ...$args
*
* @return AnyOf
*/
Expand All @@ -134,6 +136,10 @@ public static function builtInTypes()
/**
* Return instance of CLOSURE matcher.
*
* @template TReference
*
* @param TReference $reference
*
* @return ClosureMatcher
*/
public static function capture(&$reference)
Expand Down Expand Up @@ -188,7 +194,7 @@ public static function contains(...$args)
}

/**
* @param string $fqn
* @param class-string $fqn
*
* @return void
*/
Expand All @@ -198,7 +204,7 @@ public static function declareClass($fqn)
}

/**
* @param string $fqn
* @param class-string $fqn
*
* @return void
*/
Expand All @@ -224,9 +230,11 @@ public static function ducktype(...$args)
/**
* Static fetching of a mock associated with a name or explicit class poser.
*
* @param string $name
* @template TMock of object
*
* @return LegacyMockInterface|MockInterface
* @param class-string<TMock> $name
*
* @return (LegacyMockInterface|MockInterface)&TMock
*/
public static function fetchMock($name)

Check failure on line 239 in library/Mockery.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidDocblock

library/Mockery.php:239:5: InvalidDocblock: Intersection types cannot contain unions in docblock for Mockery::fetchMock (see https://psalm.dev/008)

Check failure on line 239 in library/Mockery.php

View workflow job for this annotation

GitHub Actions / Psalm

MissingReturnType

library/Mockery.php:239:28: MissingReturnType: Method Mockery::fetchMock does not have a return type, expecting Mockery\LegacyMockInterface|null (see https://psalm.dev/050)
{
Expand Down Expand Up @@ -413,7 +421,7 @@ public static function hasValue($val)
*
* @param TInstanceMock ...$args
*
* @return LegacyMockInterface|MockInterface
* @return (LegacyMockInterface|MockInterface)&TInstanceMock
*/
public static function instanceMock(...$args)

Check failure on line 426 in library/Mockery.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidDocblock

library/Mockery.php:426:5: InvalidDocblock: Intersection types cannot contain unions in docblock for Mockery::instanceMock (see https://psalm.dev/008)

Check failure on line 426 in library/Mockery.php

View workflow job for this annotation

GitHub Actions / Psalm

MissingReturnType

library/Mockery.php:426:28: MissingReturnType: Method Mockery::instanceMock does not have a return type, expecting never (see https://psalm.dev/050)
{
Expand Down Expand Up @@ -463,7 +471,7 @@ public static function isSame($expected): IsSame
*
* @param TMock ...$args
*
* @return LegacyMockInterface|MockInterface
* @return (LegacyMockInterface|MockInterface)&TMock
*/
public static function mock(...$args)

Check failure on line 476 in library/Mockery.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidDocblock

library/Mockery.php:476:5: InvalidDocblock: Intersection types cannot contain unions in docblock for Mockery::mock (see https://psalm.dev/008)

Check failure on line 476 in library/Mockery.php

View workflow job for this annotation

GitHub Actions / Psalm

MissingReturnType

library/Mockery.php:476:28: MissingReturnType: Method Mockery::mock does not have a return type, expecting never (see https://psalm.dev/050)
{
Expand Down Expand Up @@ -491,7 +499,7 @@ public static function mustBe($expected)
*
* @param TNamedMock ...$args
*
* @return LegacyMockInterface|MockInterface
* @return (LegacyMockInterface|MockInterface)&TNamedMock
*/
public static function namedMock(...$args)

Check failure on line 504 in library/Mockery.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidDocblock

library/Mockery.php:504:5: InvalidDocblock: Intersection types cannot contain unions in docblock for Mockery::namedMock (see https://psalm.dev/008)
{
Expand Down Expand Up @@ -663,7 +671,7 @@ public static function setLoader(Loader $loader)
*
* @param TSpy ...$args
*
* @return LegacyMockInterface|MockInterface
* @return (LegacyMockInterface|MockInterface)&TSpy
*/
public static function spy(...$args)
{
Expand Down

0 comments on commit fb5ca76

Please sign in to comment.