Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Added GrumPHP workflow #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
35 changes: 35 additions & 0 deletions .github/workflows/grumphp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on: [push]

jobs:
build:
name: GrumPHP on (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: [ ubuntu-latest, windows-latest, macos-latest ]
php-versions: ['7.4', '8.0' ]
env:
extensions: intl, mbstring
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
tools: composer:v2
- name: Get Composer Cache Directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --prefer-dist
npm install --prefix vendor/shopware/platform/src/Administration/Resources/app/administration
- run: ./vendor/bin/grumphp run
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
}
},
"require-dev": {
"phpro/grumphp-shim": "^1.0"
"phpro/grumphp-shim": "^1.3",
"shopware/platform": "*",
"symplify/easy-coding-standard": "^9.4",
"kubawerlos/php-cs-fixer-custom-fixers": "^3.1"
}
}
13 changes: 13 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php declare(strict_types=1);

use PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\AssignmentInConditionSniff;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('vendor/shopware/platform/easy-coding-standard.php');
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::SKIP, [
AssignmentInConditionSniff::class . '.FoundInWhileCondition',
]);
};
6 changes: 3 additions & 3 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
grumphp:
tasks:
ecs:
config: '../../../vendor/shopware/platform/easy-coding-standard.yml'
config: 'ecs.php'
clear-cache: true
paths:
- 'src'
eslint:
bin: '../../../vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/.bin/eslint'
config: '../../../vendor/shopware/platform/src/Administration/Resources/app/administration/.eslintrc.js'
bin: 'vendor/shopware/platform/src/Administration/Resources/app/administration/node_modules/.bin/eslint'
config: 'vendor/shopware/platform/src/Administration/Resources/app/administration/.eslintrc.js'
whitelist_patterns:
- /src\/Resources\/app\/administration\/(.*)/
triggered_by:
Expand Down
6 changes: 4 additions & 2 deletions src/Custom/Banner/AdvancedBanner.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner;

Expand All @@ -13,7 +15,7 @@ class AdvancedBanner extends Entity
* @var string
*/
protected $technicalName;

/**
* @var array
*/
Expand Down
8 changes: 5 additions & 3 deletions src/Custom/Banner/AdvancedBannerCollection.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner;

use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;

/**
* @method void add(AdvancedBanner $entity)
* @method void set(string $key, AdvancedBanner $entity)
* @method void add(AdvancedBanner $entity)
* @method void set(string $key, AdvancedBanner $entity)
* @method AdvancedBanner[] getIterator()
* @method AdvancedBanner[] getElements()
* @method AdvancedBanner|null get(string $key)
Expand Down
5 changes: 3 additions & 2 deletions src/Custom/Banner/AdvancedBannerDefinition.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner;

Expand All @@ -7,7 +9,6 @@
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\PrimaryKey;
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required;
use Shopware\Core\Framework\DataAbstractionLayer\Field\IdField;
use Shopware\Core\Framework\DataAbstractionLayer\Field\JsonField;
use Shopware\Core\Framework\DataAbstractionLayer\Field\StringField;
use Shopware\Core\Framework\DataAbstractionLayer\Field\TranslatedField;
use Shopware\Core\Framework\DataAbstractionLayer\Field\TranslationsAssociationField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner\Aggregate\AdvancedBannerTranslation;

use Shopware\Core\Framework\DataAbstractionLayer\EntityCollection;

/**
* @method void add(AdvancedBannerTranslationEntity $entity)
* @method void set(string $key, AdvancedBannerTranslationEntity $entity)
* @method void add(AdvancedBannerTranslationEntity $entity)
* @method void set(string $key, AdvancedBannerTranslationEntity $entity)
* @method AdvancedBannerTranslationEntity[] getIterator()
* @method AdvancedBannerTranslationEntity[] getElements()
* @method AdvancedBannerTranslationEntity|null get(string $key)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner\Aggregate\AdvancedBannerTranslation;

use RuneLaenen\AdvancedBanners\Custom\Banner\AdvancedBanner;
use RuneLaenen\AdvancedBanners\Custom\Banner\AdvancedBannerDefinition;
use Shopware\Core\Framework\DataAbstractionLayer\EntityTranslationDefinition;
use Shopware\Core\Framework\DataAbstractionLayer\Field\JsonField;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner\Aggregate\AdvancedBannerTranslation;

Expand All @@ -16,6 +18,7 @@ class AdvancedBannerTranslationEntity extends TranslationEntity
* @var array
*/
protected $data;

protected ?AdvancedBanner $rlAbBanner;

public function getRlAbBannerId(): string
Expand Down
4 changes: 3 additions & 1 deletion src/Custom/Banner/Cms/AdvancedBannerCmsElementResolver.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner\Cms;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Custom\Banner\Cms;

Expand Down
4 changes: 3 additions & 1 deletion src/Migration/Migration1600455645CreateBannerTable.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Migration;

Expand Down
5 changes: 3 additions & 2 deletions src/Migration/Migration1614513651AddTranslations.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace RuneLaenen\AdvancedBanners\Migration;

use Doctrine\DBAL\Connection;
use Shopware\Core\Defaults;
use Shopware\Core\Framework\Migration\MigrationStep;

class Migration1614513651AddTranslations extends MigrationStep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@ Shopware.Service('privileges').addPrivilegeMappingEntry({
roles: {
viewer: {
privileges: [
'rl_ab_banner:read'
'rl_ab_banner:read',
],
dependencies: []
dependencies: [],
},
editor: {
privileges: [
'rl_ab_banner:read',
'rl_ab_banner:update',
],
dependencies: [
'rl_ab_banner:viewer'
]
'rl_ab_banner:viewer',
],
},
creator: {
privileges: [
'rl_ab_banner:create',
],
dependencies: [
'rl_ab_banner:viewer',
'rl_ab_banner:editor'
]
'rl_ab_banner:editor',
],
},
deleter: {
privileges: [
'rl_ab_banner:delete',
],
dependencies: [
'rl_ab_banner:viewer'
]
}
}
'rl_ab_banner:viewer',
],
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ Component.register('rl-advanced-banners-detail-preview-layer-button', {
template,

inject: [
'defaultCssStyles'
'defaultCssStyles',
],

mixins: [
Mixin.getByName('placeholder')
Mixin.getByName('placeholder'),
],

props: {
layer: {
type: Object,
required: true
}
required: true,
},
},

computed: {
Expand Down Expand Up @@ -60,6 +60,6 @@ Component.register('rl-advanced-banners-detail-preview-layer-button', {
}

return styles;
}
}
},
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Component.register('rl-advanced-banners-layer-config-button', {
template,

inject: [
'repositoryFactory'
'repositoryFactory',
],

props: {
layer: {
type: Object,
required: true
}
required: true,
},
},

data() {
Expand All @@ -23,39 +23,39 @@ Component.register('rl-advanced-banners-layer-config-button', {
buttonVariantList: [
{
id: 'primary',
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantPrimary')
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantPrimary'),
},
{
id: 'secondary',
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantSecondary')
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantSecondary'),
},
{
id: 'primary-sm',
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantPrimarySmall')
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantPrimarySmall'),
},
{
id: 'secondary-sm',
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantSecondarySmall')
}
name: this.$tc('sw-text-editor-toolbar.link.buttonVariantSecondarySmall'),
},
],
buttonTargetList: [
{
id: '_self',
name: this.$tc('rl-advanced-banners.layer.button.buttonTargetList.self')
name: this.$tc('rl-advanced-banners.layer.button.buttonTargetList.self'),
},
{
id: '_blank',
name: this.$tc('rl-advanced-banners.layer.button.buttonTargetList.blank')
}
]
name: this.$tc('rl-advanced-banners.layer.button.buttonTargetList.blank'),
},
],
};
},

computed: {
config() {
return this.layer.config || {};
}
},
},

methods: {}
methods: {},
});
Loading