update composer depds to support 8.2 #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several updates to the codebase, focusing on upgrading dependencies, improving type hinting, and enhancing test methods. The most important changes include updating the PHP and PHPUnit versions, adding type hints to various methods, and modifying PHPUnit configuration for better compatibility.
Dependency Updates:
composer.json
: Updated the required PHP version to>=8.2
and upgradedorchestra/testbench
to^8.0
andphpunit/phpunit
to^10.0
. [1] [2]Type Hinting Improvements:
src/Handlers/AbstractHandler.php
: Added type hints to various methods, includinggetCode
,handleException
,validatedHandledException
,getExceptionHandler
,getConfiguredHandlers
,getDefaultPointer
,getDefaultTitle
,getStatusCode
,getDefaultHandler
,getDefaultResponseHandler
, andgetResponseHandler
. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]src/Handlers/Handler.php
: Updated thehandle
method to returnErrorHandledInterface
and added type hints.src/JsonApi/Error.php
: Added nullable type hints to various properties and methods, includingid
,links
,detail
,source
,getId
,getLinks
,getDetail
, andgetSource
. [1] [2] [3] [4] [5] [6]src/JsonApi/ErrorCollection.php
: Added nullable type hints togetStatusCode
andsetStatusCode
. [1] [2]src/JsonHandler.php
: Added type hints to thejsonResponse
method.PHPUnit Configuration:
phpunit.xml
: Updated the PHPUnit configuration to include schema location, cache directory, and modified attributes for better compatibility with PHPUnit 10.Test Method Enhancements:
tests/Feature/JsonHandlerTest.php
: Added return type hints to various test methods, includingsetUp
,setUpRoutes
,testThrowsDefaultException
,testThrowsModelNotFoundException
,testThrowsAuthenticationException
,testThrowsAuthorizationException
,testThrowsValidationExceptions
,testThrowsBadRequestHttpException
, andtestThrowsNotFoundHttpException
. [1] [2] [3] [4]i am not sure how this repo even works as is, i wasn't even able to run composer install locally since the package deps require php 7 and we are running 8.2. this PR will update the deps and require php 8.2 so it can actually be installed. brining the depds up to date will resolve the vulnerabilities.
once approved i'll be able to tag a release.
this is what happened when i tired to test this package locally using php 8.2