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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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