Skip to content

Commit fd81be5

Browse files
committed
docs: remove PHPDoc @template
Psalm does not support class @template in static methods. And in PHPStan it does not protect. See - vimeo/psalm#2697 - phpstan/phpstan#2738
1 parent 4a81f85 commit fd81be5

File tree

12 files changed

+6
-38
lines changed

12 files changed

+6
-38
lines changed

system/DataCaster/Cast/ArrayCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*
1919
* (PHP) [array --> string] --> (DB driver) --> (DB column) string
2020
* [ <-- string] <-- (DB driver) <-- (DB column) string
21-
*
22-
* @extends BaseCast<mixed[], string, mixed>
2321
*/
2422
class ArrayCast extends BaseCast implements CastInterface
2523
{

system/DataCaster/Cast/BaseCast.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515

1616
use TypeError;
1717

18-
/**
19-
* @template TPhpValue PHP data type
20-
* @template TToDb Data type to pass to database driver
21-
* @template TDbColumn Data type from database driver
22-
*
23-
* @implements CastInterface<TPhpValue, TToDb, TDbColumn>
24-
*/
2518
abstract class BaseCast implements CastInterface
2619
{
2720
public static function get(mixed $value, array $params = []): mixed

system/DataCaster/Cast/BooleanCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*
1919
* (PHP) [bool --> bool ] --> (DB driver) --> (DB column) bool|int(0/1)
2020
* [ <-- string|int] <-- (DB driver) <-- (DB column) bool|int(0/1)
21-
*
22-
* @extends BaseCast<bool, bool, mixed>
2321
*/
2422
class BooleanCast extends BaseCast
2523
{

system/DataCaster/Cast/CSVCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*
1919
* (PHP) [array --> string] --> (DB driver) --> (DB column) string
2020
* [ <-- string] <-- (DB driver) <-- (DB column) string
21-
*
22-
* @extends BaseCast<array, string, mixed>
2321
*/
2422
class CSVCast extends BaseCast
2523
{

system/DataCaster/Cast/CastInterface.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,25 @@
1313

1414
namespace CodeIgniter\DataCaster\Cast;
1515

16-
/**
17-
* @template TPhpValue PHP native value type
18-
* @template TToDb Data type to pass to database driver
19-
* @template TDbColumn Data type from database driver
20-
*/
2116
interface CastInterface
2217
{
2318
/**
24-
* Takes value from DataSource, returns its value for PHP.
19+
* Takes a value from DataSource, returns its value for PHP.
2520
*
26-
* @param TDbColumn $value Data from database driver
21+
* @param mixed $value Data from database driver
2722
* @param list<string> $params Additional param
2823
*
29-
* @return TPhpValue PHP native value
24+
* @return mixed PHP native value
3025
*/
3126
public static function get(mixed $value, array $params = []): mixed;
3227

3328
/**
34-
* Takes the PHP value, returns its value for DataSource.
29+
* Takes a PHP value, returns its value for DataSource.
3530
*
36-
* @param TPhpValue $value PHP native value
31+
* @param mixed $value PHP native value
3732
* @param list<string> $params Additional param
3833
*
39-
* @return TToDb Data to pass to database driver
34+
* @return mixed Data to pass to database driver
4035
*/
4136
public static function set(mixed $value, array $params = []): mixed;
4237
}

system/DataCaster/Cast/DatetimeCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*
2121
* (PHP) [Time --> string] --> (DB driver) --> (DB column) datetime
2222
* [ <-- string] <-- (DB driver) <-- (DB column) datetime
23-
*
24-
* @extends BaseCast<Time, string, mixed>
2523
*/
2624
class DatetimeCast extends BaseCast
2725
{

system/DataCaster/Cast/FloatCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*
1919
* (PHP) [float --> float ] --> (DB driver) --> (DB column) float
2020
* [ <-- float|string] <-- (DB driver) <-- (DB column) float
21-
*
22-
* @extends BaseCast<float, float, mixed>
2321
*/
2422
class FloatCast extends BaseCast
2523
{

system/DataCaster/Cast/IntBoolCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*
1919
* (PHP) [bool --> int ] --> (DB driver) --> (DB column) int(0/1)
2020
* [ <-- int|string] <-- (DB driver) <-- (DB column) int(0/1)
21-
*
22-
* @extends BaseCast<bool, int, mixed>
2321
*/
2422
final class IntBoolCast extends BaseCast
2523
{

system/DataCaster/Cast/IntegerCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
*
1919
* (PHP) [int --> int ] --> (DB driver) --> (DB column) int
2020
* [ <-- int|string] <-- (DB driver) <-- (DB column) int
21-
*
22-
* @extends BaseCast<int, int, mixed>
2321
*/
2422
class IntegerCast extends BaseCast
2523
{

system/DataCaster/Cast/JsonCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
*
2323
* (PHP) [array|stdClass --> string] --> (DB driver) --> (DB column) string
2424
* [ <-- string] <-- (DB driver) <-- (DB column) string
25-
*
26-
* @extends BaseCast<array|stdClass, string, mixed>
2725
*/
2826
class JsonCast extends BaseCast
2927
{

system/DataCaster/Cast/TimestampCast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*
2121
* (PHP) [Time --> int ] --> (DB driver) --> (DB column) int
2222
* [ <-- int|string] <-- (DB driver) <-- (DB column) int
23-
*
24-
* @extends BaseCast<Time, int, mixed>
2523
*/
2624
class TimestampCast extends BaseCast
2725
{

system/DataCaster/Cast/URICast.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
*
2121
* (PHP) [URI --> string] --> (DB driver) --> (DB column) string
2222
* [ <-- string] <-- (DB driver) <-- (DB column) string
23-
*
24-
* @extends BaseCast<URI, string, mixed>
2523
*/
2624
class URICast extends BaseCast
2725
{

0 commit comments

Comments
 (0)