Skip to content

Commit f385c3a

Browse files
author
Maxime
authored
Merge pull request #20 from maximehuran/feature/sylius-1-13
Allow Sylius 1.11 to 1.13
2 parents ebf2fec + f61e936 commit f385c3a

20 files changed

+113
-182
lines changed

.github/workflows/recipe.yaml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,20 @@ jobs:
99

1010
recipe:
1111

12-
name: Flex recipe (PHP ${{ matrix.php }}, Sylius ${{ matrix.sylius }})
13-
1412
runs-on: ubuntu-latest
1513

1614
strategy:
1715
fail-fast: false
1816
matrix:
19-
php: ['7.4' ,'8.0', '8.1']
20-
sylius: [ "~1.9.0", "~1.10.0", "~1.11.0", "~1.12.0"]
21-
include:
22-
- php: '8.1'
23-
sylius: '~1.12.0'
24-
sylius_paypal: '~1.5.0'
17+
php: ['8.0', '8.1', '8.2']
18+
sylius: ["~1.11.0", "~1.12.0", "~1.13.0"]
2519
exclude:
26-
- php: 8.1
27-
sylius: "~1.9.0"
28-
- php: 8.0
29-
sylius: "~1.9.0"
30-
- php: 7.4
31-
sylius: "~1.11.0"
32-
- php: 7.4
33-
sylius: "~1.12.0"
20+
- php: '8.2'
21+
sylius: '~1.11.0'
22+
- php: '8.0'
23+
sylius: '~1.12.0'
24+
- php: '8.0'
25+
sylius: '~1.13.0'
3426

3527
steps:
3628
- name: Setup PHP
@@ -39,6 +31,7 @@ jobs:
3931
php-version: ${{ matrix.php }}
4032
extensions: gd, intl, json
4133
ini-values: date.timezone=UTC
34+
tools: symfony-cli
4235

4336
- name: Set project php-version
4437
run: |
@@ -77,23 +70,16 @@ jobs:
7770
run: |
7871
composer require --no-install --no-scripts --no-progress sylius/sylius="${{ matrix.sylius }}"
7972
80-
# Fix Paypal 1.5 on Sylius 1.12 and PHP 8.1
81-
- name: Make sure to install the required version of Sylius Paypal Plugin
82-
if: ${{ matrix.sylius_paypal }}
83-
working-directory: ./sylius
84-
run: |
85-
composer require --no-install --no-scripts --no-progress sylius/paypal-plugin="${{ matrix.sylius_paypal }}" # @see https://github.com/Sylius/PayPalPlugin/issues/295
86-
8773
- name: Setup some requirements
8874
working-directory: ./sylius
8975
run: |
90-
composer config --no-plugins allow-plugins true
91-
composer config --no-plugins extra.symfony.allow-contrib true
92-
composer config --no-plugins secure-http false
93-
composer config --no-plugins --unset platform.php
94-
composer config --no-plugins extra.symfony.docker false
95-
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
96-
composer config repositories.plugin '{"type": "path", "url": "../plugin/"}'
76+
composer config --no-plugins allow-plugins true
77+
composer config --no-plugins extra.symfony.allow-contrib true
78+
composer config --no-plugins secure-http false
79+
composer config --no-plugins --unset platform.php
80+
composer config --no-plugins extra.symfony.docker false
81+
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
82+
composer config repositories.plugin '{"type": "path", "url": "../plugin/"}'
9783
9884
- name: Require plugin & install all dependencies
9985
working-directory: ./sylius

.github/workflows/security.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,25 @@ jobs:
88

99
security:
1010

11-
name: Security check (PHP ${{ matrix.php }})
12-
1311
runs-on: ubuntu-latest
1412

1513
strategy:
1614
fail-fast: false
1715
matrix:
18-
php: ['7.4', '8.0', '8.1']
16+
php: ['8.1', '8.2']
1917

2018
steps:
2119
- uses: actions/checkout@v3
2220

2321
- name: Setup PHP
2422
uses: shivammathur/setup-php@v2
2523
with:
26-
php-version: ${{ matrix.php }}
27-
ini-values: date.timezone=UTC
24+
php-version: ${{ matrix.php }}
25+
extensions: gd, intl, json
2826

