From e28e460522b373418ed598c8237928a243d7673c Mon Sep 17 00:00:00 2001 From: Attila Fulop <1162360+fulopattila122@users.noreply.github.com> Date: Thu, 27 Jan 2022 18:56:46 +0100 Subject: [PATCH] PHP 8.1+ Laravel 9+ Laravel 6/7- PHP 7.4- - Changed CI to Github Actions - Updated Code Style Def to PSR-12 --- .github/pull_request_template.md | 6 +++ .github/workflows/tests.yml | 36 +++++++++++++++++ .styleci.yml | 69 ++++++++++++++------------------ .travis.yml | 63 ----------------------------- Changelog.md | 9 +++++ README.md | 2 +- composer.json | 8 ++-- 7 files changed, 87 insertions(+), 106 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..ad07bc2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ +Please go through this checklist, it is mandatory to accept your PR + +- [ ] Include the summary of your change. +- [ ] Make sure all the tests are passing +- [ ] Make sure StyleCI is passing +- [ ] In case you add new functionality, it must be covered by tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..2161309 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: tests + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + php: ['8.0', '8.1'] + laravel: ['8.22', '8.81', '9.0'] + enum: ['2', '3'] + exclude: + - php: '8.1' + laravel: '8.22' + name: PHP ${{ matrix.php }} Laravel ${{ matrix.laravel }} + steps: + - name: Checkout + uses: actions/checkout@master + - name: Installing PHP + uses: shivammathur/setup-php@master + with: + php-version: ${{ matrix.php }} + extensions: mbstring, json, sqlite3 + tools: composer:v2 + - name: Lock Laravel Version + run: | + composer require "konekt/enum:${{ matrix.enum }}.*" --no-update -v + composer require "laravel/framework:${{ matrix.laravel }}.*" --no-update -v + - name: Composer Install + run: composer install --prefer-dist --no-progress --no-interaction + - name: Create Database + run: mkdir -p database && touch database/database.sqlite + - name: Run Tests + run: php vendor/bin/phpunit --testdox diff --git a/.styleci.yml b/.styleci.yml index e9f3c5f..3078be4 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,39 +1,32 @@ -preset: psr2 - +preset: psr12 +risky: true enabled: - - align_phpdoc - - align_double_arrow - - blank_line_before_return - - cast_spaces - - concat_with_spaces - - lowercase_static_reference - - method_separation - - new_with_braces - - no_blank_lines_after_class_opening - - no_blank_lines_after_phpdoc - - no_blank_lines_after_return - - no_blank_lines_between_imports - - no_blank_lines_between_traits - - no_empty_statement - - no_extra_consecutive_blank_lines - - no_leading_namespace_whitespace - - no_null_property_initialization - - no_unused_imports - - no_useless_else - - no_useless_return - - no_whitespace_before_comma_in_array - - no_whitespace_in_blank_line - - object_operator_without_whitespace - - ordered_class_elements - - phpdoc_link_to_see - - phpdoc_no_package - - phpdoc_order - - property_separation - - return_type_declaration - - short_array_syntax - - short_scalar_cast - - single_blank_line_before_namespace - - space_after_semicolon - - ternary_operator_spaces - - ternary_to_null_coalescing - - yoda_style + - align_phpdoc + - alpha_ordered_imports + - cast_spaces + - clean_namespace + - declare_strict_types + - fully_qualified_strict_types + - implode_call + - no_extra_block_blank_lines + - no_extra_consecutive_blank_lines + - no_spaces_inside_offset + - no_spaces_outside_offset + - no_whitespace_before_comma_in_array + - no_unneeded_curly_braces + - no_unneeded_control_parentheses + - no_unneeded_final_method + - no_unused_imports + - no_unused_lambda_imports + - no_useless_sprintf + - normalize_index_brace + - object_operator_without_whitespace + - ordered_class_elements + - print_to_echo + - property_separation + - short_array_syntax + - short_list_syntax + - standardize_not_equals + - unalign_equals + - unalign_double_arrow + - yoda_style diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5a02643..0000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: php - -cache: - directories: - - "$HOME/.composer/cache" - -php: - - '7.3' - - '7.4' - - '8.0' - -env: - - ENUM=2 LARAVEL=6.0 - - ENUM=2 LARAVEL=6.20 - - ENUM=2 LARAVEL=7.0 - - ENUM=2 LARAVEL=7.30 - - ENUM=2 LARAVEL=8.0 - - ENUM=2 LARAVEL=8.17 - - ENUM=3 LARAVEL=6.0 - - ENUM=3 LARAVEL=6.20 - - ENUM=3 LARAVEL=7.0 - - ENUM=3 LARAVEL=7.30 - - ENUM=3 LARAVEL=8.0 - - ENUM=3 LARAVEL=8.17 - -matrix: - exclude: - - php: '8.0' - env: 'ENUM=2 LARAVEL=6.0' - - php: '8.0' - env: 'ENUM=2 LARAVEL=6.20' - - php: '8.0' - env: 'ENUM=2 LARAVEL=7.0' - - php: '8.0' - env: 'ENUM=2 LARAVEL=7.30' - - php: '8.0' - env: 'ENUM=2 LARAVEL=8.0' - - php: '8.0' - env: 'ENUM=2 LARAVEL=8.17' - - php: '8.0' - env: 'ENUM=3 LARAVEL=6.0' - - php: '8.0' - env: 'ENUM=3 LARAVEL=7.0' - - php: '8.0' - env: 'ENUM=3 LARAVEL=8.0' - -script: -- vendor/bin/phpunit -c phpunit.xml tests/ - -before_install: -- composer require "konekt/enum:${ENUM}.*" --no-update -v -- composer require "illuminate/database:${LARAVEL}.*" --no-update -v -- composer require "illuminate/events:${LARAVEL}.*" --no-update -v -- composer require "illuminate/support:${LARAVEL}.*" --no-update -v -- composer require "illuminate/contracts:${LARAVEL}.*" --no-update -v -- composer require "illuminate/container:${LARAVEL}.*" --no-update -v - -install: composer install --no-interaction - -notifications: - email: false - slack: - secure: IQU+s/xkkRxzYVFyTbd++GTyFlj1ndBRdEoFC+NPo7S2nS42j4KgNIeOnhkIvyap8yzi/Ju9EvS0KbR1hhHNrqeNGIPumUzBJbjOJAtpWuZ7ZHBBqv8CCA5XtHOv4POi9tU5NUq1ybxxr3xlPsLLmxamGSt7coORDtB7w54QbHSh+ISEsQaRYlWbU2WeinaO8/adrZ6VGbBiYvdeY8drAFHkX//F8R802K3Auf+2TFIL6xXh9d48Ii8Gq0zBdM6Kjm6VkwIK9o3hv7vdrqq+IrXe3JDwKes8T2j5dDQXL3Q7+rpI9KEV4DkZYSZfbQ6rfztfJvEbaREFFC6qJ8VIh/REnmu02qvp30QgxbxBXmqh9exGeEddiIddhF4aGzgi+F/WiGhe0IIjOc1Rehwv1xLbA+EKXhoKfJDRN2tzl6Pn/cXG9I/20r89fKR8MrnNjgv7s0cyff/yfaWj5o4dvdFspoPtDEWXeqGemRDbAquHrBENrGInDIaRQBNC4R0ntiiojuNwGU2bUsB/QB8p4x7yakmwKGc3CjXl5vmp3uhzbGOdPGOkTNBsv78vlR430jbA5NrWzwsI+b0JdvMMhHRB5yaPKqoEh3SgkAumxNJ/kvnhq6iWQcBxkqLgM/DYDaX2jHARjRdQ4AXw/AfI5U4uXURM4lEUnDChwX+SOBw= diff --git a/Changelog.md b/Changelog.md index b2823ca..776f5f1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,15 @@ # Changelog ### Konekt Enum Eloquent +## Unreleased +##### 2022-01-XX + +- Added PHP 8.1 support +- Added Laravel 9 support +- Dropped PHP 7.3 and PHP 7.4 support +- Dropped Laravel 6 and Laravel 7 support +- Changed CI from Travis to Github Actions + ## 1.7.0 ##### 2020-11-28 diff --git a/README.md b/README.md index 23d94fa..92b2153 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This package provides support for auto casting [konekt enum](https://konekt.dev/enum) fields in [Eloquent models](https://laravel.com/docs/8.x/eloquent-mutators). -> Supported Konekt Enum versions are 2.0+ or 3.0+ and Eloquent 6.0+ +> Supported Konekt Enum versions are 2.0+ or 3.0+ and Eloquent 8.0+ [Changelog](Changelog.md) diff --git a/composer.json b/composer.json index 9b54099..91491ca 100644 --- a/composer.json +++ b/composer.json @@ -22,13 +22,13 @@ } ], "require": { - "php": "^7.3 | ^8.0", + "php": "^8.0", "konekt/enum": "^2.0.2 || ^3.0.0", - "illuminate/database": "6.*|7.*|8.*" + "illuminate/database": "8.*|9.*" }, "require-dev": { - "phpunit/phpunit": "8 - 9", - "illuminate/events": "6.*|7.*|8.*" + "phpunit/phpunit": "8 - 10", + "illuminate/events": "8.*|9.*" }, "autoload": { "psr-4": { "Konekt\\Enum\\Eloquent\\": "src/" }