more inspection fixes

This commit is contained in:
Dennis Eichhorn 2022-09-27 18:38:38 +02:00
parent d245e8d184
commit 8f161afcce
9 changed files with 35 additions and 31 deletions

View File

@ -194,27 +194,27 @@ jobs:
run: composer install run: composer install
- name: phpcs - name: phpcs
run: vendor/bin/phpcs --severity=1 ./ --standard="Build/Config/phpcs.xml" -s --report=full run: vendor/bin/phpcs --severity=1 ./ --standard="Build/Config/phpcs.xml" -s --report=full
linting: # linting:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'NO_CI')" # if: "!contains(github.event.head_commit.message, 'NO_CI')"
strategy: # strategy:
fail-fast: false # fail-fast: false
max-parallel: 3 # max-parallel: 3
steps: # steps:
- name: Checkout Repository # - name: Checkout Repository
uses: actions/checkout@main # uses: actions/checkout@main
with: # with:
fetch-depth: 0 # fetch-depth: 0
submodules: recursive # submodules: recursive
token: ${{ secrets.GH_TOKEN }} # token: ${{ secrets.GH_TOKEN }}
- name: Lint Code Base # - name: Lint Code Base
uses: github/super-linter/slim@v4 # uses: github/super-linter/slim@v4
env: # env:
VALIDATE_ALL_CODEBASE: false # VALIDATE_ALL_CODEBASE: false
VALIDATE_PHP: true # VALIDATE_PHP: true
VALIDATE_PHP_BUILTIN: true # VALIDATE_PHP_BUILTIN: true
DEFAULT_BRANCH: develop # DEFAULT_BRANCH: develop
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
custom: custom:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'NO_CI')" if: "!contains(github.event.head_commit.message, 'NO_CI')"

View File

@ -46,7 +46,7 @@ final class Evaluator
$stack = []; $stack = [];
$postfix = self::shuntingYard($equation); $postfix = self::shuntingYard($equation);
foreach ($postfix as $i => $value) { foreach ($postfix as $value) {
if (\is_numeric($value)) { if (\is_numeric($value)) {
$stack[] = $value; $stack[] = $value;
} else { } else {

View File

@ -306,9 +306,11 @@ final class PackageManager
$cmd = $path; $cmd = $path;
} }
/*
if ($cmd !== '') { if ($cmd !== '') {
// @todo implement // @todo implement
} }
*/
} }
} }

View File

@ -2022,7 +2022,7 @@ abstract class MimeType extends Enum
public static function extensionToMime(string $extension) : string public static function extensionToMime(string $extension) : string
{ {
try { try {
return self::getByName('M_' . \strtoupper($extension)) ?? 'application/octet-stream'; return (string) (self::getByName('M_' . \strtoupper($extension)) ?? 'application/octet-stream');
} catch (\Throwable $t) { } catch (\Throwable $t) {
return 'application/octet-stream'; return 'application/octet-stream';
} }

View File

@ -204,6 +204,7 @@ final class Argument implements UriInterface
* *
* @since 1.0.0 * @since 1.0.0
*/ */
/*
private function setInternalFragment(string $uri) : void private function setInternalFragment(string $uri) : void
{ {
$result = \preg_match('/#([a-zA-Z0-9]*)/', $uri, $matches); $result = \preg_match('/#([a-zA-Z0-9]*)/', $uri, $matches);
@ -212,6 +213,7 @@ final class Argument implements UriInterface
$this->fragment = $matches[1] ?? ''; $this->fragment = $matches[1] ?? '';
} }
} }
*/
/** /**
* {@inheritdoc} * {@inheritdoc}

View File

@ -274,10 +274,10 @@ final class ArrayUtils
* *
* Useful for parsing command line parsing * Useful for parsing command line parsing
* *
* @param string $id Id to find * @param string $id Id to find
* @param int[]|string[] $args CLI command list * @param string[] $args CLI command list
* *
* @return string * @return null|string
* *
* @since 1.0.0 * @since 1.0.0
*/ */
@ -297,8 +297,8 @@ final class ArrayUtils
/** /**
* Check if flag is set * Check if flag is set
* *
* @param string $id Id to find * @param string $id Id to find
* @param int[]|string[] $args CLI command list * @param string[] $args CLI command list
* *
* @return int * @return int
* *

View File

@ -101,7 +101,7 @@ final class Permutation
* Permutate based on transposition key. * Permutate based on transposition key.
* *
* @param array|string $toPermute To permutate * @param array|string $toPermute To permutate
* @param array $key Permutation keys * @param int[] $key Permutation keys
* *
* @return string|array * @return string|array
* *

View File

@ -79,7 +79,7 @@ final class Validator extends ValidatorAbstract
} }
foreach ($constraint as $value) { foreach ($constraint as $value) {
if (!\is_a($var, $value)) { if (!\is_a($var, $value, true)) {
return false; return false;
} }
} }

View File

@ -269,7 +269,7 @@ abstract class ViewAbstract implements RenderableInterface
* Render a template file * Render a template file
* *
* @param string $template Template path * @param string $template Template path
* @param mixed ...$data Data to pass to renderer * @param mixed ...$data Data to pass to renderer
* *
* @return string * @return string
* *