2927
- name: Set project php-version
3028
run: |
31-
echo ${{ matrix.php }} > .php-version
29+
echo "${{ matrix.php }}" > .php-version
3230
3331
- name: Determine composer cache directory
3432
id: composer-cache-directory
@@ -39,7 +37,7 @@ jobs:
3937
id: cache-composer
4038
with:
4139
path: ${{ steps.composer-cache-directory.outputs.directory }}
42-
key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
40+
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
4341
restore-keys: composer2-php:${{ matrix.php }}-
4442

4543
- name: Ensure that composer cache directory exists
@@ -52,3 +50,4 @@ jobs:
5250
run: composer update --prefer-dist
5351

5452
- uses: symfonycorp/security-checker-action@v4
53+

.github/workflows/tests.yaml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,34 @@ jobs:
99

1010
php:
1111

12-
name: Quality tests (PHP ${{ matrix.php }})
13-
1412
runs-on: ubuntu-latest
1513

1614
strategy:
1715
fail-fast: false
1816
matrix:
19-
php: ['8.0', '8.1']
17+
php: ['8.1', '8.2']
2018

2119
env:
2220
SYMFONY_ARGS: --no-tls
2321
COMPOSER_ARGS: --prefer-dist
2422
DOCKER_INTERACTIVE_ARGS: -t
2523

2624
steps:
27-
- uses: actions/checkout@v3
28-
29-
- uses: actions/setup-node@v3
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-node@v2
3027
with:
3128
node-version: '14'
32-
3329
- name: Setup PHP
3430
uses: shivammathur/setup-php@v2
3531
with:
36-
php-version: ${{ matrix.php }}
37-
ini-values: date.timezone=UTC
38-
tools: symfony-cli
32+
php-version: ${{ matrix.php }}
33+
extensions: gd, intl, json
34+
ini-values: date.timezone=UTC
35+
tools: symfony-cli
3936

