diff --git a/.github/workflows/check-signed.yml b/.github/workflows/check-signed.yml index b466d3e..a66de41 100644 --- a/.github/workflows/check-signed.yml +++ b/.github/workflows/check-signed.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v4 - name: Check signed commits in PR - uses: 1Password/check-signed-commits-action@v1.0.0 + uses: 1Password/check-signed-commits-action@v1.2.0 with: comment: | You must GPG-sign your work, certifying that you either wrote the work or otherwise have the right to pass it on to an open-source project. See Developer's Certificate of Origin. See [signing][1]. diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 4e75197..0d4a013 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -17,4 +17,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v4 - name: 'Dependency Review' - uses: actions/dependency-review-action@v3 + uses: actions/dependency-review-action@v4 diff --git a/.github/workflows/test-coding-standard.yml b/.github/workflows/test-coding-standard.yml index 7b8ae5b..3d47bbe 100644 --- a/.github/workflows/test-coding-standard.yml +++ b/.github/workflows/test-coding-standard.yml @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.4', '8.0', '8.1'] + php-versions: ['7.4', '8.3'] steps: - name: Checkout @@ -48,7 +48,7 @@ jobs: run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} @@ -65,4 +65,4 @@ jobs: fi - name: Run checking coding standard - run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff \ No newline at end of file + run: vendor/bin/php-cs-fixer fix --verbose --ansi --dry-run --using-cache=no --diff diff --git a/.github/workflows/test-phpstan.yml b/.github/workflows/test-phpstan.yml index c7ff370..f4145bc 100644 --- a/.github/workflows/test-phpstan.yml +++ b/.github/workflows/test-phpstan.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2'] + php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout @@ -53,7 +53,7 @@ jobs: run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} @@ -65,7 +65,7 @@ jobs: run: mkdir -p build/phpstan - name: Cache PHPStan results - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: build/phpstan key: ${{ runner.os }}-phpstan-${{ github.sha }} @@ -80,4 +80,4 @@ jobs: fi - name: Run static analysis - run: vendor/bin/phpstan analyze \ No newline at end of file + run: vendor/bin/phpstan analyze diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index 34b7f37..8bba70a 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -31,7 +31,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[ci skip]')" strategy: matrix: - php-versions: ['7.4', '8.0', '8.1', '8.2'] + php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout @@ -51,7 +51,7 @@ jobs: run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} diff --git a/.github/workflows/test-rector.yml b/.github/workflows/test-rector.yml index 36121d7..42e7ee8 100644 --- a/.github/workflows/test-rector.yml +++ b/.github/workflows/test-rector.yml @@ -26,7 +26,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.0', '8.1', '8.2'] + php-versions: ['8.1', '8.2', '8.3'] steps: - name: Checkout @@ -46,7 +46,7 @@ jobs: run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Cache composer dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.COMPOSER_CACHE_FILES_DIR }} key: ${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} @@ -63,4 +63,4 @@ jobs: fi - name: Analyze for refactoring - run: vendor/bin/rector process --dry-run \ No newline at end of file + run: vendor/bin/rector process --dry-run diff --git a/composer.json b/composer.json index 830512d..790c145 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "phpstan/phpstan": "^1.10", "phpunit/phpcov": "^8.2", "phpunit/phpunit": "^9.6", - "rector/rector": "0.18.5" + "rector/rector": "1.0.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/rector.php b/rector.php index 556f684..c7b92ac 100644 --- a/rector.php +++ b/rector.php @@ -28,6 +28,7 @@ use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector; use Rector\CodeQuality\Rector\FunctionLike\SimplifyUselessVariableRector; use Rector\CodeQuality\Rector\If_\CombineIfRector; +use Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector; use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector; use Rector\CodeQuality\Rector\If_\ShortenElseIfRector; use Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector; @@ -44,7 +45,6 @@ use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; use Rector\Config\RectorConfig; -use Rector\Core\ValueObject\PhpVersion; use Rector\DeadCode\Rector\Array_\RemoveDuplicatedArrayKeyRector; use Rector\DeadCode\Rector\Assign\RemoveDoubleAssignRector; use Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector; @@ -77,6 +77,7 @@ use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; +use Rector\ValueObject\PhpVersion; return static function (RectorConfig $rectorConfig): void { $rectorConfig->sets([ @@ -159,6 +160,7 @@ $rectorConfig->rule(SimplifyRegexPatternRector::class); $rectorConfig->rule(SimplifyStrposLowerRector::class); $rectorConfig->rule(CombineIfRector::class); + $rectorConfig->rule(CompleteMissingIfElseBracketRector::class); $rectorConfig->rule(ShortenElseIfRector::class); $rectorConfig->rule(SimplifyIfElseToTernaryRector::class); $rectorConfig->rule(SimplifyIfReturnBoolRector::class); diff --git a/src/Recaptcha.php b/src/Recaptcha.php index 9bc4e57..8e5db85 100644 --- a/src/Recaptcha.php +++ b/src/Recaptcha.php @@ -171,11 +171,7 @@ public function getWidget(array $parameters = []) $indexResult = 1; foreach ($result as $key => $value) { - if ($countedResult === $indexResult) { - $html .= sprintf('%s="%s"', $key, $value); - } else { - $html .= sprintf('%s="%s" ', $key, $value); - } + $html .= $countedResult === $indexResult ? sprintf('%s="%s"', $key, $value) : sprintf('%s="%s" ', $key, $value); $indexResult++; }