Skip to content

Commit 7483823

Browse files
committed
docs: add/fix PHPDoc types
1 parent 867c326 commit 7483823

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

system/Cookie/Cookie.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
* $cookie2 = $cookie->withName('prod_cookie');
3838
* $cookie2->getName(); // prod_cookie
3939
* ```
40+
*
41+
* @template-implements ArrayAccess<string, bool|int|string>
4042
*/
4143
class Cookie implements ArrayAccess, CloneableCookieInterface
4244
{
@@ -564,7 +566,7 @@ public function withRaw(bool $raw = true)
564566
/**
565567
* Whether an offset exists.
566568
*
567-
* @param mixed $offset
569+
* @param string $offset
568570
*/
569571
public function offsetExists($offset): bool
570572
{
@@ -574,9 +576,9 @@ public function offsetExists($offset): bool
574576
/**
575577
* Offset to retrieve.
576578
*
577-
* @param mixed $offset
579+
* @param string $offset
578580
*
579-
* @return mixed
581+
* @return bool|int|string
580582
*
581583
* @throws InvalidArgumentException
582584
*/
@@ -593,8 +595,8 @@ public function offsetGet($offset)
593595
/**
594596
* Offset to set.
595597
*
596-
* @param mixed $offset
597-
* @param mixed $value
598+
* @param string $offset
599+
* @param mixed $value
598600
*
599601
* @throws LogicException
600602
*/
@@ -606,7 +608,7 @@ public function offsetSet($offset, $value): void
606608
/**
607609
* Offset to unset.
608610
*
609-
* @param mixed $offset
611+
* @param string $offset
610612
*
611613
* @throws LogicException
612614
*/

system/Files/FileCollection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*
2424
* Representation for a group of files, with utilities for locating,
2525
* filtering, and ordering them.
26+
*
27+
* @template-implements IteratorAggregate<int, File>
2628
*/
2729
class FileCollection implements Countable, IteratorAggregate
2830
{

system/Test/Mock/MockConnection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
use CodeIgniter\Database\BaseResult;
1717
use CodeIgniter\Database\Query;
1818

19+
/**
20+
* @extends BaseConnection<object|resource, object|resource>
21+
*/
1922
class MockConnection extends BaseConnection
2023
{
2124
protected $returnValues = [];

system/Test/Mock/MockResult.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use CodeIgniter\Database\BaseResult;
1515

16+
/**
17+
* @extends BaseResult<object|resource, object|resource>
18+
*/
1619
class MockResult extends BaseResult
1720
{
1821
/**

0 commit comments

Comments
 (0)