Fixed static analysis errors

This commit is contained in:
Chris Kankiewicz
2023-05-20 20:48:36 -07:00
parent 6b279d2983
commit 0283f14aa1
5 changed files with 32 additions and 23 deletions

View File

@@ -5,6 +5,7 @@ namespace App;
use BadMethodCallException;
use Tightenco\Collect\Support\Collection;
/** @extends Collection<int, string> */
class HiddenFiles extends Collection
{
protected function __construct($items = [])

View File

@@ -6,7 +6,11 @@ use Tightenco\Collect\Support\Collection;
class Str
{
/** Explode a string by a string into a collection. */
/**
* Explode a string by a string into a collection.
*
* @return Collection<int, string>
*/
public static function explode(string $string, string $delimiter): Collection
{
return Collection::make(explode($delimiter, $string));

View File

@@ -21,13 +21,18 @@ class Asset extends ViewFunction
$path = '/' . ltrim($path, '/');
if ($this->mixManifest()->has($path)) {
/** @var string $path */
$path = $this->mixManifest()->get($path);
}
return 'app/assets/' . ltrim($path, '/');
}
/** Return the mix manifest collection. */
/**
* Return the mix manifest collection.
*
* @return Collection<string, string>
*/
protected function mixManifest(): Collection
{
$mixManifest = $this->config->get('asset_path') . '/mix-manifest.json';

View File

@@ -17,7 +17,11 @@ class Breadcrumbs extends ViewFunction
) {
}
/** Build a collection of breadcrumbs for a given path. */
/**
* Build a collection of breadcrumbs for a given path.
*
* @return Collection<int, string>
*/
public function __invoke(string $path): Collection
{
return Str::explode($path, $this->directorySeparator)->diffAssoc(

View File

@@ -1,25 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$factory of function DI\\\\factory expects callable\\(\\)\\: mixed, 'App\\\\\\\\Factories\\\\\\\\CacheFactory' given\\.$#"
count: 1
path: app/config/container.php
-
message: "#^Parameter \\#1 \\$factory of function DI\\\\factory expects callable\\(\\)\\: mixed, 'App\\\\\\\\Factories\\\\\\\\FinderFactory' given\\.$#"
count: 1
path: app/config/container.php
-
message: "#^Parameter \\#1 \\$factory of function DI\\\\factory expects callable\\(\\)\\: mixed, 'App\\\\\\\\Factories\\\\\\\\TranslationFactory' given\\.$#"
count: 1
path: app/config/container.php
-
message: "#^Parameter \\#1 \\$factory of function DI\\\\factory expects callable\\(\\)\\: mixed, 'App\\\\\\\\Factories\\\\\\\\TwigFactory' given\\.$#"
count: 1
path: app/config/container.php
-
message: "#^Method App\\\\Controllers\\\\DirectoryController\\:\\:__invoke\\(\\) throws checked exception Twig\\\\Error\\\\LoaderError but it's missing from the PHPDoc @throws tag\\.$#"
count: 2
@@ -50,6 +30,11 @@ parameters:
count: 2
path: app/src/Controllers/SearchController.php
-
message: "#^Method App\\\\Controllers\\\\ZipController\\:\\:generateFileName\\(\\) should return string but returns string\\|null\\.$#"
count: 1
path: app/src/Controllers/ZipController.php
-
message: "#^Method App\\\\Exceptions\\\\ErrorHandler\\:\\:__invoke\\(\\) throws checked exception Twig\\\\Error\\\\LoaderError but it's missing from the PHPDoc @throws tag\\.$#"
count: 1
@@ -80,6 +65,16 @@ parameters:
count: 1
path: app/src/Support/Str.php
-
message: "#^Unable to resolve the template type TMakeKey in call to method static method Tightenco\\\\Collect\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:make\\(\\)$#"
count: 1
path: app/src/ViewFunctions/Asset.php
-
message: "#^Unable to resolve the template type TMakeValue in call to method static method Tightenco\\\\Collect\\\\Support\\\\Collection\\<\\(int\\|string\\),mixed\\>\\:\\:make\\(\\)$#"
count: 1
path: app/src/ViewFunctions/Asset.php
-
message: "#^Parameter \\#1 \\$separator of function explode expects non\\-empty\\-string, string given\\.$#"
count: 1