From f842c96b0d95373959beb5d22b75cf2f5c76511d Mon Sep 17 00:00:00 2001 From: Nick Evans Date: Tue, 28 Jan 2025 13:37:33 -0600 Subject: [PATCH] PHP 8.4 Compatibility (#109) --- .github/workflows/phpunit.yml | 2 +- .gitignore | 1 + CHANGELOG.md | 9 +++++++++ composer.json | 2 +- tests/Concerns/HandlesDirectorySearchTest.php | 12 ++++++------ 5 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 0071a77..e62cbcc 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - php-versions: ['8.2', '8.3'] + php-versions: ['8.2', '8.3', '8.4'] steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index 687664d..6e69ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ yarn-error.log .vapor/ /.idea /composer.lock +/.phpunit.result.cache diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b418e6a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/). + +## [Unreleased] +## [v2.1.0] - 2025-01-28 +### Changed +- Compatibility for PHP 8.4 has been added, and support for PHP 8.1 has been dropped. diff --git a/composer.json b/composer.json index 83d290b..7db7552 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8", + "php": "^8.2", "northwestern-sysdev/laravel-soa": ">=6", "northwestern-sysdev/dynamic-forms": "*" }, diff --git a/tests/Concerns/HandlesDirectorySearchTest.php b/tests/Concerns/HandlesDirectorySearchTest.php index 378330c..2c695d6 100644 --- a/tests/Concerns/HandlesDirectorySearchTest.php +++ b/tests/Concerns/HandlesDirectorySearchTest.php @@ -20,11 +20,11 @@ public function testFound(): void 'nuAllTitle' => ['Head of IT'], ]); - $this->app['router']->get(__METHOD__.'/{search}', function (string $search) use ($api) { + $this->app['router']->get(__FUNCTION__.'/{search}', function (string $search) use ($api) { return ($this->mock_controller($api))($search); }); - $response = $this->get(__METHOD__.'/test'); + $response = $this->get(__FUNCTION__.'/test'); $response->assertOk() ->assertJson([ @@ -44,11 +44,11 @@ public function testNotFound(): void $api = $this->createStub(DirectorySearch::class); $api->method('lookup')->willReturn(false); - $this->app['router']->get(__METHOD__.'/{search}', function (string $search) use ($api) { + $this->app['router']->get(__FUNCTION__.'/{search}', function (string $search) use ($api) { return ($this->mock_controller($api))($search); }); - $response = $this->get(__METHOD__.'/test@foo.com'); + $response = $this->get(__FUNCTION__.'/test@foo.com'); $response->assertNotFound()->assertJson([ 'display' => 'test@foo.com', 'searchType' => 'mail', @@ -66,11 +66,11 @@ public function testIncompleteData(): void 'nuAllTitle' => null, ]); - $this->app['router']->get(__METHOD__.'/{search}', function (string $search) use ($api) { + $this->app['router']->get(__FUNCTION__.'/{search}', function (string $search) use ($api) { return ($this->mock_controller($api))($search); }); - $response = $this->get(__METHOD__.'/test'); + $response = $this->get(__FUNCTION__.'/test'); $response->assertOk()->assertJson([ 'display' => 'test', 'searchType' => 'netid',