Skip to content

Commit

Permalink
Init plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
clemence pereira committed Apr 8, 2021
1 parent 96882c2 commit 47fe130
Show file tree
Hide file tree
Showing 86 changed files with 12,080 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.feature]
indent_style = space
indent_size = 4

[*.js]
indent_style = space
indent_size = 2

[*.json]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[*.neon]
indent_style = space
indent_size = 4

[*.php]
indent_style = space
indent_size = 4

[*.sh]
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false

[.babelrc]
indent_style = space
indent_size = 2

[.gitmodules]
indent_style = tab
indent_size = 4

[.php_cs{,.dist}]
indent_style = space
indent_size = 4

[composer.json]
indent_style = space
indent_size = 4

[package.json]
indent_style = space
indent_size = 2

[phpspec.yml{,.dist}]
indent_style = space
indent_size = 4

[phpstan.neon]
indent_style = space
indent_size = 4

[phpunit.xml{,.dist}]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
50 changes: 50 additions & 0 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Security

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:

security:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [7.4]

steps:
- uses: actions/checkout@v2

- name: Setup PHP
run: |
sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
echo "date.timezone=UTC" | sudo tee /etc/php/${{ matrix.php }}/cli/conf.d/timezone.ini
echo "${{ matrix.php }}" > .php-version
- uses: actions/cache@v1
id: cache-composer
with:
path: /home/runner/.composer/cache
key: composer-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer-php:${{ matrix.php }}-

- run: mkdir -p /home/runner/.composer/cache
if: steps.cache-composer.outputs.cache-hit != 'true'

- name: Composer v2
run: sudo composer self-update --2

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- uses: actions/checkout@v2

- name: Install PHP dependencies
run: composer update --prefer-dist

- uses: symfonycorp/security-checker-action@v2
73 changes: 73 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Tests

on:
push:
branches: [ master ]
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:

php:

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [7.4]

env:
SYMFONY_ARGS: --no-tls
COMPOSER_ARGS: --prefer-dist
DOCKER_INTERACTIVE_ARGS: -t

steps:
- uses: actions/checkout@v2

- name: Setup PHP
run: |
sudo update-alternatives --set php /usr/bin/php${{ matrix.php }}
echo "date.timezone=UTC" | sudo tee /etc/php/${{ matrix.php }}/cli/conf.d/timezone.ini
echo "${{ matrix.php }}" > .php-version
- name: Install symfony CLI
run: |
curl https://get.symfony.com/cli/installer | bash
echo "${HOME}/.symfony/bin" >> $GITHUB_PATH
- uses: actions/cache@v1
id: cache-composer
with:
path: /home/runner/.composer/cache
key: composer2-php:${{ matrix.php }}-${{ github.sha }}
restore-keys: composer2-php:${{ matrix.php }}-

- run: mkdir -p /home/runner/{.composer/cache,.config/composer}
if: steps.cache-composer.outputs.cache-hit != 'true'

- name: Composer v2
run: sudo composer self-update --2

- name: Composer Github Auth
run: composer config -g github-oauth.github.com ${{ github.token }}

- run: make install

- run: make test.composer

- run: make test.phpcs

- run: make test.phpunit

- run: make test.phpstan

- run: make test.phpspec

- run: make test.yaml

- run: make test.twig

- run: make test.schema

#- run: make test.container
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/vendor/
/composer.lock

/etc/build/*
!/etc/build/.gitignore

/tests/Application/yarn.lock
/tests/Application/package-lock.json
/tests/Application/.php-version

/behat.yml
/phpspec.yml

/package-lock.json

/.php-version
/.phpunit.result.cache
/node_modules
/yarn.lock
1 change: 1 addition & 0 deletions .php-version.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.4
119 changes: 119 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?php

declare(strict_types=1);

$header = <<<'HEADER'
This file is part of Monsieur Biz' menu plugin for Sylius.
(c) Monsieur Biz <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude([
'tests/Application/var',
'tests/Application/bin',
'tests/Application/config',
]);

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'@PHPUnit60Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'align_multiline_comment' => [
'comment_type' => 'phpdocs_like',
],
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short',
],
'comment_to_phpdoc' => true,
'compact_nullable_typehint' => true,
'concat_space' => [
'spacing' => 'one',
],
'doctrine_annotation_array_assignment' => [
'operator' => '=',
],
'doctrine_annotation_spaces' => [
'after_array_assignments_equals' => false,
'before_array_assignments_equals' => false,
],
'explicit_indirect_variable' => true,
'fully_qualified_strict_types' => true,
'function_declaration' => [
'closure_function_spacing' => 'none',
],
'header_comment' => [
'header' => $header,
'location' => 'after_open',
],
'logical_operators' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'new_line_for_chained_calls',
],
'no_alternative_syntax' => true,
'no_extra_blank_lines' => [
'tokens' => [
'break',
'continue',
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'throw',
'use',
],
],
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => false,
'no_unset_cast' => true,
'no_unset_on_property' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_imports' => [
'imports_order' => [
'class',
'function',
'const',
],
'sort_algorithm' => 'alpha',
],
'php_unit_method_casing' => [
'case' => 'camel_case',
],
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_annotation' => [
'style' => 'prefix',
],
'phpdoc_align' => [
'align' => 'left',
],
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => true,
],
'phpdoc_order' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_to_comment' => false,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_var_annotation_correct_order' => true,
'return_assignment' => true,
'strict_param' => true,
'visibility_required' => [
'elements' => [
'const',
'method',
'property',
],
],
'void_return' => true,
])
->setFinder($finder);
7 changes: 7 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2021 Monsieur Biz

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 47fe130

Please sign in to comment.