Skip to content

Commit

Permalink
ESD-3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pattrick Leo committed Sep 15, 2024
1 parent 1d36d2b commit 605730a
Show file tree
Hide file tree
Showing 143 changed files with 16,653 additions and 1,013 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2

- name: Install Dependencies
run: make dev -B
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2

- name: Install Dependencies
run: make dev -B
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2

- name: Install Dependencies
run: make dev -B
Expand All @@ -69,19 +69,19 @@ jobs:
strategy:
fail-fast: true
matrix:
shopware: [ '6.5.2.0', ]
shopware: [ '6.6.0.0' ]
steps:
- name: Clone Code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2

- name: Start Docker
run: |
docker run --rm --name shop --env PHP_VERSION=8.1 -d dockware/dev:${{ matrix.shopware }}
docker run --rm --name shop --env PHP_VERSION=8.2 -d dockware/dev:${{ matrix.shopware }}
sleep 30
docker logs shop
- name: Upload into Docker
Expand All @@ -95,27 +95,27 @@ jobs:
docker exec shop bash -c 'cd /var/www/html/custom/plugins/SasEsd && make phpunit'
integration:
name: Integration Tests | Shopware ${{ matrix.shopware }} | PHP 8.1
name: Integration Tests | Shopware ${{ matrix.shopware }} | PHP 8.2
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
shopware: [ '6.5.2.0', ]
shopware: [ '6.6.0.0' ]
steps:
- name: Clone Code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2

- name: Install PROD Dependencies
run: make install -B

- name: Start Docker
run: |
docker run --rm --name shop --env PHP_VERSION=8.1 -d dockware/dev:${{ matrix.shopware }}
docker run --rm --name shop --env PHP_VERSION=8.2 -d dockware/dev:${{ matrix.shopware }}
sleep 30
docker logs shop
- name: Upload into Docker
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Temporary Items
/src/Resources/app/administration/node_modules
/src/Resources/app/administration/test/e2e/node_modules
/src/Resources/app/storefront/node_modules
src/Resources/app/administration/twigVuePlugin/node_modules

# Esd
var
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.0.0
- Shopware 6 Kompatibilität

# 2.0.4
* Problem behoben, dass das Flow-Ereignis beim Upgrade von Shopware 6.4 auf 6.5 nicht ausgelöst wird

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_en-GB.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 3.0.0
- Shopware 6 compatibility

# 2.0.4
* Fixed issue that the flow event is not triggered when upgrading from Shopware 6.4 to 6.5

Expand Down
25 changes: 15 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description":"ESD / Download plugin",
"type":"shopware-platform-plugin",
"keywords": ["esd", "download"],
"version":"2.0.4",
"version":"3.0.0",
"license":"proprietary",
"authors":[
{
Expand All @@ -12,13 +12,20 @@
"homepage":"https://shapeandshift.dev"
}
],
"require":{
"shopware/core": "~6.5.2"
"require": {
"shopware/core": "~6.6.0",
"shopware/storefront": "~6.6.0",
"shopware/administration": "~6.6.0"
},
"require-dev":{
"phpunit/phpunit": "^9.5",
"symplify/easy-coding-standard": "^9.3.12",
"phpstan/phpstan": "^1.8"
"phpunit/phpunit": "^10.4",
"phpstan/phpstan": "1.10.60",
"phpcompatibility/php-compatibility": "^9.3",
"squizlabs/php_codesniffer": "^3.6",
"infection/infection": "^0.28.0",
"kubawerlos/php-cs-fixer-custom-fixers": "^v3.21.0",
"symplify/easy-coding-standard": "^12.1.14",
"friendsofphp/php-cs-fixer": "^v3.52.1"
},
"autoload":{
"psr-4":{
Expand Down Expand Up @@ -52,11 +59,9 @@
}
},
"config": {
"platform": {
"php": "8.1.0"
},
"allow-plugins": {
"symfony/runtime": true
"symfony/runtime": true,
"infection/extension-installer": true
}
}
}
111 changes: 53 additions & 58 deletions easy-coding-standard.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);

use PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer;
Expand Down Expand Up @@ -37,74 +38,68 @@
use PhpCsFixerCustomFixers\Fixer\NoUselessStrlenFixer;
use PhpCsFixerCustomFixers\Fixer\PhpdocNoIncorrectVarAnnotationFixer;
use PhpCsFixerCustomFixers\Fixer\SingleSpaceAfterStatementFixer;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayListItemNewlineFixer;
use Symplify\CodingStandard\Fixer\ArrayNotation\ArrayOpenerAndCloserNewlineFixer;
use Symplify\CodingStandard\Fixer\ArrayNotation\StandaloneLineInMultilineArrayFixer;
use Symplify\EasyCodingStandard\ValueObject\Option;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->dynamicSets([
'@Symfony',
'@Symfony:risky',
]);

