Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Laravel 6.x and PHP 7.2/7.3 #16

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jason-klein
Copy link

This health-check library depends on the phpsafari/typed-collections (https://github.com/OveD-php/typed-collections) library. I have updated both libraries to support Laravel 6.x and I am submitting PR for both libraries.

Both PRs should be tagged/released at the same time, since this PR expect the phpsafari/typed-collections library namespace to change from "Phpsafari" to "PhpSafari".

Both of my PRs drop support for Laravel 5.x due to dependency incompatibilities. My suggestion is to align the versioning of both of these Laravel libraries with Laravel versioning so that the existing versions (0.0.7 and 2.0.2) remain available as-is (or as 5.0.0?) to Laravel 5.x users and the new versions become available as 6.0.0 for Laravel 6.x users.

This library PR is currently forced to use my patched 6.0.0 version of phpsafari/typed-collections. After you upgrade the phpsafari/typed-collections library to Laravel 6.x, be sure to remove the "repositories" section from composer.json in this library.

Here is my PR for phpsafari/typed-collections with Laravel 6.x upgrades: OveD-php/typed-collections#3

If you would like to test my updates with Laravel 6.x before accepting this PR and before publishing updated library versions, you can follow these steps:

  1. Add the following code to your composer.json file:
"repositories": [
       {
           "type": "package",
           "package": {
               "name": "vistik/typed-collections",
               "version": "6.0.0",
               "source": {
                   "url": "https://github.com/jason-klein/typed-collections",
                   "type": "git",
                   "reference": "pr-laravel6x"
               },
               "type": "library",
               "autoload": {
                   "psr-4": {
                       "PhpSafari\\": "src/"
                   },
                   "files": [
                       "src/helpers.php"
                   ]
               }
           }
       },
     {
         "type": "package",
         "package": {
             "name": "phpsafari/health-checks",
             "version": "6.0.0",
             "source": {
                 "url": "https://github.com/jason-klein/health-checks",
                 "type": "git",
                 "reference": "pr-laravel6x"
             },
             "type": "library",
             "autoload": {
                 "psr-4": {
                     "PhpSafari\\": "src/"
                 }
             }
         }
     }
 ],
  1. Tell composer to require the 6.0.0 version of each package, which will read version 6.0.0 from my repo until a newer version is published. When you publish newer updates of each package (e.g. 6.0.1), composer should automatically receive those updates directly from your official repo even if you forget to remove the custom repositories entries above.
composer require phpsafari/health-checks ^6.0 vistik/typed-collections ^6.0

The 2-step method above is untested, but very similar to the method I am successfully using to import the custom versions of the libraries from my dev- branches into Laravel 6.

If you do not move to 6.0.0 versioning after using the method above, you will need to uninstall each package (e.g. composer remove), remove the custom repositories entries from your composer.json, then reinstall each package (e.g. composer require).

Currently generating the following warning:
```
PHPUnit 8.4.3 by Sebastian Bergmann and contributors.

  Warning - The configuration file did not pass validation!
  The following problems have been detected:

  Line 11:
  - Element 'phpunit', attribute 'syntaxCheck': The attribute 'syntaxCheck' is not allowed.

  Test results may not be as expected.
```
…ctation tests

Currently generating the following warning:
```
The @ExpectedException, @expectedExceptionCode, @expectedExceptionMessage, and @expectedExceptionMessageRegExp annotations are deprecated. They will be removed in PHPUnit 9. Refactor your test to use expectException(), expectExceptionCode(), expectExceptionMessage(), or expectExceptionMessageRegExp() instead.
```
…HP 7.0/7.1

Per my comments in this PR (OveD-php/typed-collections#3):

My suggestion would be to bump the versioning of your Laravel packages to
align with Laravel versioning so that the existing versions (0.0.7, 2.0.2)
remain available for Laravel 5.x users and a new version (e.g. 6.0.0) is
available for Laravel 6.x users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant