From 85c7170319c9946be1283ea161f8d870928ca526 Mon Sep 17 00:00:00 2001 From: sergiy-petrov Date: Fri, 21 Feb 2020 00:51:45 +0200 Subject: [PATCH 1/4] add php 7.4 (#58) --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index ce6530a..35b7620 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,10 @@ matrix: env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest' - php: 7.3 env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable' + - php: 7.4 + env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest' + - php: 7.4 + env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable' fast_finish: true before_script: From d8de2eb54bf2e004680b9ab6425203a86c929e79 Mon Sep 17 00:00:00 2001 From: freek Date: Tue, 3 Mar 2020 13:21:16 +0100 Subject: [PATCH 2/4] wip --- .github/FUNDING.yml | 1 + .github/workflows/run-tests.yml | 48 +++++++++++++++++++++++++++++++++ .travis.yml | 43 ----------------------------- README.md | 23 +++++----------- composer.json | 10 ++++--- 5 files changed, 62 insertions(+), 63 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/run-tests.yml delete mode 100644 .travis.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..636ef53 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +custom: https://spatie.be/open-source/support-us diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..0d17e6f --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,48 @@ +name: run-tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, windows-latest] + php: [7.4] + laravel: [5.8.*, 6.*, 7.*] + dependency-version: [prefer-lowest, prefer-stable] + include: + - laravel: 7.* + testbench: 5.* + - laravel: 6.* + testbench: 4.* + - laravel: 5.8.* + testbench: 3.8.* + + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v1 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + + - name: Install dependencies + run: | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update + composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest + + - name: Execute tests + run: vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 35b7620..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -cache: - directories: - - $HOME/.composer/cache - -language: php - -env: - global: - - COVERAGE=0 - -matrix: - include: - - php: 7.2 - env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-lowest' - - php: 7.2 - env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-stable' - - php: 7.3 - env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-lowest' - - php: 7.3 - env: LARAVEL='5.8.*' TESTBENCH='3.8.*' COMPOSER_FLAGS='--prefer-stable' - - php: 7.2 - env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest' - - php: 7.2 - env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable' - - php: 7.3 - env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest' - - php: 7.3 - env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable' - - php: 7.4 - env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest' - - php: 7.4 - env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable' - fast_finish: true - -before_script: - - composer config discard-changes true - -before_install: - - travis_retry composer self-update - - travis_retry composer require "laravel/framework:${LARAVEL}" "orchestra/testbench:${TESTBENCH}" --no-interaction --no-update - -install: - - travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest diff --git a/README.md b/README.md index 81681dc..3a61483 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version on Packagist](https://img.shields.io/packagist/v/spatie/laravel-missing-page-redirector.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-missing-page-redirector) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) -[![Build Status](https://img.shields.io/travis/spatie/laravel-missing-page-redirector/master.svg?style=flat-square)](https://travis-ci.org/spatie/laravel-missing-page-redirector) +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/spatie/laravel-missing-page-redirector/run-tests?label=tests) [![Quality Score](https://img.shields.io/scrutinizer/g/spatie/laravel-missing-page-redirector.svg?style=flat-square)](https://scrutinizer-ci.com/g/spatie/laravel-missing-page-redirector) [![StyleCI](https://styleci.io/repos/70787365/shield?branch=master)](https://styleci.io/repos/70787365) [![Total Downloads](https://img.shields.io/packagist/dt/spatie/laravel-missing-page-redirector.svg?style=flat-square)](https://packagist.org/packages/spatie/laravel-missing-page-redirector) @@ -11,6 +11,12 @@ When transitioning from a old site to a new one your URLs may change. If your ol When installed you only need to [add your redirects to the config file](https://github.com/spatie/laravel-missing-page-redirector#usage). Want to use the database as your source of redirects? [No problem](https://github.com/spatie/laravel-missing-page-redirector#creating-your-own-redirector)! +## Support us + +We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). + +We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards). + ## Installation You can install the package via composer: @@ -154,26 +160,11 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details. If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker. -## Postcardware - -You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. - -Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium. - -We publish all received postcards [on our company website](https://spatie.be/en/opensource/postcards). - ## Credits - [Freek Van der Herten](https://github.com/freekmurze) - [All Contributors](../../contributors) -## Support us - -Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects [on our website](https://spatie.be/opensource). - -Does your business depend on our contributions? Reach out and support us on [Patreon](https://www.patreon.com/spatie). -All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff. - ## License The MIT License (MIT). Please see [License File](LICENSE.md) for more information. diff --git a/composer.json b/composer.json index 191bc51..19e1065 100644 --- a/composer.json +++ b/composer.json @@ -17,12 +17,12 @@ ], "require": { "php": "^7.2", - "laravel/framework": "~5.8.0|^6.0", + "laravel/framework": "~5.8.0|^6.0|^7.0", "spatie/url": "^1.0" }, "require-dev": { - "orchestra/testbench": "~3.8.0|^4.0", - "phpunit/phpunit": "^8.0" + "orchestra/testbench": "~3.8.0|^4.0|^5.0", + "phpunit/phpunit": "^8.0|^9.0" }, "autoload": { "psr-4": { @@ -46,5 +46,7 @@ "Spatie\\MissingPageRedirector\\MissingPageRedirectorServiceProvider" ] } - } + }, + "minimum-stability": "dev", + "prefer-stable": true } From e3973e1e437487bbb515f3956f28b3eab47201e0 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Tue, 3 Mar 2020 13:22:11 +0100 Subject: [PATCH 3/4] Apply fixes from StyleCI (#60) --- config/missing-page-redirector.php | 4 ++-- src/MissingPageRouter.php | 6 +++--- tests/RedirectsMissingPagesTest.php | 4 ++-- tests/TestCase.php | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/missing-page-redirector.php b/config/missing-page-redirector.php index c28a198..ffe4a34 100644 --- a/config/missing-page-redirector.php +++ b/config/missing-page-redirector.php @@ -22,8 +22,8 @@ * You can use Laravel's route parameters here. */ 'redirects' => [ -// '/non-existing-page' => '/existing-page', -// '/old-blog/{url}' => '/new-blog/{url}', + // '/non-existing-page' => '/existing-page', + // '/old-blog/{url}' => '/new-blog/{url}', ], ]; diff --git a/src/MissingPageRouter.php b/src/MissingPageRouter.php index 6b91fd1..1ab48a8 100644 --- a/src/MissingPageRouter.php +++ b/src/MissingPageRouter.php @@ -4,11 +4,11 @@ use Exception; use Illuminate\Routing\Router; -use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; +use Spatie\MissingPageRedirector\Events\RedirectNotFound; use Spatie\MissingPageRedirector\Events\RouteWasHit; use Spatie\MissingPageRedirector\Redirector\Redirector; -use Spatie\MissingPageRedirector\Events\RedirectNotFound; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; class MissingPageRouter { diff --git a/tests/RedirectsMissingPagesTest.php b/tests/RedirectsMissingPagesTest.php index fab0e32..309269b 100644 --- a/tests/RedirectsMissingPagesTest.php +++ b/tests/RedirectsMissingPagesTest.php @@ -3,9 +3,9 @@ namespace Spatie\MissingPageRedirector\Test; use Illuminate\Support\Facades\Event; -use Symfony\Component\HttpFoundation\Response; -use Spatie\MissingPageRedirector\Events\RouteWasHit; use Spatie\MissingPageRedirector\Events\RedirectNotFound; +use Spatie\MissingPageRedirector\Events\RouteWasHit; +use Symfony\Component\HttpFoundation\Response; class RedirectsMissingPagesTest extends TestCase { diff --git a/tests/TestCase.php b/tests/TestCase.php index b1ae25b..10144b8 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -2,12 +2,12 @@ namespace Spatie\MissingPageRedirector\Test; -use Route; use Illuminate\Contracts\Http\Kernel; -use PHPUnit\Framework\Assert as PHPUnit; use Orchestra\Testbench\TestCase as Orchestra; -use Spatie\MissingPageRedirector\RedirectsMissingPages; +use PHPUnit\Framework\Assert as PHPUnit; +use Route; use Spatie\MissingPageRedirector\MissingPageRedirectorServiceProvider; +use Spatie\MissingPageRedirector\RedirectsMissingPages; abstract class TestCase extends Orchestra { From a5b6952d6bc25427f383319bc95426427602140c Mon Sep 17 00:00:00 2001 From: Adriaan Marain Date: Wed, 27 May 2020 15:14:26 +0200 Subject: [PATCH 4/4] Update README with new "Support us" section --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a61483..63bb10f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,11 @@ When installed you only need to [add your redirects to the config file](https:// ## Support us -We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). +Learn how to create a package like this one, by watching our premium video course: + +[![Laravel Package training](https://spatie.be/github/package-training.jpg)](https://laravelpackage.training) + +We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us). We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).