diff --git a/.dependabot/config.yml b/.dependabot/config.yml new file mode 100644 index 00000000..dc185bee --- /dev/null +++ b/.dependabot/config.yml @@ -0,0 +1,17 @@ +# https://dependabot.com/docs/config-file/ + +version: 1 + +update_configs: + - package_manager: "php:composer" + directory: "/" + automerged_updates: + - match: + dependency_type: "development" + default_assignees: + - "core23" + default_labels: + - "dependency" + default_reviewers: + - "core23" + update_schedule: "daily" diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..b541e8a7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,29 @@ +root = true + +[*] +end_of_line = lf +indent_style = space +charset = utf-8 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.php] +indent_size = 4 + +[*.twig] +indent_size = 4 + +[*.{yaml,yml}] +indent_size = 4 + +[*.{js,scss,css}] +indent_size = 2 + +[Jenkinsfile] +indent_size = 2 + +[*.json] +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..eb9d1f13 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +.* export-ignore +Makefile export-ignore +Jenkinsfile export-ignore +phpstan.neon export-ignore +phpunit.xml.dist export-ignore +/docs export-ignore +/tests export-ignore +/vendor-bin export-ignore diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..8f50ea9e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @core23 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..74643733 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +github: core23 +open_collective: core23 +ko_fi: core23 +custom: https://donate.core23.de diff --git a/.github/ISSUE_TEMPLATE/Bug.md b/.github/ISSUE_TEMPLATE/Bug.md new file mode 100644 index 00000000..963c011a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug.md @@ -0,0 +1,48 @@ +--- +name: 🐞 Bug Report +about: Something is broken? 🔨 +--- + + + + + +### Environment + +#### Packages + +``` +$ composer show --latest +# Put the result here. +``` + +#### PHP version + +``` +$ php -v +# Put the result here. +``` + +## Subject + + + +## Steps to reproduce + +## Expected results + +## Actual results + + diff --git a/.github/ISSUE_TEMPLATE/Feature.md b/.github/ISSUE_TEMPLATE/Feature.md new file mode 100644 index 00000000..b27c9ac5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature.md @@ -0,0 +1,8 @@ +--- +name: 🚀 Feature Request +about: I have a suggestion (and may want to implement it)! +--- + +## Feature Request + + diff --git a/.github/ISSUE_TEMPLATE/Question.md b/.github/ISSUE_TEMPLATE/Question.md new file mode 100644 index 00000000..3f2537cc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Question.md @@ -0,0 +1,8 @@ +--- +name: ❓ Support Question +about: I have a general question 💬! +--- + +## Question + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..880338d4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,12 @@ + + + + +Closes #{put_issue_number_here} + +## Subject + + diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..0f7b211b --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,27 @@ +name-template: 'v$NEXT_PATCH_VERSION' +tag-template: 'v$NEXT_PATCH_VERSION' + +categories: + - title: '❌ BC Breaks' + labels: + - 'bc break' + - title: '🚀 Features' + labels: + - 'feature' + - title: '🐛 Bug Fixes' + labels: + - 'bugfix' + - title: '📦 Dependencies' + labels: + - 'dependency' + +exclude-labels: + - 'docs' + - 'pedantic' + +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' + +template: | + ## Changes + + $CHANGES diff --git a/.github/settings.yml b/.github/settings.yml new file mode 100644 index 00000000..0cb13ef4 --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,64 @@ +# These settings are synced to GitHub by https://probot.github.io/apps/settings/ + +repository: + name: NucleosUserAdminBundle + description: Adminstration of users and groups in symfony + homepage: https://docs.nucleos.rocks/projects/user-admin-bundle + topics: symfony, symfony-bundle, bundle, user, management, admin, sonata + + default_branch: master + private: false + allow_squash_merge: true + allow_merge_commit: true + allow_rebase_merge: true + has_issues: true + has_pages: false + has_projects: false + has_wiki: false + +labels: + - name: automerge + color: ededed + - name: bc break + color: ff0000 + - name: bugfix + color: fc2929 + - name: dependency + color: 5fb2d8 + - name: docs + color: fbca04 + - name: feature + color: 0e8a16 + - name: help wanted + color: 159818 + - name: invalid + color: e6e6e6 + - name: pedantic + color: DDDDDD + - name: question + color: cc317c + +branches: + - name: master + protection: + enforce_admins: falser + required_status_checks: + contexts: + - "Coding Standards (7.4)" + - "Static Code Analysis (7.4)" + - "Tests (7.3, lowest, ~4.4)" + - "Tests (7.3, lowest, ~5.0)" + - "Tests (7.3, highest, ~4.4)" + - "Tests (7.3, highestf, ~5.0)" + - "Tests (7.4, lowest, ~4.4)" + - "Tests (7.4, lowest, ~5.0)" + - "Tests (7.4, highest, ~4.4)" + - "Tests (7.4, highest, ~5.0)" + - "Code Coverage (7.4)" + - "Mutation Tests (7.4)" + - "Mutation Tests (7.4)" + - "Lint / DOCtor-RST" + strict: true + + required_pull_request_reviews: null + restrictions: null diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000..815b2ebb --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,223 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +on: + pull_request: + push: + branches: + - master + tags: + - "**" + +name: "Continuous Integration" + +jobs: + coding-standards: + name: "Coding Standards" + + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - 7.4 + + steps: + - name: "Checkout" + uses: actions/checkout@v1 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v1 + with: + coverage: none + extensions: "mbstring, json, mongo" + php-version: ${{ matrix.php-version }} + + - name: "Validate composer.json and composer.lock" + run: composer validate --strict + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: php${{ matrix.php-version }}-composer- + restore-keys: | + php${{ matrix.php-version }}-composer- + + - name: "Install locked dependencies with composer" + run: composer install --no-interaction --no-progress --no-suggest + + - name: "Run localheinz/composer-normalize" + run: composer normalize --dry-run + + - name: "Create cache directory for friendsofphp/php-cs-fixer" + run: mkdir -p .build/php-cs-fixer + + - name: "Cache cache directory for friendsofphp/php-cs-fixer" + uses: actions/cache@v1 + with: + path: .build/php-cs-fixer + key: php${{ matrix.php-version }}-php-cs-fixer- + restore-keys: | + php${{ matrix.php-version }}-php-cs-fixer- + + - name: "Run friendsofphp/php-cs-fixer" + run: vendor/bin/php-cs-fixer fix --diff --diff-format=udiff --dry-run --verbose + + static-code-analysis: + name: "Static Code Analysis" + + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - 7.4 + + steps: + - name: "Checkout" + uses: actions/checkout@v1 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v1 + with: + coverage: none + extensions: "mbstring, json, mongo" + php-version: ${{ matrix.php-version }} + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: ${{ matrix.php-version }}-composer- + restore-keys: | + ${{ matrix.php-version }}-composer- + + - name: "Install locked dependencies with composer" + run: composer install --no-interaction --no-progress --no-suggest + + - name: "Run phpstan/phpstan" + run: vendor/bin/phpstan analyse + + tests: + name: "Tests" + + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - 7.3 + - 7.4 + + dependencies: + - lowest + - highest + + symfony: + - ~4.4 + - ~5.0 + + steps: + - name: "Checkout" + uses: actions/checkout@v1 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v1 + with: + coverage: none + extensions: "mbstring, json, mongo" + php-version: ${{ matrix.php-version }} + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: php${{ matrix.php-version }}-composer- + restore-keys: | + php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- + + - name: "Lock symfony version" + run: composer require "symfony/symfony:${{ matrix.symfony }}" --no-update + + - name: "Install lowest dependencies with composer" + if: matrix.dependencies == 'lowest' + run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest + + - name: "Install highest dependencies with composer" + if: matrix.dependencies == 'highest' + run: composer update --no-interaction --no-progress --no-suggest + + - name: "Run tests with phpunit/phpunit" + run: vendor/bin/phpunit + + code-coverage: + name: "Code Coverage" + + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - 7.4 + + steps: + - name: "Checkout" + uses: actions/checkout@v1 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v1 + with: + coverage: pcov + extensions: "mbstring, json, mongo" + php-version: ${{ matrix.php-version }} + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: php${{ matrix.php-version }}-composer- + restore-keys: | + php${{ matrix.php-version }}-composer- + + - name: "Install locked dependencies with composer" + run: composer install --no-interaction --no-progress --no-suggest + + - name: "Collect code coverage with pcov and phpunit/phpunit" + run: vendor/bin/phpunit --coverage-clover=build/logs/clover.xml + + - name: "Send code coverage report to Codecov.io" + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: bash <(curl -s https://codecov.io/bash) + + mutation-tests: + name: "Mutation Tests" + runs-on: ubuntu-latest + strategy: + matrix: + php-version: + - 7.4 + steps: + - name: "Checkout" + uses: actions/checkout@v1 + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v1 + with: + coverage: pcov + extensions: "mbstring" + php-version: ${{ matrix.php-version }} + + - name: "Cache dependencies installed with composer" + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: php${{ matrix.php-version }}-composer- + restore-keys: | + php${{ matrix.php-version }}-composer- + + - name: "Install locked dependencies with composer" + run: composer install --no-interaction --no-progress --no-suggest + + - name: "Run mutation tests with pcov and infection/infection" + run: vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=55 --min-msi=19 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..5caea8c4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +on: [push, pull_request] + +name: Lint + +jobs: + doctor-rst: + name: DOCtor-RST + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: DOCtor-RST + uses: docker://oskarstark/doctor-rst + with: + args: --short + env: + DOCS_DIR: 'docs/' diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..168748a6 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,14 @@ +name: Release Drafter + +on: + push: + branches: + - master + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: toolmantim/release-drafter@v5.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..cca0ab17 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +.php_cs.cache +.phpunit.result.cache +coverage +composer.lock +phpunit.xml +/build +/vendor +/vendor-bin/*/vendor +!/vendor-bin/*/composer.json diff --git a/.kodiak.toml b/.kodiak.toml new file mode 100644 index 00000000..b0f46b13 --- /dev/null +++ b/.kodiak.toml @@ -0,0 +1,10 @@ +version = 1 + +[merge] +method = "merge" +automerge_label = "automerge" +block_on_reviews_requested = true + +[merge.message] +title = "pull_request_title" +body = "pull_request_body" diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100755 index 00000000..4c865225 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,54 @@ + + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; + +$finder = PhpCsFixer\Finder::create() + ->in([ __DIR__.'/src', __DIR__.'/tests']) +; + +$config = PhpCsFixer\Config::create() + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + '@Symfony:risky' => true, + '@PhpCsFixer' => true, + '@PhpCsFixer:risky' => true, + '@PHP70Migration' => true, + '@PHPUnit60Migration:risky' => true, + 'header_comment' => [ + 'header' => $header, + ], + 'list_syntax' => [ + 'syntax' => 'short', + ], + 'binary_operator_spaces' => [ + 'default' => 'align', + ], + 'method_chaining_indentation' => false, + 'phpdoc_types_order' => [ + 'null_adjustment' => 'always_last', + ], + 'php_unit_internal_class' => false, + 'php_unit_test_class_requires_covers' => false, + 'no_superfluous_phpdoc_tags' => [ + 'allow_mixed' => true, + 'remove_inheritdoc' => true, + ], + 'static_lambda' => true, + 'global_namespace_import' => [ + 'import_classes' => true, + 'import_constants' => false, + 'import_functions' => false, + ], + ]) + ->setFinder($finder) +; + +return $config; diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 00000000..2d7dda51 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019 Christian Gripp + +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. diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..35d55936 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +.PHONY: all lint cs checkdeps phpstan test + +all: lint cs test phpstan + +lint: + find ./src \( -name '*.yml' -or -name '*.yaml' \) -not -path '*/vendor/*' | xargs yaml-lint + find . \( -name '*.xml' -or -name '*.xml.dist' -or -name '*.xlf' \) -not -path '*/vendor/*' -not -path './vendor-bin/*' -not -path '*/node_modules/*' -not -path '*/.*' -type f -exec xmllint --encode UTF-8 --output '{}' --format '{}' \; + +cs: vendor + export PHP_CS_FIXER_IGNORE_ENV=1 && php vendor/bin/php-cs-fixer fix --verbose + +checkdeps: vendor + vendor/bin/composer-require-checker check --config-file composer-require.json composer.json + +phpstan: vendor + vendor/bin/phpstan analyse + +test: vendor + vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml + +vendor: composer.json composer.lock + composer validate --strict + composer install + composer normalize diff --git a/README.md b/README.md new file mode 100644 index 00000000..732ef5b3 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +NucleosUserAdminBundle +==================== + +[![Latest Stable Version](https://poser.pugx.org/nucleos/user-admin-bundle/v/stable)](https://packagist.org/packages/nucleos/user-admin-bundle) +[![Latest Unstable Version](https://poser.pugx.org/nucleos/user-admin-bundle/v/unstable)](https://packagist.org/packages/nucleos/user-admin-bundle) +[![License](https://poser.pugx.org/nucleos/user-admin-bundle/license)](LICENSE.md) + +[![Total Downloads](https://poser.pugx.org/nucleos/user-admin-bundle/downloads)](https://packagist.org/packages/nucleos/user-admin-bundle) +[![Monthly Downloads](https://poser.pugx.org/nucleos/user-admin-bundle/d/monthly)](https://packagist.org/packages/nucleos/user-admin-bundle) +[![Daily Downloads](https://poser.pugx.org/nucleos/user-admin-bundle/d/daily)](https://packagist.org/packages/nucleos/user-admin-bundle) + +[![Continuous Integration](https://github.com/nucleos/NucleosUserAdminBundle/workflows/Continuous%20Integration/badge.svg)](https://github.com/nucleos/NucleosUserAdminBundle/actions) +[![Code Coverage](https://codecov.io/gh/nucleos/NucleosUserAdminBundle/branch/master/graph/badge.svg)](https://codecov.io/gh/nucleos/NucleosUserAdminBundle) + +The NucleosUserAdminBundle is an user admin backend for [SonataAdminBundle](https://github.com/sonata-project/SonataAdminBundle). + +Documentation +------------- + +The source of the documentation is stored in the `docs/` folder +in this bundle. + +[Read the Documentation](https://docs.nucleos.rocks/projects/user-admin-bundle) + +Installation +------------ + +All the installation instructions are located in the documentation. diff --git a/composer-require.json b/composer-require.json new file mode 100644 index 00000000..470ddaf8 --- /dev/null +++ b/composer-require.json @@ -0,0 +1,25 @@ +{ + "symbol-whitelist": [ + "null", + "true", + "false", + "static", + "self", + "parent", + "array", + "string", + "int", + "float", + "bool", + "iterable", + "callable", + "void", + "object", + "Doctrine\\Bundle\\DoctrineBundle\\DependencyInjection\\Compiler\\DoctrineOrmMappingsPass", + "Doctrine\\Bundle\\MongoDBBundle\\DependencyInjection\\Compiler\\DoctrineMongoDBMappingsPass", + "Doctrine\\ODM\\MongoDB\\DocumentManager", + "Doctrine\\ODM\\MongoDB\\Mapping\\ClassMetadata", + "Doctrine\\ORM\\EntityManager", + "Doctrine\\ORM\\Mapping\\ClassMetadata" + ] +} diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..02949de9 --- /dev/null +++ b/composer.json @@ -0,0 +1,83 @@ +{ + "name": "nucleos/user-admin-bundle", + "type": "symfony-bundle", + "description": "Adminstration of users and groups in symfony", + "keywords": [ + "user", + "sonata", + "admin", + "user management", + "symfony" + ], + "homepage": "https://nucleos.rocks", + "license": "MIT", + "authors": [ + { + "name": "Christian Gripp", + "email": "mail@core23.de" + } + ], + "require": { + "php": "^7.3", + "nucleos/user-bundle": "^1.0", + "sonata-project/admin-bundle": "^3.34", + "sonata-project/core-bundle": "^3.12", + "sonata-project/datagrid-bundle": "^2.2.1", + "sonata-project/doctrine-extensions": "^1.5.1", + "sonata-project/easy-extends-bundle": "^2.2", + "symfony/config": "^3.4 || ^4.2", + "symfony/console": "^3.4 || ^4.2", + "symfony/dependency-injection": "^3.4 || ^4.2", + "symfony/form": "^3.4 || ^4.2", + "symfony/framework-bundle": "^3.4 || ^4.2", + "symfony/http-foundation": "^3.4 || ^4.2", + "symfony/http-kernel": "^3.4 || ^4.2", + "symfony/options-resolver": "^3.4 || ^4.2", + "symfony/security-acl": "^2.8 || ^3.0", + "symfony/security-core": "^3.4 || ^4.2", + "symfony/translation": "^3.4 || ^4.2", + "twig/twig": "^2.9" + }, + "conflict": { + "friendsofsymfony/rest-bundle": "<2.1 || >=3.0", + "jms/serializer": "<1.3 || >=4.0", + "nelmio/api-doc-bundle": "<2.4", + "sonata-project/doctrine-orm-admin-bundle": "<3.0", + "sonata-project/google-authenticator": "<1.0" + }, + "require-dev": { + "doctrine/orm": "^2.0", + "friendsofsymfony/rest-bundle": "^2.1", + "jms/serializer-bundle": "^1.0 || ^2.0 || ^3.0", + "matthiasnoback/symfony-config-test": "^4.0", + "matthiasnoback/symfony-dependency-injection-test": "^3.0", + "nelmio/api-doc-bundle": "^2.4", + "sonata-project/google-authenticator": "^1.0 || ^2.0", + "symfony/phpunit-bridge": "^4.3" + }, + "suggest": { + "friendsofsymfony/rest-bundle": "For using the public API methods.", + "jms/serializer": "For using the public API methods.", + "nelmio/api-doc-bundle": "For using the public API methods.", + "sonata-project/doctrine-orm-admin-bundle": "^3.0", + "sonata-project/google-authenticator": "For google auth user login" + }, + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "Sonata\\UserBundle\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Sonata\\UserBundle\\Tests\\": "tests/" + } + } +} diff --git a/docs/.doctor-rst.yaml b/docs/.doctor-rst.yaml new file mode 100644 index 00000000..e60b074d --- /dev/null +++ b/docs/.doctor-rst.yaml @@ -0,0 +1,43 @@ +rules: + no_inheritdoc: ~ + avoid_repetetive_words: ~ + blank_line_after_directive: ~ + short_array_syntax: ~ + no_app_console: ~ + typo: ~ + replacement: ~ + composer_dev_option_not_at_the_end: ~ + yarn_dev_option_at_the_end: ~ + versionadded_directive_should_have_version: ~ + deprecated_directive_should_have_version: ~ + no_composer_req: ~ + no_php_open_tag_in_code_block_php_directive: ~ + no_blank_line_after_filepath_in_php_code_block: ~ + no_blank_line_after_filepath_in_yaml_code_block: ~ + no_blank_line_after_filepath_in_xml_code_block: ~ + no_blank_line_after_filepath_in_twig_code_block: ~ + php_prefix_before_bin_console: ~ + use_deprecated_directive_instead_of_versionadded: ~ + no_space_before_self_xml_closing_tag: ~ + no_explicit_use_of_code_block_php: ~ + ensure_order_of_code_blocks_in_configuration_block: ~ + american_english: ~ + valid_use_statements: ~ + lowercase_as_in_use_statements: ~ + ordered_use_statements: ~ + no_namespace_after_use_statements: ~ + correct_code_block_directive_based_on_the_content: ~ + max_blank_lines: + max: 2 + replace_code_block_types: ~ + use_https_xsd_urls: ~ + blank_line_before_directive: ~ + extension_xlf_instead_of_xliff: ~ + valid_inline_highlighted_namespaces: ~ + indention: ~ + unused_links: ~ + yaml_instead_of_yml_suffix: ~ + extend_abstract_controller: ~ + +# do not report as violation +whitelist: diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 00000000..c7418817 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-slate \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 00000000..ab971545 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,2 @@ +NucleosUserAdminBundle +====================== diff --git a/infection.json b/infection.json new file mode 100644 index 00000000..418c43a3 --- /dev/null +++ b/infection.json @@ -0,0 +1,11 @@ +{ + "timeout": 10, + "source": { + "directories": [ + "src" + ] + }, + "logs": { + "text": "build/infection/infection-log.txt" + } +} diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000..47ca4df8 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,27 @@ +parameters: + ignoreErrors: + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#" + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: "#^Parameter \\#1 \\$node of method Nucleos\\\\ProfileBundle\\\\DependencyInjection\\\\Configuration\\:\\:addRegistrationSection\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition, Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition given\\.$#" + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: "#^Parameter \\#1 \\$node of method Nucleos\\\\ProfileBundle\\\\DependencyInjection\\\\Configuration\\:\\:addProfileSection\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition, Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition given\\.$#" + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: "#^Parameter \\#1 \\$node of method Nucleos\\\\ProfileBundle\\\\DependencyInjection\\\\Configuration\\:\\:addServiceSection\\(\\) expects Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\ArrayNodeDefinition, Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition given\\.$#" + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: "#^Cannot call method end\\(\\) on Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\|null\\.$#" + count: 3 + path: src/DependencyInjection/Configuration.php + diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 00000000..03fdc48a --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,15 @@ +includes: + - phpstan-baseline.neon + +parameters: + level: max + + paths: + - src + - tests + + autoload_files: + - vendor-bin/test/vendor/autoload.php + + excludes_analyse: + - tests/bootstrap.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 00000000..008d51bd --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,19 @@ + + + + + + + + ./tests/ + + + + + + + + ./src/ + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 00000000..023a742a --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!($loader = @include __DIR__.'/../vendor/autoload.php')) { + echo <<<'EOT' +You need to install the project dependencies using Composer: +$ wget http://getcomposer.org/composer.phar +OR +$ curl -s https://getcomposer.org/installer | php +$ php composer.phar install --dev +$ phpunit +EOT; + exit(1); +} diff --git a/vendor-bin/checker/composer.json b/vendor-bin/checker/composer.json new file mode 100644 index 00000000..62469e03 --- /dev/null +++ b/vendor-bin/checker/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "maglnet/composer-require-checker": "^2.0" + } +} diff --git a/vendor-bin/csfixer/composer.json b/vendor-bin/csfixer/composer.json new file mode 100644 index 00000000..39df0ad1 --- /dev/null +++ b/vendor-bin/csfixer/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "friendsofphp/php-cs-fixer": "^2.13" + }, + "config": { + "platform":{ + "php": "7.2" + } + } +} diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json new file mode 100644 index 00000000..556354dd --- /dev/null +++ b/vendor-bin/phpstan/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "jangregor/phpstan-prophecy": "^0.5", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpstan/phpstan-symfony": "^0.12" + } +} diff --git a/vendor-bin/test/composer.json b/vendor-bin/test/composer.json new file mode 100644 index 00000000..d379d30b --- /dev/null +++ b/vendor-bin/test/composer.json @@ -0,0 +1,8 @@ +{ + "require": { + "infection/infection": "^0.15", + "matthiasnoback/symfony-dependency-injection-test": "^4.0", + "phpunit/phpunit": "^8.2", + "symfony/phpunit-bridge": "^4.1" + } +}