From 20431c97436a2d9c453744068ae99e4e4e0a4d8c Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 26 Mar 2021 16:34:25 -0400 Subject: [PATCH 1/5] drop PHP 7 support --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ff6d4ba..9571614 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": "^7.2|^8.0" + "php": "^8.0" }, "require-dev": { "phpunit/phpunit": "^8.0|^9.3" From 257c2315c2a072c6801d282005a5b212c24fb038 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 26 Mar 2021 16:34:42 -0400 Subject: [PATCH 2/5] drop PHP 7.x support --- .github/workflows/run-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 513c496..a65037c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - php: [8.0, 7.4, 7.3, 7.2] + php: [8.0] dependency-version: [prefer-lowest, prefer-stable] os: [ubuntu-latest, windows-latest] From b074d687489d2d65352eb0ed3967898948cc3b1b Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 26 Mar 2021 16:34:49 -0400 Subject: [PATCH 3/5] convert to PHP 8 syntax --- src/Macroable.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Macroable.php b/src/Macroable.php index 5469030..d491526 100644 --- a/src/Macroable.php +++ b/src/Macroable.php @@ -9,7 +9,7 @@ trait Macroable { - protected static $macros = []; + protected static array $macros = []; /** * Register a custom macro. @@ -17,7 +17,7 @@ trait Macroable * @param string $name * @param object|callable $macro */ - public static function macro(string $name, $macro) + public static function macro(string $name, object | callable $macro): void { static::$macros[$name] = $macro; } @@ -25,9 +25,9 @@ public static function macro(string $name, $macro) /** * Mix another object into the class. * - * @param object $mixin + * @param object|string $mixin */ - public static function mixin($mixin) + public static function mixin(object | string $mixin): void { $methods = (new ReflectionClass($mixin))->getMethods( ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED From 21381f19f383c9f61a0fdd398cd2f70b1a224396 Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 26 Mar 2021 16:35:04 -0400 Subject: [PATCH 4/5] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f4e24..2654ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to `macroable` will be documented in this file +## 2.0.0 - unreleased + +- require PHP 8+ +- drop support for PHP 7.x +- convert syntax to PHP 8 + ## 1.0.1 - 2020-11-03 - add support for PHP 8.0 From a116363ebfc39b8c8b3981f73b06bc8f15b1ca8e Mon Sep 17 00:00:00 2001 From: Patrick Date: Fri, 26 Mar 2021 16:59:05 -0400 Subject: [PATCH 5/5] remove unneeded docblocks --- src/Macroable.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/Macroable.php b/src/Macroable.php index d491526..dfd3ebc 100644 --- a/src/Macroable.php +++ b/src/Macroable.php @@ -11,22 +11,11 @@ trait Macroable { protected static array $macros = []; - /** - * Register a custom macro. - * - * @param string $name - * @param object|callable $macro - */ public static function macro(string $name, object | callable $macro): void { static::$macros[$name] = $macro; } - /** - * Mix another object into the class. - * - * @param object|string $mixin - */ public static function mixin(object | string $mixin): void { $methods = (new ReflectionClass($mixin))->getMethods(