$ecsConfig->sets([
SetList::ARRAY,
SetList::CONTROL_STRUCTURES,
SetList::STRICT,
SetList::PSR_12,
]);

$containerConfigurator->import(SetList::SYMFONY);
$containerConfigurator->import(SetList::SYMFONY_RISKY);
$containerConfigurator->import(SetList::ARRAY);
$containerConfigurator->import(SetList::CONTROL_STRUCTURES);
$containerConfigurator->import(SetList::STRICT);
$containerConfigurator->import(SetList::PSR_12);
$ecsConfig->rule(ModernizeTypesCastingFixer::class);
$ecsConfig->ruleWithConfiguration(ClassAttributesSeparationFixer::class, ['elements' => ['property' => 'one', 'method' => 'one']]);
$ecsConfig->rule(FopenFlagsFixer::class);
$ecsConfig->ruleWithConfiguration(MethodArgumentSpaceFixer::class, ['on_multiline' => 'ensure_fully_multiline']);
$ecsConfig->ruleWithConfiguration(NativeFunctionInvocationFixer::class, [
'include' => [NativeFunctionInvocationFixer::SET_COMPILER_OPTIMIZED],
'scope' => 'namespaced',
'strict' => false,
]);
$ecsConfig->rule(NativeConstantInvocationFixer::class);
$ecsConfig->rule(NullableTypeDeclarationForDefaultNullValueFixer::class);
$ecsConfig->rule(VoidReturnFixer::class);
$ecsConfig->ruleWithConfiguration(ConcatSpaceFixer::class, ['spacing' => 'one']);

$services->set(ModernizeTypesCastingFixer::class);
$services->set(ClassAttributesSeparationFixer::class)
->call('configure', [['elements' => ['property' => 'one', 'method' => 'one']]]);
$services->set(FopenFlagsFixer::class);
$services->set(MethodArgumentSpaceFixer::class)
->call('configure', [['on_multiline' => 'ensure_fully_multiline']]);
$services->set(NativeFunctionInvocationFixer::class)
->call('configure', [[
'include' => [NativeFunctionInvocationFixer::SET_COMPILER_OPTIMIZED],
'scope' => 'namespaced',
'strict' => false,
]]);
$services->set(NativeConstantInvocationFixer::class);
$services->set(NullableTypeDeclarationForDefaultNullValueFixer::class);
$services->set(VoidReturnFixer::class);
$services->set(ConcatSpaceFixer::class)
->call('configure', [['spacing' => 'one']]);
$services->set(OperatorLinebreakFixer::class);
$services->set(GeneralPhpdocAnnotationRemoveFixer::class)
->call('configure', [['annotations' => ['copyright', 'category']]]);
$services->set(NoSuperfluousPhpdocTagsFixer::class)
->call('configure', [['allow_unused_params' => true]]);
$services->set(PhpdocLineSpanFixer::class);
$services->set(PhpdocOrderFixer::class);
$services->set(PhpUnitConstructFixer::class);
$services->set(PhpUnitDedicateAssertFixer::class)
->call('configure', [['target' => 'newest']]);
$services->set(PhpUnitDedicateAssertInternalTypeFixer::class);
$services->set(PhpUnitMockFixer::class);
$services->set(PhpUnitMockShortWillReturnFixer::class);
$services->set(PhpUnitTestCaseStaticMethodCallsFixer::class);
$services->set(NoUselessReturnFixer::class);
$services->set(DeclareStrictTypesFixer::class);
$services->set(BlankLineBeforeStatementFixer::class);
$services->set(CompactNullableTypehintFixer::class);
$services->set(NoImportFromGlobalNamespaceFixer::class);
$services->set(NoSuperfluousConcatenationFixer::class);
$services->set(NoUselessCommentFixer::class);
$services->set(PhpdocNoIncorrectVarAnnotationFixer::class);
$services->set(SingleSpaceAfterStatementFixer::class);
$services->set(NoUselessParenthesisFixer::class);
$services->set(NoUselessStrlenFixer::class);
$ecsConfig->rule(OperatorLinebreakFixer::class);
$ecsConfig->ruleWithConfiguration(GeneralPhpdocAnnotationRemoveFixer::class, ['annotations' => ['copyright', 'category']]);
$ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, ['allow_unused_params' => true]);
$ecsConfig->rule(PhpdocLineSpanFixer::class);
$ecsConfig->rule(PhpdocOrderFixer::class);
$ecsConfig->rule(PhpUnitConstructFixer::class);
$ecsConfig->ruleWithConfiguration(PhpUnitDedicateAssertFixer::class, ['target' => 'newest']);
$ecsConfig->rule(PhpUnitDedicateAssertInternalTypeFixer::class);
$ecsConfig->rule(PhpUnitMockFixer::class);
$ecsConfig->rule(PhpUnitMockShortWillReturnFixer::class);
$ecsConfig->rule(PhpUnitTestCaseStaticMethodCallsFixer::class);
$ecsConfig->rule(NoUselessReturnFixer::class);
$ecsConfig->rule(DeclareStrictTypesFixer::class);
$ecsConfig->rule(BlankLineBeforeStatementFixer::class);
$ecsConfig->rule(CompactNullableTypehintFixer::class);
$ecsConfig->rule(NoImportFromGlobalNamespaceFixer::class);
$ecsConfig->rule(NoSuperfluousConcatenationFixer::class);
$ecsConfig->rule(NoUselessCommentFixer::class);
$ecsConfig->rule(PhpdocNoIncorrectVarAnnotationFixer::class);
$ecsConfig->rule(SingleSpaceAfterStatementFixer::class);
$ecsConfig->rule(NoUselessParenthesisFixer::class);
$ecsConfig->rule(NoUselessStrlenFixer::class);

