diff --git a/.gitattributes b/.gitattributes index 1160f47b7..18ea6a59c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8,6 +8,7 @@ tests export-ignore docs export-ignore Makefile export-ignore phpunit.xml.dist export-ignore +bin/console export-ignore phpstan.neon.dist export-ignore phpstan-baseline.neon export-ignore phpstan-console-application.php export-ignore diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index e878af7c0..886cdc14d 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -9,7 +9,6 @@ on: - cron: '30 0 * * *' push: branches: - - 4.x - 5.x - 6.x pull_request: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index e3f105ca2..e87c957d9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -9,7 +9,6 @@ on: - cron: '30 0 * * *' push: branches: - - 4.x - 5.x - 6.x pull_request: diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml index d269f29e1..88ba7d795 100644 --- a/.github/workflows/qa.yaml +++ b/.github/workflows/qa.yaml @@ -9,7 +9,6 @@ on: - cron: '30 0 * * *' push: branches: - - 4.x - 5.x - 6.x pull_request: diff --git a/.github/workflows/symfony-lint.yaml b/.github/workflows/symfony-lint.yaml new file mode 100644 index 000000000..52c8b9d78 --- /dev/null +++ b/.github/workflows/symfony-lint.yaml @@ -0,0 +1,115 @@ +# DO NOT EDIT THIS FILE! +# +# It's auto-generated by sonata-project/dev-kit package. + +name: Symfony Lint + +on: + schedule: + - cron: '30 0 * * *' + push: + branches: + - 5.x + - 6.x + pull_request: + +jobs: + container: + name: Symfony container + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + coverage: none + tools: composer:v2 + + - name: Install Composer dependencies (highest) + uses: ramsey/composer-install@v1 + with: + dependency-versions: highest + composer-options: --prefer-dist --prefer-stable + + - name: Lint container + run: make lint-symfony-container + + twig: + name: Twig files + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + coverage: none + tools: composer:v2 + + - name: Install Composer dependencies (highest) + uses: ramsey/composer-install@v1 + with: + dependency-versions: highest + composer-options: --prefer-dist --prefer-stable + + - name: Lint twig files + run: make lint-symfony-twig + + xliff: + name: XLIFF files + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + coverage: none + tools: composer:v2 + + - name: Install Composer dependencies (highest) + uses: ramsey/composer-install@v1 + with: + dependency-versions: highest + composer-options: --prefer-dist --prefer-stable + + - name: Lint xliff files + run: make lint-symfony-xliff + + yaml: + name: YML files + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install PHP with extensions + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + coverage: none + tools: composer:v2 + + - name: Install Composer dependencies (highest) + uses: ramsey/composer-install@v1 + with: + dependency-versions: highest + composer-options: --prefer-dist --prefer-stable + + - name: Lint yaml files + run: make lint-symfony-yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6caa860e7..62c328726 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,7 +9,6 @@ on: - cron: '30 0 * * *' push: branches: - - 4.x - 5.x - 6.x pull_request: diff --git a/.symfony.bundle.yaml b/.symfony.bundle.yaml index a73edb392..043df3c78 100644 --- a/.symfony.bundle.yaml +++ b/.symfony.bundle.yaml @@ -3,12 +3,10 @@ # It's auto-generated by sonata-project/dev-kit package. branches: - - 4.x - 5.x - 6.x maintained_branches: - - 4.x - 5.x - 6.x diff --git a/Makefile b/Makefile index b764ceb01..246a6d4d0 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,25 @@ lint-php: php-cs-fixer fix --ansi --verbose --diff --dry-run .PHONY: lint-php +lint-symfony: lint-symfony-container lint-symfony-twig lint-symfony-xliff lint-symfony-yaml +.PHONY: lint-symfony + +lint-symfony-container: + bin/console lint:container +.PHONY: lint-symfony-container + +lint-symfony-twig: + bin/console lint:twig src tests +.PHONY: lint-symfony-twig + +lint-symfony-xliff: + bin/console lint:xliff src tests +.PHONY: lint-symfony-xliff + +lint-symfony-yaml: + bin/console lint:yaml src tests +.PHONY: lint-symfony-yaml + cs-fix: cs-fix-php cs-fix-xml cs-fix-xliff cs-fix-composer .PHONY: cs-fix diff --git a/bin/console b/bin/console new file mode 100755 index 000000000..e9b830b30 --- /dev/null +++ b/bin/console @@ -0,0 +1,29 @@ +#!/usr/bin/env php + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Sonata\UserBundle\Tests\App\AppKernel; +use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Component\Console\Input\ArgvInput; + +if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { + echo 'Warning: The console should be invoked via the CLI version of PHP, not the ' . PHP_SAPI . ' SAPI' . PHP_EOL; +} + +set_time_limit(0); + +require dirname(__DIR__) . '/vendor/autoload.php'; + +$kernel = new AppKernel(); +$application = new Application($kernel); +$application->run(new ArgvInput()); diff --git a/docs/.doctor-rst.yaml b/docs/.doctor-rst.yaml index 5aca42d6a..4b5b5ef97 100644 --- a/docs/.doctor-rst.yaml +++ b/docs/.doctor-rst.yaml @@ -44,4 +44,3 @@ rules: whitelist: lines: - '.. versionadded:: 5.x' - - 'resource: "@NelmioApiDocBundle/Resources/config/routing.yml"'