docs: add/fix PHPDoc types

This commit is contained in:
kenjis 2024-03-08 09:01:18 +09:00
parent fd28a3fb53
commit 731e891ae8
No known key found for this signature in database
GPG Key ID: BD254878922AF198
2 changed files with 8 additions and 32 deletions

View File

@ -3106,36 +3106,6 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockCURLRequest.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot unset offset string on array\\<int, int\\>\\|null\\.$#',
'count' => 2,
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:assertHas\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:assertHasValue\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:assertMissing\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Return type \\(mixed\\) of method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:get\\(\\) should be covariant with return type \\(array\\|bool\\|float\\|int\\|object\\|string\\|null\\) of method CodeIgniter\\\\Cache\\\\CacheInterface\\:\\:get\\(\\)$#',
'count' => 2,
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Return type \\(mixed\\) of method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:remember\\(\\) should be covariant with return type \\(array\\|bool\\|float\\|int\\|object\\|string\\|null\\) of method CodeIgniter\\\\Cache\\\\Handlers\\\\BaseHandler\\:\\:remember\\(\\)$#',
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Short ternary operator is not allowed\\. Use null coalesce operator if applicable or consider using long ternary\\.$#',
'count' => 2,

View File

@ -54,7 +54,7 @@ class MockCache extends BaseHandler implements CacheInterface
*
* @param string $key Cache item name
*
* @return mixed
* @return bool|null
*/
public function get(string $key)
{
@ -66,7 +66,7 @@ class MockCache extends BaseHandler implements CacheInterface
/**
* Get an item from the cache, or execute the given Closure and store the result.
*
* @return mixed
* @return bool|null
*/
public function remember(string $key, int $ttl, Closure $callback)
{
@ -266,6 +266,8 @@ class MockCache extends BaseHandler implements CacheInterface
* Asserts that the cache has an item named $key.
* The value is not checked since storing false or null
* values is valid.
*
* @return void
*/
public function assertHas(string $key)
{
@ -276,6 +278,8 @@ class MockCache extends BaseHandler implements CacheInterface
* Asserts that the cache has an item named $key with a value matching $value.
*
* @param mixed $value
*
* @return void
*/
public function assertHasValue(string $key, $value = null)
{
@ -292,6 +296,8 @@ class MockCache extends BaseHandler implements CacheInterface
/**
* Asserts that the cache does NOT have an item named $key.
*
* @return void
*/
public function assertMissing(string $key)
{