From a08847a5ec7ba6e07851f8efabf39b55a391191d Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Mon, 27 Jan 2025 22:25:16 +0100 Subject: [PATCH 1/2] Add Sylius 1.14 compatibility --- .devcontainer/devcontainer.json | 55 ------------ .github/workflows/recipe.yaml | 150 ++++++++++++++++---------------- .github/workflows/security.yaml | 72 ++++++++------- .github/workflows/tests.yaml | 105 +++++++++++----------- .php-cs-fixer.dist.php | 10 +-- .php-version.dist | 2 +- LICENSE => LICENSE.txt | 0 Makefile | 58 +++++------- README.md | 11 +-- behat.yml.dist | 8 -- composer.json | 15 ++-- phpcs.xml.dist | 16 ---- phpmd.xml | 2 +- phpstan.neon | 8 +- tests/Unit/.gitkeep | 0 15 files changed, 208 insertions(+), 304 deletions(-) delete mode 100644 .devcontainer/devcontainer.json rename LICENSE => LICENSE.txt (100%) delete mode 100644 behat.yml.dist delete mode 100644 phpcs.xml.dist create mode 100644 tests/Unit/.gitkeep diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 58749bc..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,55 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker -{ - "name": "SyliusUiElementsPlugin", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": { - "version": "latest", - "enableNonRootDocker": "true", - "moby": "false" - }, - "ghcr.io/devcontainers/features/github-cli:1": { - "installDirectlyFromGitHubRelease": true, - "version": "latest" - }, - "ghcr.io/devcontainers/features/node:1": { - "nodeGypDependencies": true, - "version": "14", - "nvmVersion": "latest" - }, - "ghcr.io/shyim/devcontainers-features/php:0": { - "installComposer": true, - "version": "8.2" - }, - "ghcr.io/shyim/devcontainers-features/symfony-cli:0": {} - }, - // Use 'forwardPorts' to make a list of ports inside the container available locally. - "forwardPorts": [ - 8000 - ], - "portsAttributes": { - "8000": { - "label": "Sylius Test Application" - } - }, - // Use 'postCreateCommand' to run commands after the container is created. - "onCreateCommand": "make dependencies application codespace.hostname docker.pull install stop", - "postStartCommand": "make up", - // Configure tool-specific properties. - "customizations": { - "vscode": { - "extensions": [ - "ms-vscode.makefile-tools", - "TheNouillet.symfony-vscode", - "xdebug.php-debug", - "eamodio.gitlens" - ] - } - } - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} - diff --git a/.github/workflows/recipe.yaml b/.github/workflows/recipe.yaml index 2d9d874..fa200c7 100644 --- a/.github/workflows/recipe.yaml +++ b/.github/workflows/recipe.yaml @@ -1,82 +1,80 @@ name: Flex Recipe on: - push: - branches: [ master ] - pull_request: + push: + branches: [ master ] + pull_request: jobs: - recipe: - - name: Flex recipe (PHP ${{ matrix.php }}, Sylius ${{ matrix.sylius }}) - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - php: ['8.2'] - sylius: ["~1.12.0", "~1.13.0"] - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: gd, intl, json - ini-values: date.timezone=UTC - tools: symfony-cli - - - name: Set project php-version - run: | - echo ${{ matrix.php }} > .php-version - - - uses: actions/checkout@v3 - with: - path: plugin - - - name: Determine composer cache directory - id: composer-cache-directory - working-directory: plugin - run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT - - - name: Cache dependencies installed with composer - uses: actions/cache@v3 - id: cache-composer - with: - path: ${{ steps.composer-cache-directory.outputs.directory }} - key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ hashFiles('**/composer.json') }} - restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}- - - - name: Ensure that composer cache directory exists - run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }} - - - name: Composer Github Auth - run: composer config -g github-oauth.github.com ${{ github.token }} - - - name: Create Sylius-Standard project without install - run: | - composer create-project --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard sylius "${{ matrix.sylius }}" - - # Because the sylius-standard has a soft constraint - - name: Make sure to install the required version of Sylius - working-directory: ./sylius - run: | - composer require --no-install --no-scripts --no-progress sylius/sylius="${{ matrix.sylius }}" - - - name: Setup some requirements - working-directory: ./sylius - run: | - composer config --no-plugins allow-plugins true - composer config --no-plugins extra.symfony.allow-contrib true - composer config --no-plugins secure-http false - composer config --no-plugins --unset platform.php - composer config --no-plugins extra.symfony.docker false - composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]' - composer config repositories.plugin '{"type": "path", "url": "../plugin/"}' - - - name: Require plugin & install all dependencies - working-directory: ./sylius - run: | - composer require monsieurbiz/sylius-ui-elements-plugin="*@dev" + recipe: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: ['8.2', '8.3'] + sylius: ["~1.12.0", "~1.13.0", "1.14.0"] + + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: gd, intl, json + ini-values: date.timezone=UTC + tools: symfony-cli + + - name: Set project php-version + run: | + echo ${{ matrix.php }} > .php-version + + - uses: actions/checkout@v3 + with: + path: plugin + + - name: Determine composer cache directory + id: composer-cache-directory + working-directory: plugin + run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT + + - name: Cache dependencies installed with composer + uses: actions/cache@v3 + id: cache-composer + with: + path: ${{ steps.composer-cache-directory.outputs.directory }} + key: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}-${{ hashFiles('**/composer.json') }} + restore-keys: composer2-php:${{ matrix.php }}-sylius:${{ matrix.sylius }}- + + - name: Ensure that composer cache directory exists + run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }} + + - name: Composer Github Auth + run: composer config -g github-oauth.github.com ${{ github.token }} + + - name: Create Sylius-Standard project without install + run: | + composer create-project --prefer-dist --no-scripts --no-progress --no-install sylius/sylius-standard sylius "${{ matrix.sylius }}" + + # Because the sylius-standard has a soft constraint + - name: Make sure to install the required version of Sylius + working-directory: ./sylius + run: | + composer require --no-install --no-scripts --no-progress sylius/sylius="${{ matrix.sylius }}" + + - name: Setup some requirements + working-directory: ./sylius + run: | + composer config --no-plugins allow-plugins true + composer config --no-plugins extra.symfony.allow-contrib true + composer config --no-plugins secure-http false + composer config --no-plugins --unset platform.php + composer config --no-plugins extra.symfony.docker false + composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]' + composer config repositories.plugin '{"type": "path", "url": "../plugin/"}' + + - name: Require plugin & install all dependencies + working-directory: ./sylius + run: | + composer require monsieurbiz/sylius-ui-elements-plugin="*@dev" diff --git a/.github/workflows/security.yaml b/.github/workflows/security.yaml index 8167db5..e93dfe1 100644 --- a/.github/workflows/security.yaml +++ b/.github/workflows/security.yaml @@ -1,55 +1,53 @@ name: Security on: - push: - pull_request: + push: + pull_request: jobs: - security: + security: - name: Security check (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.2', '8.3'] - strategy: - fail-fast: false - matrix: - php: ['8.2'] + steps: + - uses: actions/checkout@v3 - steps: - - uses: actions/checkout@v3 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: gd, intl, json - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: gd, intl, json - ini-values: date.timezone=UTC + - name: Set project php-version + run: | + echo "${{ matrix.php }}" > .php-version - - name: Set project php-version - run: | - echo ${{ matrix.php }} > .php-version + - name: Determine composer cache directory + id: composer-cache-directory + run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT - - name: Determine composer cache directory - id: composer-cache-directory - run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT + - name: Cache dependencies installed with composer + uses: actions/cache@v3 + id: cache-composer + with: + path: ${{ steps.composer-cache-directory.outputs.directory }} + key: composer2-php:${{ matrix.php }}-${{ github.sha }} + restore-keys: composer2-php:${{ matrix.php }}- - - name: Cache dependencies installed with composer - uses: actions/cache@v3 - id: cache-composer - with: - path: ${{ steps.composer-cache-directory.outputs.directory }} - key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }} - restore-keys: composer2-php:${{ matrix.php }}- - - name: Ensure that composer cache directory exists - run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }} + - name: Ensure that composer cache directory exists + run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }} - - name: Composer Github Auth - run: composer config -g github-oauth.github.com ${{ github.token }} + - name: Composer Github Auth + run: composer config -g github-oauth.github.com ${{ github.token }} - - name: Install PHP dependencies - run: composer update --prefer-dist + - name: Install PHP dependencies + run: composer update --prefer-dist - - uses: symfonycorp/security-checker-action@v4 + - uses: symfonycorp/security-checker-action@v4 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 501ea6c..1f70459 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -1,78 +1,79 @@ name: Tests on: - push: - branches: [ master ] - pull_request: + push: + branches: [ master ] + pull_request: jobs: - php: + php: - name: Quality tests (PHP ${{ matrix.php }}) + runs-on: ubuntu-latest - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.2', '8.3'] - strategy: - fail-fast: false - matrix: - php: ['8.2'] + env: + SYMFONY_ARGS: --no-tls + COMPOSER_ARGS: --prefer-dist + DOCKER_INTERACTIVE_ARGS: -t - env: - COMPOSER_ARGS: --prefer-dist - DOCKER_INTERACTIVE_ARGS: -t + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: gd, intl, json + ini-values: date.timezone=UTC + tools: symfony-cli - steps: - - uses: actions/checkout@v3 + - name: Set project php-version + run: | + echo "${{ matrix.php }}" > .php-version - - uses: actions/setup-node@v3 - with: - node-version: '16' + - name: Determine composer cache directory + id: composer-cache-directory + run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: gd, intl, json - ini-values: date.timezone=UTC - tools: symfony-cli + - name: Cache dependencies installed with composer + uses: actions/cache@v3 + id: cache-composer + with: + path: ${{ steps.composer-cache-directory.outputs.directory }} + key: composer2-php:${{ matrix.php }}-${{ github.sha }} + restore-keys: composer2-php:${{ matrix.php }}- - - name: Set project php-version - run: | - echo ${{ matrix.php }} > .php-version + - name: Ensure that composer cache directory exists + run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }} - - name: Determine composer cache directory - id: composer-cache-directory - run: echo "directory=$(composer config cache-dir)" >> $GITHUB_OUTPUT + - name: Composer Github Auth + run: composer config -g github-oauth.github.com ${{ github.token }} - - name: Cache dependencies installed with composer - uses: actions/cache@v3 - id: cache-composer - with: - path: ${{ steps.composer-cache-directory.outputs.directory }} - key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }} - restore-keys: composer2-php:${{ matrix.php }}- + - run: make install - - name: Ensure that composer cache directory exists - run: mkdir -p ${{ steps.composer-cache-directory.outputs.directory }} + - run: make test.composer - - name: Composer Github Auth - run: composer config -g github-oauth.github.com ${{ github.token }} + - run: make test.phpcs - - run: make install + - run: make test.phpunit - - run: make test.composer + - run: make test.phpstan - - run: make test.phpcs + - run: make test.phpmd - - run: make test.phpstan + - run: make test.phpspec - - run: make test.phpmd + - run: make test.yaml - - run: make test.yaml + - run: make test.twig - - run: make test.twig + - run: make test.schema - - run: make test.schema - - - run: make test.container + - run: make test.container diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 5c10721..a085c75 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -10,9 +10,11 @@ declare(strict_types=1); $header = <<<'HEADER' -This file is part of Monsieur Biz's SyliusUiElementsPlugin for Sylius. +This file is part of Monsieur Biz' Ui Elements plugin for Sylius. + (c) Monsieur Biz -For the full copyright and license information, please view the LICENSE + +For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code. HEADER; @@ -258,10 +260,8 @@ ], ], 'void_return' => true, - 'whitespace_after_comma_in_array' => true, // already in symfony set + 'whitespace_after_comma_in_array' => true, // alerady in symfony set ]) - ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) - ->setRiskyAllowed(true) ->setFinder($finder) ; diff --git a/.php-version.dist b/.php-version.dist index 2983cad..cf02201 100644 --- a/.php-version.dist +++ b/.php-version.dist @@ -1 +1 @@ -8.2 +8.3 diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/Makefile b/Makefile index 99f9739..b24eaae 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ .DEFAULT_GOAL := help SHELL=/bin/bash APP_DIR=tests/Application -SYLIUS_VERSION=1.13.0 +SYLIUS_VERSION=1.14.0 SYMFONY=cd ${APP_DIR} && symfony COMPOSER=symfony composer CONSOLE=${SYMFONY} console -export COMPOSE_PROJECT_NAME=sylius_ui_elements_plugin -PLUGIN_NAME=sylius-ui-elements-plugin +export COMPOSE_PROJECT_NAME=ui-elements +export MIGRATIONS_NAMESPACE=MonsieurBiz\\SyliusUiElementsPlugin\\Migrations +export USER_UID=$(shell id -u) +PLUGIN_NAME=sylius-${COMPOSE_PROJECT_NAME}-plugin COMPOSE=docker compose YARN=yarn -DOCTRINE_MIGRATIONS_NAMESPACE=MonsieurBiz\SyliusUiElementsPlugin\Migrations - ### ### DEVELOPMENT @@ -78,14 +78,15 @@ setup_application: $(MAKE) ${APP_DIR}/php.ini (cd ${APP_DIR} && ${COMPOSER} install --no-interaction) $(MAKE) apply_dist - (cd ${APP_DIR} && ${COMPOSER} require --no-progress monsieurbiz/${PLUGIN_NAME}="*@dev") + (cd ${APP_DIR} && ${COMPOSER} require --no-progress --no-interaction monsieurbiz/${PLUGIN_NAME}="*@dev") rm -rf ${APP_DIR}/var/cache ${APP_DIR}/docker-compose.yaml: rm -f ${APP_DIR}/docker-compose.yml rm -f ${APP_DIR}/docker-compose.yaml - rm -f ${APP_DIR}/compose.yml ${APP_DIR}/compose.override.dist.yml # Remove files from sylius-standard since 1.12.6 + rm -f ${APP_DIR}/compose.yml # Remove Sylius file about Docker + rm -f ${APP_DIR}/compose.override.dist.yml # Remove Sylius file about Docker ln -s ../../docker-compose.yaml.dist ${APP_DIR}/docker-compose.yaml .PHONY: ${APP_DIR}/docker-compose.yaml @@ -110,7 +111,7 @@ apply_dist: ### TESTS ### ¯¯¯¯¯ -test.all: test.composer test.phpstan test.phpmd test.phpcs test.yaml test.schema test.twig test.container ## Run all tests in once +test.all: test.composer test.phpstan test.phpmd test.phpunit test.phpspec test.phpcs test.yaml test.schema test.twig test.container ## Run all tests in once test.composer: ## Validate composer.json ${COMPOSER} validate --strict @@ -121,6 +122,12 @@ test.phpstan: ## Run PHPStan test.phpmd: ## Run PHPMD ${COMPOSER} phpmd +test.phpunit: ## Run PHPUnit + ${COMPOSER} phpunit + +test.phpspec: ## Run PHPSpec + ${COMPOSER} phpspec + test.phpcs: ## Run PHP CS Fixer in dry-run ${COMPOSER} run -- phpcs --dry-run -v @@ -131,7 +138,7 @@ test.container: ## Lint the symfony container ${CONSOLE} lint:container test.yaml: ## Lint the symfony Yaml files - ${CONSOLE} lint:yaml ../../src/Resources/config + ${CONSOLE} lint:yaml ../../src/Resources/config --parse-tags test.schema: ## Validate MySQL Schema ${CONSOLE} doctrine:schema:validate @@ -139,22 +146,6 @@ test.schema: ## Validate MySQL Schema test.twig: ## Validate Twig templates ${CONSOLE} lint:twig --no-debug templates/ ../../src/Resources/views/ -### -### MIGRATIONS -### ¯¯¯¯¯¯¯¯¯¯ - -app.doctrine.migration.diff: ## Create a diff migration file for the Test Application - ${CONSOLE} doctrine:migrations:diff --namespace="App\Migrations" -.PHONY: app.doctrine.migration.diff - -doctrine.migration.diff: ## Create a diff migration file for the Plugin itself - ${CONSOLE} doctrine:migrations:diff --namespace="${DOCTRINE_MIGRATIONS_NAMESPACE}" -.PHONY: doctrine.migration.diff - -doctrine.migration.migrate: ## Run migrations - ${CONSOLE} doctrine:migration:migrate -n -.PHONY: doctrine.migration.migrate - ### ### SYLIUS ### ¯¯¯¯¯¯ @@ -178,6 +169,9 @@ sylius.assets: ## Install all assets with symlinks messenger.setup: ## Setup Messenger transports ${CONSOLE} messenger:setup-transports +doctrine.diff: ## Doctrine diff + ${CONSOLE} doctrine:migration:diff --namespace="${MIGRATIONS_NAMESPACE}" + ### ### PLATFORM ### ¯¯¯¯¯¯¯¯ @@ -205,7 +199,7 @@ docker.logs: ## Logs the docker containers .PHONY: docker.logs docker.dc: ARGS=ps -docker.dc: ## Run docker compose command. Use ARGS="" to pass parameters to docker-compose. +docker.dc: ## Run docker-compose command. Use ARGS="" to pass parameters to docker-compose. cd ${APP_DIR} && ${COMPOSE} ${ARGS} .PHONY: docker.dc @@ -215,18 +209,6 @@ server.start: ## Run the local webserver using Symfony server.stop: ## Stop the local webserver ${SYMFONY} local:server:stop -### -### GITHUB CODESPACES -### ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ - -codespace.hostname: ${APP_DIR}/.env.local ## Init the SYLIUS_FIXTURES_HOSTNAME variable in .env.local -ifdef CODESPACES - echo SYLIUS_FIXTURES_HOSTNAME=${CODESPACE_NAME}-8000.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN} >> ${APP_DIR}/.env.local -endif - -${APP_DIR}/.env.local: - touch ${APP_DIR}/.env.local - ### ### HELP ### ¯¯¯¯ diff --git a/README.md b/README.md index 4c5f738..2593e84 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

Sylius Ui Elements for Rich Editor

-[![Ui Elements Plugin license](https://img.shields.io/github/license/monsieurbiz/SyliusUiElementsPlugin?public)](https://github.com/monsieurbiz/SyliusUiElementsPlugin/blob/master/LICENSE) +[![Ui Elements Plugin license](https://img.shields.io/github/license/monsieurbiz/SyliusUiElementsPlugin?public)](https://github.com/monsieurbiz/SyliusUiElementsPlugin/blob/master/LICENSE.txt) [![Tests Status](https://img.shields.io/github/actions/workflow/status/monsieurbiz/SyliusUiElementsPlugin/tests.yaml?branch=master&logo=github)](https://github.com/monsieurbiz/SyliusUiElementsPlugin/actions?query=workflow%3ATests) [![Recipe Status](https://img.shields.io/github/actions/workflow/status/monsieurbiz/SyliusUiElementsPlugin/recipe.yaml?branch=master&label=recipes&logo=github)](https://github.com/monsieurbiz/SyliusUiElementsPlugin/actions?query=workflow%3ASecurity) [![Security Status](https://img.shields.io/github/actions/workflow/status/monsieurbiz/SyliusUiElementsPlugin/security.yaml?branch=master&label=security&logo=github)](https://github.com/monsieurbiz/SyliusUiElementsPlugin/actions?query=workflow%3ASecurity) @@ -10,10 +10,11 @@ Library of UiElements for [RichEditor](https://github.com/monsieurbiz/SyliusRich ## Compatibility -| Sylius Version | PHP Version | -|---|---| -| 1.12 | 8.2 | -| 1.13 | 8.2 | +| Sylius Version | PHP Version | +|----------------|-----------------| +| 1.12 | 8.2 - 8.3 | +| 1.13 | 8.2 - 8.3 | +| 1.14 | 8.2 - 8.3 | ## Installation diff --git a/behat.yml.dist b/behat.yml.dist deleted file mode 100644 index ea37647..0000000 --- a/behat.yml.dist +++ /dev/null @@ -1,8 +0,0 @@ -default: - suites: - default: - contexts: - - App\Tests\Behat\DemoContext - - extensions: - FriendsOfBehat\SymfonyExtension: null diff --git a/composer.json b/composer.json index 3b373c9..51b9335 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "license": "MIT", "require": { "php": "^8.2", - "sylius/sylius": ">=1.12 <1.14", + "sylius/sylius": ">=1.12 <2.0", "monsieurbiz/sylius-rich-editor-plugin": "^2.8", "monsieurbiz/sylius-media-manager-plugin": "^1.1" }, @@ -31,21 +31,18 @@ "assets:install %PUBLIC_DIR%": "symfony-cmd" }, "phpcs": "PHP_CS_FIXER_IGNORE_ENV=1 php-cs-fixer fix --using-cache=no", - "phpstan": "phpstan analyse -c phpstan.neon", + "phpstan": "phpstan analyse -c phpstan.neon src/", "phpmd": "phpmd --exclude Migrations/* src/ ansi phpmd.xml", "phpunit": "phpunit", "phpspec": "phpspec run" }, "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + }, "symfony": { "docker": false, - "endpoint": [ - "https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master", - "flex://defaults" - ] - }, - "branch-alias": { - "dev-master": "0.4-dev" + "endpoint": ["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master", "flex://defaults"] } }, "config": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist deleted file mode 100644 index 279b4be..0000000 --- a/phpcs.xml.dist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - src/ - tests/ - - diff --git a/phpmd.xml b/phpmd.xml index c4e85e1..0000ac5 100644 --- a/phpmd.xml +++ b/phpmd.xml @@ -67,4 +67,4 @@ - \ No newline at end of file + diff --git a/phpstan.neon b/phpstan.neon index ae9e132..78fe608 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,7 @@ parameters: level: 8 paths: - - src/ + - %rootDir%/src/ excludePaths: # Makes PHPStan crash @@ -9,3 +9,9 @@ parameters: # Test dependencies - 'tests/Application/**/*' + + ignoreErrors: + - identifier: missingType.generics + - identifier: missingType.iterableValue + + reportUnmatchedIgnoredErrors: false diff --git a/tests/Unit/.gitkeep b/tests/Unit/.gitkeep new file mode 100644 index 0000000..e69de29 From 033616e3b785556df0f62c0e8d705eeec1336d3e Mon Sep 17 00:00:00 2001 From: Maxime Huran Date: Mon, 27 Jan 2025 22:36:24 +0100 Subject: [PATCH 2/2] fix(tests): fix php cs tests --- dist/src/Form/Extension/ProductTypeExtension.php | 6 ++++-- .../MonsieurBizSyliusUiElementsExtension.php | 6 ++++-- src/Form/Type/AccordionElementType.php | 6 ++++-- src/Form/Type/BadgeType.php | 6 ++++-- src/Form/Type/ImageType.php | 6 ++++-- src/Form/Type/KeyFactType.php | 6 ++++-- src/Form/Type/LinkType.php | 6 ++++-- src/Form/Type/MinimalWysiwygType.php | 6 ++++-- src/Form/Type/ThematicType.php | 6 ++++-- src/Form/Type/UiElement/AccordionUiElementType.php | 6 ++++-- src/Form/Type/UiElement/AdvancedQuoteUiElementType.php | 6 ++++-- src/Form/Type/UiElement/BadgesUiElementType.php | 6 ++++-- src/Form/Type/UiElement/FeaturedTextUiElementType.php | 6 ++++-- src/Form/Type/UiElement/FramedUiElementType.php | 6 ++++-- src/Form/Type/UiElement/HeroUiElementType.php | 6 ++++-- src/Form/Type/UiElement/IntroUiElementType.php | 6 ++++-- src/Form/Type/UiElement/JobOfferUiElementType.php | 6 ++++-- src/Form/Type/UiElement/KeyFactsUiElementType.php | 6 ++++-- src/Form/Type/UiElement/LinksUiElementType.php | 6 ++++-- src/Form/Type/UiElement/LogosUiElementType.php | 6 ++++-- src/Form/Type/UiElement/TextWithImageUiElementType.php | 6 ++++-- src/Form/Type/UiElement/ThematicsUiElementType.php | 6 ++++-- src/MonsieurBizSyliusUiElementsPlugin.php | 6 ++++-- 23 files changed, 92 insertions(+), 46 deletions(-) diff --git a/dist/src/Form/Extension/ProductTypeExtension.php b/dist/src/Form/Extension/ProductTypeExtension.php index 5caf070..aff0b8a 100644 --- a/dist/src/Form/Extension/ProductTypeExtension.php +++ b/dist/src/Form/Extension/ProductTypeExtension.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/DependencyInjection/MonsieurBizSyliusUiElementsExtension.php b/src/DependencyInjection/MonsieurBizSyliusUiElementsExtension.php index 36a582e..400fd15 100644 --- a/src/DependencyInjection/MonsieurBizSyliusUiElementsExtension.php +++ b/src/DependencyInjection/MonsieurBizSyliusUiElementsExtension.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/AccordionElementType.php b/src/Form/Type/AccordionElementType.php index 705843c..a61688b 100644 --- a/src/Form/Type/AccordionElementType.php +++ b/src/Form/Type/AccordionElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/BadgeType.php b/src/Form/Type/BadgeType.php index 6584848..634945a 100644 --- a/src/Form/Type/BadgeType.php +++ b/src/Form/Type/BadgeType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/ImageType.php b/src/Form/Type/ImageType.php index 26d3b42..7867b49 100644 --- a/src/Form/Type/ImageType.php +++ b/src/Form/Type/ImageType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/KeyFactType.php b/src/Form/Type/KeyFactType.php index 1c708cc..de5f0b2 100644 --- a/src/Form/Type/KeyFactType.php +++ b/src/Form/Type/KeyFactType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/LinkType.php b/src/Form/Type/LinkType.php index 5d96d79..8a41568 100644 --- a/src/Form/Type/LinkType.php +++ b/src/Form/Type/LinkType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/MinimalWysiwygType.php b/src/Form/Type/MinimalWysiwygType.php index 2065719..32b14f9 100644 --- a/src/Form/Type/MinimalWysiwygType.php +++ b/src/Form/Type/MinimalWysiwygType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/ThematicType.php b/src/Form/Type/ThematicType.php index a9891f3..911b201 100644 --- a/src/Form/Type/ThematicType.php +++ b/src/Form/Type/ThematicType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/AccordionUiElementType.php b/src/Form/Type/UiElement/AccordionUiElementType.php index a0b4f6e..540c084 100644 --- a/src/Form/Type/UiElement/AccordionUiElementType.php +++ b/src/Form/Type/UiElement/AccordionUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/AdvancedQuoteUiElementType.php b/src/Form/Type/UiElement/AdvancedQuoteUiElementType.php index 4957f9f..faf2d00 100644 --- a/src/Form/Type/UiElement/AdvancedQuoteUiElementType.php +++ b/src/Form/Type/UiElement/AdvancedQuoteUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/BadgesUiElementType.php b/src/Form/Type/UiElement/BadgesUiElementType.php index 3b4604b..31fbd8f 100644 --- a/src/Form/Type/UiElement/BadgesUiElementType.php +++ b/src/Form/Type/UiElement/BadgesUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/FeaturedTextUiElementType.php b/src/Form/Type/UiElement/FeaturedTextUiElementType.php index b98c325..2dfb9d9 100644 --- a/src/Form/Type/UiElement/FeaturedTextUiElementType.php +++ b/src/Form/Type/UiElement/FeaturedTextUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/FramedUiElementType.php b/src/Form/Type/UiElement/FramedUiElementType.php index b2440d8..9f354a5 100644 --- a/src/Form/Type/UiElement/FramedUiElementType.php +++ b/src/Form/Type/UiElement/FramedUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/HeroUiElementType.php b/src/Form/Type/UiElement/HeroUiElementType.php index 41afab0..dc30eab 100644 --- a/src/Form/Type/UiElement/HeroUiElementType.php +++ b/src/Form/Type/UiElement/HeroUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/IntroUiElementType.php b/src/Form/Type/UiElement/IntroUiElementType.php index c8a9521..8972e0b 100644 --- a/src/Form/Type/UiElement/IntroUiElementType.php +++ b/src/Form/Type/UiElement/IntroUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/JobOfferUiElementType.php b/src/Form/Type/UiElement/JobOfferUiElementType.php index f1e74d0..4f3e73f 100644 --- a/src/Form/Type/UiElement/JobOfferUiElementType.php +++ b/src/Form/Type/UiElement/JobOfferUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/KeyFactsUiElementType.php b/src/Form/Type/UiElement/KeyFactsUiElementType.php index 0d5db54..ad09ae6 100644 --- a/src/Form/Type/UiElement/KeyFactsUiElementType.php +++ b/src/Form/Type/UiElement/KeyFactsUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/LinksUiElementType.php b/src/Form/Type/UiElement/LinksUiElementType.php index c0d6ee3..bc50a0c 100644 --- a/src/Form/Type/UiElement/LinksUiElementType.php +++ b/src/Form/Type/UiElement/LinksUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/LogosUiElementType.php b/src/Form/Type/UiElement/LogosUiElementType.php index 23e59b3..342002e 100644 --- a/src/Form/Type/UiElement/LogosUiElementType.php +++ b/src/Form/Type/UiElement/LogosUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/TextWithImageUiElementType.php b/src/Form/Type/UiElement/TextWithImageUiElementType.php index 22a36fa..3a10ea2 100644 --- a/src/Form/Type/UiElement/TextWithImageUiElementType.php +++ b/src/Form/Type/UiElement/TextWithImageUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/Form/Type/UiElement/ThematicsUiElementType.php b/src/Form/Type/UiElement/ThematicsUiElementType.php index 78ff7ae..da82a92 100644 --- a/src/Form/Type/UiElement/ThematicsUiElementType.php +++ b/src/Form/Type/UiElement/ThematicsUiElementType.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ diff --git a/src/MonsieurBizSyliusUiElementsPlugin.php b/src/MonsieurBizSyliusUiElementsPlugin.php index 189134b..7dfa475 100644 --- a/src/MonsieurBizSyliusUiElementsPlugin.php +++ b/src/MonsieurBizSyliusUiElementsPlugin.php @@ -1,9 +1,11 @@ - * For the full copyright and license information, please view the LICENSE + * + * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */