2828use CodeIgniter \Config \Config ;
2929use CodeIgniter \Config \Services ;
3030use CodeIgniter \Router \RouteCollectionInterface ;
31+ use Tatter \Assets \Config \Assets as AssetsConfig ;
3132use Tatter \Assets \Exceptions \AssetsException ;
3233
3334/*** CLASS ***/
@@ -36,14 +37,14 @@ class Assets
3637 /**
3738 * Our configuration instance.
3839 *
39- * @var \Tatter\Assets\Config\Assets
40+ * @var AssetsConfig
4041 */
4142 protected $ config ;
4243
4344 /**
4445 * Array of asset paths detected for the current route
4546 *
46- * @var array
47+ * @var array|null
4748 */
4849 protected $ paths ;
4950
@@ -61,7 +62,7 @@ class Assets
6162 * The URI to use for matching routed assets.
6263 * Defaults to uri_string()
6364 *
64- * @var string
65+ * @var string|null
6566 */
6667 protected $ route ;
6768
@@ -76,7 +77,7 @@ class Assets
7677 /**
7778 * Route collection used to determine the default route (if needed).
7879 *
79- * @var CodeIgniter\Router\ RouteCollectionInterface
80+ * @var RouteCollectionInterface|null
8081 */
8182 protected $ collection ;
8283
@@ -147,7 +148,7 @@ public function getPaths($extension = null): array
147148 $ tmpPaths = [];
148149 foreach ($ this ->paths as $ path )
149150 {
150- if (strtolower (pathinfo ($ path , PATHINFO_EXTENSION ) == $ extension) )
151+ if (strtolower (pathinfo ($ path , PATHINFO_EXTENSION )) == $ extension )
151152 {
152153 $ tmpPaths [] = $ path ;
153154 }
@@ -197,16 +198,13 @@ public function tag(string $path)
197198 {
198199 case 'css ' :
199200 return link_tag ($ url );
200- break ;
201201
202202 case 'js ' :
203203 return script_tag ($ url );
204- break ;
205204
206205 case 'img ' :
207206 $ alt = ucfirst (pathinfo ($ path , PATHINFO_FILENAME ));
208207 return img ($ url , false , ['alt ' => $ alt ]);
209- break ;
210208
211209 default :
212210 if ($ this ->config ->silent )
@@ -281,7 +279,7 @@ protected function sanitizeRoute()
281279 if (Config::get ('App ' )->negotiateLocale )
282280 {
283281 $ route = explode ('/ ' , $ this ->route );
284- if (count ($ route ) && $ route [0 ] == Services::request ()->getLocale ())
282+ if (count ($ route ) && $ route [0 ] == Services::request ()->getLocale ()) // @phpstan-ignore-line
285283 {
286284 unset($ route [0 ]);
287285 }
0 commit comments