diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index db24720..0000000 --- a/.codecov.yml +++ /dev/null @@ -1 +0,0 @@ -comment: off diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 11fab34..4d195e6 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -18,7 +18,6 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv coverage: xdebug @@ -31,9 +30,9 @@ jobs: - name: Execute tests run: | mkdir -p build/logs - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover + sudo vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - name: Export run: | wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover coverage.clover + sudo php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index e98f376..bd1a31c 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -2,263 +2,16 @@ name: phpunit on: [ push ] jobs: - laravel_54: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "7.2", "7.3", "7.4" ] - laravel: [ "5.4.*" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] - - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - - - name: Composer self update - run: composer self-update - - - name: Install dependencies - run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} phpunit/phpunit:~5.7 - composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit - - laravel_55: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "7.2", "7.3", "7.4" ] - laravel: [ "5.5.*" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] - - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - - - name: Composer self update - run: composer self-update - - - name: Install dependencies - run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} phpunit/phpunit:~6.0 - composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit - - laravel_56: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "7.2", "7.3", "7.4" ] - laravel: [ "5.6.*" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] - - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - - - name: Composer self update - run: composer self-update - - - name: Install dependencies - run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} phpunit/phpunit:~7.0 - composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit - - laravel_57: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "7.2", "7.3", "7.4" ] - laravel: [ "5.7.*" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] - - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - - - name: Composer self update - run: composer self-update - - - name: Install dependencies - run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} phpunit/phpunit:~7.0 - composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit - - laravel_58: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "7.2", "7.3", "7.4" ] - laravel: [ "5.8.*" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] - - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - - - name: Composer self update - run: composer self-update - - - name: Install dependencies - run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} phpunit/phpunit:^8.0 - composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit - - laravel_6x: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "7.2", "7.3", "7.4", "8.0" ] - laravel: [ "^6.0" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] - - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - - - name: Composer self update - run: composer self-update - - - name: Install dependencies - run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} phpunit/phpunit:^8.3 - composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit - - laravel_7x: - runs-on: ubuntu-latest - - strategy: - fail-fast: true - matrix: - php: [ "7.2", "7.3", "7.4", "8.0" ] - laravel: [ "^7.0" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] - - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv - coverage: none - - - name: Composer self update - run: composer self-update - - - name: Install dependencies - run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} - composer update --prefer-stable --prefer-dist --no-progress --no-interaction - - - name: Execute tests - run: vendor/bin/phpunit - - laravel_8x: + phpunit: runs-on: ubuntu-latest strategy: fail-fast: true matrix: php: [ "7.3", "7.4", "8.0" ] - laravel: [ "^8.0" ] - support: [ "4.0" ] - laravel_support: [ "1.3", "2.0" ] + laravel: [ "6.0", "7.0", "8.0" ] - name: Laravel ${{ matrix.laravel }}, PHP ${{ matrix.php }}, Support ${{ matrix.support }}, Laravel Support ${{ matrix.laravel_support }} + name: PHP ${{ matrix.php }}, Laravel ${{ matrix.laravel }} steps: - name: Checkout code @@ -271,13 +24,10 @@ jobs: extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv coverage: none - - name: Composer self update - run: composer self-update - - name: Install dependencies run: | - composer require laravel/framework:${{ matrix.laravel }} andrey-helldar/support:^${{ matrix.support }} andrey-helldar/laravel-support:^${{ matrix.laravel_support }} + composer require laravel/framework:^${{ matrix.laravel }} composer update --prefer-stable --prefer-dist --no-progress --no-interaction - name: Execute tests - run: vendor/bin/phpunit + run: sudo vendor/bin/phpunit diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index eb1f167..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,37 +0,0 @@ -filter: - excluded_paths: - - tests/* - - vendor/* - -checks: - php: - code_rating: true - duplication: true - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true - -tools: - external_code_coverage: - timeout: 300 - php_code_sniffer: - enabled: true - config: - standard: PSR12 - filter: - paths: - - src - php_loc: - enabled: true - php_cpd: - enabled: true diff --git a/README.md b/README.md index ae4c7d1..b36a776 100644 --- a/README.md +++ b/README.md @@ -4,56 +4,38 @@ The core of applications for working with routes: -* [laravel-routes-core](https://github.com/andrey-helldar/laravel-routes-core) -* [laravel-swagger](https://github.com/andrey-helldar/laravel-swagger) - -[![StyleCI Status][badge_styleci]][link_styleci] -[![Github Workflow Status][badge_build]][link_build] -[![Coverage Status][badge_coverage]][link_scrutinizer] -[![Scrutinizer Code Quality][badge_quality]][link_scrutinizer] -[![For Laravel][badge_laravel]][link_packagist] +* [dragon-code/laravel-pretty-routes](https://github.com/TheDragonCode/pretty-routes) +* [dragon-code/laravel-swagger](https://github.com/TheDragonCode/laravel-swagger) [![Stable Version][badge_stable]][link_packagist] [![Unstable Version][badge_unstable]][link_packagist] [![Total Downloads][badge_downloads]][link_packagist] +[![Github Workflow Status][badge_build]][link_build] [![License][badge_license]][link_license] -## License - -This package is licensed under the [MIT License](LICENSE). - - -## For Enterprise +## Upgrade from `andrey-helldar/laravel-routes-core` -Available as part of the Tidelift Subscription. +1. Replace `"andrey-helldar/laravel-routes-core": "^3.0"` with `"dragon-code/laravel-routes-core": "^4.0"` in the `composer.json` file; +2. Replace `Helldar\LaravelRoutesCore` with `DragonCode\LaravelRoutesCore`; +3. Run the `composer update` console command. -The maintainers of `andrey-helldar/laravel-routes-core` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more](https://tidelift.com/subscription/pkg/packagist-andrey-helldar-laravel-routes-core?utm_source=packagist-andrey-helldar-laravel-routes-core&utm_medium=referral&utm_campaign=enterprise&utm_term=repo). - - -[badge_build]: https://img.shields.io/github/workflow/status/andrey-helldar/laravel-routes-core/phpunit?style=flat-square - -[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/andrey-helldar/laravel-routes-core.svg?style=flat-square +## License -[badge_downloads]: https://img.shields.io/packagist/dt/andrey-helldar/laravel-routes-core.svg?style=flat-square +This package is licensed under the [MIT License](LICENSE). -[badge_laravel]: https://img.shields.io/badge/Laravel-5.x%20%7C%206.x%20%7C%207.x%20%7C%208.x-orange.svg?style=flat-square -[badge_license]: https://img.shields.io/packagist/l/andrey-helldar/laravel-routes-core.svg?style=flat-square +[badge_build]: https://img.shields.io/github/workflow/status/dragon-code/laravel-routes-core/phpunit?style=flat-square -[badge_quality]: https://img.shields.io/scrutinizer/g/andrey-helldar/laravel-routes-core.svg?style=flat-square +[badge_downloads]: https://img.shields.io/packagist/dt/dragon-code/laravel-routes-core.svg?style=flat-square -[badge_stable]: https://img.shields.io/github/v/release/andrey-helldar/laravel-routes-core?label=stable&style=flat-square +[badge_license]: https://img.shields.io/packagist/l/dragon-code/laravel-routes-core.svg?style=flat-square -[badge_styleci]: https://styleci.io/repos/310315732/shield +[badge_stable]: https://img.shields.io/github/v/release/dragon-code/laravel-routes-core?label=stable&style=flat-square [badge_unstable]: https://img.shields.io/badge/unstable-dev--master-orange?style=flat-square -[link_build]: https://github.com/andrey-helldar/laravel-routes-core/actions +[link_build]: https://github.com/dragon-code/laravel-routes-core/actions [link_license]: LICENSE -[link_packagist]: https://packagist.org/packages/andrey-helldar/laravel-routes-core - -[link_scrutinizer]: https://scrutinizer-ci.com/g/andrey-helldar/laravel-routes-core - -[link_styleci]: https://github.styleci.io/repos/310315732 +[link_packagist]: https://packagist.org/packages/dragon-code/laravel-routes-core diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 7ad007f..0000000 --- a/SECURITY.md +++ /dev/null @@ -1,5 +0,0 @@ -# Security Policy - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). - -Tidelift will coordinate the fix and disclosure. diff --git a/composer.json b/composer.json index 6861ef5..4074db3 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "andrey-helldar/laravel-routes-core", + "name": "dragon-code/laravel-routes-core", "description": "The core of applications for working with routes", "keywords": ["laravel", "routes", "pretty"], "type": "library", @@ -11,25 +11,29 @@ } ], "support": { - "issues": "https://github.com/andrey-helldar/laravel-routes-core/issues", - "source": "https://github.com/andrey-helldar/laravel-routes-core" + "issues": "https://github.com/TheDragonCode/laravel-routes-core/issues", + "source": "https://github.com/TheDragonCode/laravel-routes-core" }, "require": { - "php": "^7.2.5|^8.0", - "andrey-helldar/laravel-support": "^1.3.2|^2.0", - "andrey-helldar/support": "^4.0", - "illuminate/routing": "^5.0|^6.0|^7.0|^8.0", - "illuminate/support": "^5.0|^6.0|^7.0|^8.0", + "php": "^7.3|^8.0", + "dragon-code/contracts": "^2.4", + "dragon-code/laravel-support": "^3.0", + "dragon-code/support": "^5.0", + "illuminate/routing": "^6.0|^7.0|^8.0", + "illuminate/support": "^6.0|^7.0|^8.0", "phpdocumentor/reflection-docblock": "^5.0" }, "require-dev": { - "mockery/mockery": "^0.9|^1.0", - "orchestra/testbench": "^3.4|^4.0|^5.0|^6.0", - "phpunit/phpunit": "^5.7|^6.0|^7.0|^8.0|^9.0" + "mockery/mockery": "^1.0", + "orchestra/testbench": "^4.0|^5.0|^6.0", + "phpunit/phpunit": "^8.0|^9.0" + }, + "conflict": { + "andrey-helldar/laravel-routes-core": "*" }, "autoload": { "psr-4": { - "Helldar\\LaravelRoutesCore\\": "src" + "DragonCode\\LaravelRoutesCore\\": "src" } }, "autoload-dev": { @@ -42,34 +46,5 @@ "sort-packages": true }, "minimum-stability": "stable", - "prefer-stable": true, - "extra": { - "laravel": { - "providers": [ - "Helldar\\LaravelRoutesCore\\ServiceProvider" - ] - }, - "thanks": [ - { - "name": "andrey-helldar/support", - "url": "https://github.com/andrey-helldar/support" - }, - { - "name": "andrey-helldar/laravel-support", - "url": "https://github.com/andrey-helldar/laravel-support" - }, - { - "name": "illuminate/routing", - "url": "https://github.com/illuminate/routing" - }, - { - "name": "illuminate/support", - "url": "https://github.com/illuminate/support" - }, - { - "name": "phpdocumentor/reflection-docblock", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock" - } - ] - } + "prefer-stable": true } diff --git a/src/Contracts/Config.php b/src/Contracts/Config.php deleted file mode 100644 index 632bbc3..0000000 --- a/src/Contracts/Config.php +++ /dev/null @@ -1,20 +0,0 @@ -registerStrBefore(); - $this->registerStrAfter(); - } - - protected function registerStrBefore(): void - { - if (! method_exists(Str::class, 'before')) { - Str::macro('before', static function ($subject, $search) { - if ($search === '') { - return $subject; - } - - $result = strstr($subject, (string) $search, true); - - return $result === false ? $subject : $result; - }); - } - } - - protected function registerStrAfter() - { - if (! method_exists(Str::class, 'after')) { - Str::macro('after', static function ($subject, $search) { - return $search === '' ? $subject : array_reverse(explode($search, $subject, 2))[0]; - }); - } - } -} diff --git a/src/Support/Annotation.php b/src/Support/Annotation.php index f26787f..1b2d815 100644 --- a/src/Support/Annotation.php +++ b/src/Support/Annotation.php @@ -1,16 +1,16 @@