|
25 | 25 | use BlitzPHP\Loader\Load; |
26 | 26 | use BlitzPHP\Session\Store; |
27 | 27 | use BlitzPHP\Utilities\Helpers; |
| 28 | +use BlitzPHP\Utilities\Invade\Invader; |
| 29 | +use BlitzPHP\Utilities\Invade\StaticInvader; |
28 | 30 | use BlitzPHP\Utilities\Iterable\Collection; |
29 | | -use BlitzPHP\Utilities\Support\Invader; |
30 | 31 | use GuzzleHttp\Psr7\Utils; |
31 | 32 | use Psr\Http\Message\StreamInterface; |
32 | 33 |
|
@@ -68,22 +69,6 @@ function helper(array|string $filenames): void |
68 | 69 | } |
69 | 70 | } |
70 | 71 |
|
71 | | -if (! function_exists('model')) { |
72 | | - /** |
73 | | - * Simple maniere d'obtenir un modele. |
74 | | - * |
75 | | - * @template T |
76 | | - * |
77 | | - * @param class-string<T>|list<class-string<T>> $name |
78 | | - * |
79 | | - * @return T |
80 | | - */ |
81 | | - function model(array|string $name, ?ConnectionInterface &$conn = null) |
82 | | - { |
83 | | - return Load::model($name, $conn); |
84 | | - } |
85 | | -} |
86 | | - |
87 | 72 | if (! function_exists('service')) { |
88 | 73 | /** |
89 | 74 | * Permet un accès plus propre au fichier de configuration des services. |
@@ -1121,12 +1106,16 @@ function last(array $array) |
1121 | 1106 | * Cette classe offre une fonction d'invasion qui vous permettra de lire / écrire des propriétés privées d'un objet. |
1122 | 1107 | * Il vous permettra également de définir, obtenir et appeler des méthodes privées. |
1123 | 1108 | * |
1124 | | - * @return Invader |
| 1109 | + * @template T of object |
| 1110 | + * |
| 1111 | + * @param class-string|T $objectOrClass L'objet ou le nom de classe à envahir |
| 1112 | + * |
| 1113 | + * @return Invader<T>|StaticInvader L'instance d'envahisseur |
1125 | 1114 | * |
1126 | 1115 | * @see https://github.com/spatie/invade/blob/main/src/Invader.php |
1127 | 1116 | */ |
1128 | | - function invade(object $object) |
| 1117 | + function invade(object|string $objectOrClass) |
1129 | 1118 | { |
1130 | | - return Invader::make($object); |
| 1119 | + return Helpers::invade($objectOrClass); |
1131 | 1120 | } |
1132 | 1121 | } |
0 commit comments