4037
- name: Set project php-version
4138
run: |
42-
echo ${{ matrix.php }} > .php-version
39+
echo "${{ matrix.php }}" > .php-version
4340
4441
- name: Determine composer cache directory
4542
id: composer-cache-directory
@@ -50,7 +47,7 @@ jobs:
5047
id: cache-composer
5148
with:
5249
path: ${{ steps.composer-cache-directory.outputs.directory }}
53-
key: composer2-php:${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
50+
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
5451
restore-keys: composer2-php:${{ matrix.php }}-
5552

5653
- name: Ensure that composer cache directory exists

.php-cs-fixer.dist.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@
4949
'binary_operator_spaces' => true,
5050
'blank_line_after_opening_tag' => true,
5151
'blank_line_after_namespace' => true,
52+
'blank_lines_before_namespace' => true,
5253
'blank_line_before_statement' => true,
53-
'braces' => [
54-
'allow_single_line_closure' => true,
55-
],
5654
'cast_spaces' => true,
5755
'class_attributes_separation' => true,
5856
'class_definition' => [
@@ -62,7 +60,7 @@
6260
'combine_consecutive_issets' => true,
6361
'combine_consecutive_unsets' => true,
6462
'comment_to_phpdoc' => true,
65-
'compact_nullable_typehint' => true,
63+
'compact_nullable_type_declaration' => true,
6664
'concat_space' => [
6765
'spacing' => 'one',
6866
],
@@ -88,8 +86,12 @@
8886
'fully_qualified_strict_types' => true,
8987
'function_declaration' => true,
9088
'function_to_constant' => true,
91-
'function_typehint_space' => true,
9289
'general_phpdoc_tag_rename' => true,
90+
'global_namespace_import' => [
91+
'import_classes' => true,
92+
'import_constants' => false,
93+
'import_functions' => false,
94+
],
9395
'header_comment' => [
9496
'header' => $header,
9597
'location' => 'after_open',
@@ -110,14 +112,15 @@
110112
'lowercase_static_reference' => true,
111113
'magic_constant_casing' => true,
112114
'method_argument_space' => true,
115+
'modernize_strpos' => false,
113116
'modernize_types_casting' => true,
114117
'multiline_comment_opening_closing' => true,
115118
'multiline_whitespace_before_semicolons' => [
116119
'strategy' => 'new_line_for_chained_calls',
117120
],
118121
'native_constant_invocation' => true,
119122
'native_function_casing' => true,
120-
'new_with_braces' => true,
123+
'new_with_parentheses' => true,
121124
'no_alias_functions' => true,
122125
'no_alternative_syntax' => true,
123126
'no_blank_lines_after_class_opening' => true,
@@ -156,27 +159,27 @@
156159
'no_short_bool_cast' => true,
157160
'no_spaces_after_function_name' => true,
158161
'no_spaces_around_offset' => true,
159-
'no_spaces_inside_parenthesis' => true,
162+
'spaces_inside_parentheses' => true,
160163
'no_superfluous_elseif' => true,
161164
'no_superfluous_phpdoc_tags' => [
162165
'allow_mixed' => true,
163166
],
164167
'no_unset_cast' => true,
165168
'no_unneeded_control_parentheses' => true,
166-
'no_unneeded_curly_braces' => true,
169+
'no_unneeded_braces' => true,
167170
'no_unneeded_final_method' => true,
168171
'no_unset_on_property' => true,
169172
'no_unused_imports' => true,
170173
'no_useless_else' => true,
171174
'no_useless_return' => true,
172-
'no_trailing_comma_in_list_call' => true,
173-
'no_trailing_comma_in_singleline_array' => true,
175+
'no_trailing_comma_in_singleline' => true,
174176
'no_trailing_whitespace' => true,
175177
'no_trailing_whitespace_in_comment' => true,
176178
'no_whitespace_before_comma_in_array' => true,
177179
'no_whitespace_in_blank_line' => true,
178180
'non_printable_character' => true,
179181
'normalize_index_brace' => true,
182+
'nullable_type_declaration_for_default_null_value' => false,
180183
'object_operator_without_whitespace' => true,
181184
'ordered_imports' => [
182185
'imports_order' => [
@@ -211,7 +214,9 @@
211214
'phpdoc_order' => true,
212215
'phpdoc_return_self_reference' => true,
213216
'phpdoc_scalar' => true,
214-
'phpdoc_separation' => true,
217+
'phpdoc_separation' => ['groups' => [
218+
['ORM\\*'], ['Assert\\*'],
219+
]],
215220
'phpdoc_single_line_var_spacing' => true,
216221
'phpdoc_tag_type' => true,
217222
'phpdoc_to_comment' => false,
@@ -231,7 +236,6 @@
231236
'self_accessor' => true,
232237
'short_scalar_cast' => true,
233238
'single_blank_line_at_eof' => true,
234-
'single_blank_line_before_namespace' => true,
235239
'single_class_element_per_statement' => true,
236240
'single_import_per_statement' => true,
237241
'single_line_after_imports' => true,
@@ -248,6 +252,7 @@
248252
'elements' => ['arrays'],
249253
],
250254
'trim_array_spaces' => true,
255+
'type_declaration_spaces' => true,
251256
'unary_operator_spaces' => true,
252257
'visibility_required' => [
253258
'elements' => [

.php-version.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.1
1+
8.2

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.DEFAULT_GOAL := help
22
SHELL=/bin/bash
33
APP_DIR=tests/Application
4-
SYLIUS_VERSION=1.12.0
5-
SYLIUS_PAYPAL_VERSION=1.5.0
4+
SYLIUS_VERSION=1.13.0
65
SYMFONY=cd ${APP_DIR} && symfony
76
COMPOSER=symfony composer
87
CONSOLE=${SYMFONY} console
@@ -73,7 +72,6 @@ setup_application:
7372
(cd ${APP_DIR} && ${COMPOSER} config --no-plugins allow-plugins true)
7473
(cd ${APP_DIR} && ${COMPOSER} config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]')
7574
(cd ${APP_DIR} && ${COMPOSER} require --no-install --no-scripts --no-progress sylius/sylius="~${SYLIUS_VERSION}") # Make sure to install the required version of sylius because the sylius-standard has a soft constraint
76-
(cd ${APP_DIR} && ${COMPOSER} require --no-install --no-scripts --no-progress sylius/paypal-plugin="~${SYLIUS_PAYPAL_VERSION}") # @see https://github.com/Sylius/PayPalPlugin/issues/295
7775
$(MAKE) ${APP_DIR}/.php-version
7876
$(MAKE) ${APP_DIR}/php.ini
7977
(cd ${APP_DIR} && ${COMPOSER} install --no-interaction)
@@ -85,6 +83,8 @@ setup_application:
8583
${APP_DIR}/docker-compose.yaml:
8684
rm -f ${APP_DIR}/docker-compose.yml
8785
rm -f ${APP_DIR}/docker-compose.yaml
86+
rm -f ${APP_DIR}/compose.yml # Remove Sylius file about Docker
87+
rm -f ${APP_DIR}/compose.override.dist.yml # Remove Sylius file about Docker
8888
ln -s ../../docker-compose.yaml.dist ${APP_DIR}/docker-compose.yaml
8989
.PHONY: ${APP_DIR}/docker-compose.yaml
9090

@@ -136,7 +136,7 @@ test.container: ## Lint the symfony container
136136
${CONSOLE} lint:container
137137

138138
test.yaml: ## Lint the symfony Yaml files
139-
${CONSOLE} lint:yaml ../../recipes ../../src/Resources/config
139+
${CONSOLE} lint:yaml ../../src/Resources/config --parse-tags
140140

141141
test.schema: ## Validate MySQL Schema
142142
${CONSOLE} doctrine:schema:validate

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
[![Banner of Sylius Media Manager plugin](docs/images/banner.jpg)](https://monsieurbiz.com/agence-web-experte-sylius)
22

3-
<h1 align="center">Media Manager for Sylius</h1>
3+
<h1 align="center">Sylius Media Manager</h1>
44

55
[![Media Manager Plugin license](https://img.shields.io/github/license/monsieurbiz/SyliusMediaManagerPlugin?public)](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/blob/master/LICENSE.txt)
6-
[![Recipe](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions/workflows/recipe.yaml/badge.svg?branch=master&event=push)](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions/workflows/recipe.yaml)
7-
[![Tests](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions/workflows/tests.yaml/badge.svg?branch=master&event=push)](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions/workflows/tests.yaml)
8-
[![Security](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions/workflows/security.yaml/badge.svg?branch=master&event=push)](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions/workflows/security.yaml)
6+
[![Tests Status](https://img.shields.io/github/actions/workflow/status/monsieurbiz/SyliusMediaManagerPlugin/tests.yaml?branch=master&logo=github)](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions?query=workflow%3ATests)
7+
[![Recipe Status](https://img.shields.io/github/actions/workflow/status/monsieurbiz/SyliusMediaManagerPlugin/recipe.yaml?branch=master&label=recipes&logo=github)](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions?query=workflow%3ASecurity)
8+
[![Security Status](https://img.shields.io/github/actions/workflow/status/monsieurbiz/SyliusMediaManagerPlugin/security.yaml?branch=master&label=security&logo=github)](https://github.com/monsieurbiz/SyliusMediaManagerPlugin/actions?query=workflow%3ASecurity)
9+
This plugin adds a rich editor on the fields you want. Now you can manage your content very easily!
910

1011
![Demo of the media manager](docs/images/demo.gif)
1112

13+
## Compatibility
14+
15+
| Sylius Version | PHP Version |
16+
|---|---|
17+
| 1.11 | 8.0 - 8.1 |
18+
| 1.12 | 8.1 - 8.2 |
19+
| 1.13 | 8.1 - 8.2 |
20+
1221
## Installation
1322

23+
If you want to use our recipes, you can configure your composer.json by running:
24+
25+
```json
26+
composer config --no-plugins --json extra.symfony.endpoint '["https://api.github.com/repos/monsieurbiz/symfony-recipes/contents/index.json?ref=flex/master","flex://defaults"]'
27+
```
1428

1529
Install the plugin via composer:
1630

@@ -33,11 +47,7 @@ return [
3347
];
3448
```
3549

36-
Copy the plugin configuration files in your `config` folder:
37-
38-
```bash
39-
cp -Rv vendor/monsieurbiz/sylius-media-manager-plugin/recipes/1.0/config/ config
40-
```
50+
Copy the plugin configuration files in your `config` folder: https://github.com/monsieurbiz/symfony-recipes/tree/master/monsieurbiz/sylius-media-manager-plugin/1.0/config
4151

4252
Add these variables to your `.env` :
4353

0 commit comments

Comments
 (0)