Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix CS #144

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 29 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:

jobs:
tests:
name: Tests PHP ${{ matrix.php }} (Symfony ${{ matrix.symfony }})
name: Tests PHP ${{ matrix.php }} / Symfony ${{ matrix.symfony }} / API Platform ${{ matrix.api-platform }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -30,23 +30,26 @@ jobs:
- '8.3'
symfony:
# Only Symfony supported versions: https://symfony.com/releases
# API Platform 3.* only supports Symfony >= 6.1
- '6.4.*'
- '7.0.*'
- '7.1.*'
api-platform:
- '^3.4'
- '^4.0'
include:
# Ensure the bundle is bootable
- php: '8.3'
symfony: '6.4.*'
bootable: true
quality: true
- php: '8.3'
symfony: '7.0.*'
symfony: '7.1.*'
api-platform: '^4.0'
bootable: true
quality: true
exclude:
# Symfony 7 requires php 8.2
# Symfony 7 requires PHP 8.2
- php: '8.1'
symfony: '7.1.*'
- php: '8.2'
symfony: '7.1.*'
# API Platform 4 requires PHP 8.2
- php: '8.1'
symfony: '7.0.*'
api-platform: '^4.0'
fail-fast: false
steps:
- name: Checkout
Expand All @@ -67,21 +70,10 @@ jobs:
restore-keys: ${{ runner.os }}-composer-
- name: Configure Symfony
run: composer config extra.symfony.require "${{ matrix.symfony }}"
- name: Configure API Platform
run: composer require --dev "api-platform/core:${{ matrix.api-platform }}"
- name: Update project dependencies
run: composer update --no-progress --ansi --prefer-stable --prefer-dist --no-scripts
- name: Bundle is bootable
if: ${{ matrix.bootable && github.event_name == 'push' && github.ref_name == 'main' }}
run: |
composer create-project "symfony/skeleton:${{ matrix.symfony }}" flex
cd flex
composer config extra.symfony.allow-contrib true
composer req --ignore-platform-reqs tilleuls/forgot-password-bundle:dev-${{ github.ref_name }}
- name: Run php-cs-fixer tests
if: matrix.quality
env:
# PHP CS Fixer does not support PHP 8.3 yet
PHP_CS_FIXER_IGNORE_ENV: 1
run: php-cs-fixer fix --diff --dry-run
- name: Run PHPUnit tests
run: vendor/bin/simple-phpunit --colors=always --testdox
- name: Run Behat tests
Expand All @@ -92,3 +84,16 @@ jobs:
run: |
mkdir -p features/app/cache/jmsserializer/doctrine/orm/Proxies features/app/logs
vendor/bin/behat -p jmsserializer
- name: Run php-cs-fixer tests
if: matrix.quality
env:
# PHP CS Fixer does not support PHP 8.3 yet
PHP_CS_FIXER_IGNORE_ENV: 1
run: php-cs-fixer fix --diff --dry-run
- name: Bundle is bootable
if: ${{ matrix.bootable && github.event_name == 'push' && github.ref_name == 'main' }}
run: |
composer create-project "symfony/skeleton:${{ matrix.symfony }}" flex
cd flex
composer config extra.symfony.allow-contrib true
composer req --ignore-platform-reqs tilleuls/forgot-password-bundle:dev-${{ github.ref_name }}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"require-dev": {
"ext-json": "*",
"api-platform/core": "^3.0",
"api-platform/core": "^3.0 || ^4.0",
"behat/behat": "^3.1",
"dg/bypass-finals": "^1.1",
"doctrine/data-fixtures": "^1.2",
Expand Down
2 changes: 0 additions & 2 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ private function getOpenApiPaths(): array
'required' => true,
],
],
'parameters' => [],
],
'/api/forgot-password/{tokenValue}' => [
'ref' => 'ForgotPassword',
Expand Down Expand Up @@ -586,7 +585,6 @@ private function getOpenApiPaths(): array
'required' => true,
],
],
'parameters' => [],
],
];

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/MissingFieldHttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ final class MissingFieldHttpException extends HttpException implements JsonHttpE
public function __construct($fieldName)
{
trigger_deprecation('tilleuls/forgot-password-bundle', '1.5', 'Status code will change to "%s" in 2.0.', 422);
parent::__construct(400, sprintf('Parameter "%s" is missing.', $fieldName));
parent::__construct(400, \sprintf('Parameter "%s" is missing.', $fieldName));
}
}
2 changes: 1 addition & 1 deletion src/Exception/UnauthorizedFieldException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ final class UnauthorizedFieldException extends HttpException implements JsonHttp
{
public function __construct($propertyName)
{
parent::__construct(400, sprintf('The parameter "%s" is not authorized in your configuration.', $propertyName));
parent::__construct(400, \sprintf('The parameter "%s" is not authorized in your configuration.', $propertyName));
}
}
2 changes: 1 addition & 1 deletion src/Provider/ProviderChain.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function get(?string $name = null): ProviderInterface
}

if (!isset($this->providers[$name])) {
throw new UndefinedProviderException(sprintf('The provider "%s" is not defined.', $name));
throw new UndefinedProviderException(\sprintf('The provider "%s" is not defined.', $name));
}

return $this->providers[$name];
Expand Down