$parameters = $containerConfigurator->parameters();
$parameters->set(Option::PATHS, [
$ecsConfig->paths([
'src',
'tests',
'easy-coding-standard.php',
]);

$parameters->set(Option::SKIP, [
$ecsConfig->skip([
ArrayOpenerAndCloserNewlineFixer::class => null,
ArrayListItemNewlineFixer::class => null,
SingleLineThrowFixer::class => null,
Expand All @@ -114,7 +109,7 @@
PhpdocSummaryFixer::class => null,
ExplicitStringVariableFixer::class => null,
StandaloneLineInMultilineArrayFixer::class => null,
PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class => [
NoSuperfluousPhpdocTagsFixer::class => [
__DIR__ . '/.gitlab-ci/tools/src/Service/ProcessBuilder.php',
],
'**/node_modules',
Expand Down
13 changes: 12 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ ecs: ## Starts the ESC checker
csfix: ## Starts the PHP CS Fixer, set [mode=fix] to auto fix
php ./vendor/bin/ecs check src tests --config easy-coding-standard.php --fix

eslint: ## Starts the ESLinter
cd ./src/Resources/app/administration && ./node_modules/.bin/eslint --config ./.eslintrc.js ./src --ext .js,.ts,.vue,.html.twig

lint-fix: ## Starts the ESLint Fixer
cd ./src/Resources/app/administration && ./node_modules/.bin/eslint --config ./.eslintrc.js ./src --ext .js,.ts,.vue,.html.twig --fix

fix: ## Starts the PHP CS Fixer and ESLint Fixer
@make csfix -B
@make lint-fix -B

review: ## Review
make stan -B
make ecs -B
make phpunit -B
make phpunit -B
make eslint -B
5 changes: 3 additions & 2 deletions phpunit.autoload.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php
declare(strict_types=1);

include_once __DIR__ . '/vendor/autoload.php';

$classLoader = new \Composer\Autoload\ClassLoader();
$classLoader = new Composer\Autoload\ClassLoader();
$classLoader->addPsr4('Sas\\Esd\\', __DIR__ . '/src', true);
$classLoader->addPsr4('Sas\\Esd\\Tests\\', __DIR__ . '/tests/PHPUnit', true);
$classLoader->register();
17 changes: 5 additions & 12 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="tests/TestBootstrap.php"
cacheResult="false"
colors="true"
resolveDependencies="true"
>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="phpunit.autoload.php" cacheResult="false" colors="true" executionOrder="random" resolveDependencies="true">
<testsuites>
<testsuite name="SasEsd Tests">
<directory>tests/PHPUnit/</directory>
<directory>./tests/PHPUnit/</directory>
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./src</directory>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</source>
</phpunit>
Loading

0 comments on commit 605730a

Please sign in to comment.