Skip to content

Conversation

VinceG
Copy link

@VinceG VinceG commented Mar 3, 2025

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 upgraded orchestra/testbench to ^8.0 and phpunit/phpunit to ^10.0. [1] [2]

Type Hinting Improvements:

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, including setUp, setUpRoutes, testThrowsDefaultException, testThrowsModelNotFoundException, testThrowsAuthenticationException, testThrowsAuthorizationException, testThrowsValidationExceptions, testThrowsBadRequestHttpException, and testThrowsNotFoundHttpException. [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

json-exception-handler on  bug/typehinted-exception via 🐘 v8.2.27 on ☁️  (us-west-2)
❯ composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - doctrine/inflector is locked to version v1.3.0 and an update of this package was not requested.
    - doctrine/inflector v1.3.0 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 2
    - doctrine/instantiator is locked to version 1.1.0 and an update of this package was not requested.
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 3
    - fzaninotto/faker is locked to version v1.7.1 and an update of this package was not requested.
    - fzaninotto/faker v1.7.1 requires php ^5.3.3 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 4
    - laravel/framework is locked to version v5.6.22 and an update of this package was not requested.
    - laravel/framework v5.6.22 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 5
    - myclabs/deep-copy is locked to version 1.7.0 and an update of this package was not requested.
    - myclabs/deep-copy 1.7.0 requires php ^5.6 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 6
    - phar-io/manifest is locked to version 1.0.1 and an update of this package was not requested.
    - phar-io/manifest 1.0.1 requires php ^5.6 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 7
    - phar-io/version is locked to version 1.0.1 and an update of this package was not requested.
    - phar-io/version 1.0.1 requires php ^5.6 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 8
    - phpdocumentor/reflection-docblock is locked to version 4.3.0 and an update of this package was not requested.
    - phpdocumentor/reflection-docblock 4.3.0 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 9
    - phpdocumentor/type-resolver is locked to version 0.4.0 and an update of this package was not requested.
    - phpdocumentor/type-resolver 0.4.0 requires php ^5.5 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 10
    - phpspec/prophecy is locked to version 1.7.6 and an update of this package was not requested.
    - phpspec/prophecy 1.7.6 requires php ^5.3|^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 11
    - phpunit/php-code-coverage is locked to version 6.0.4 and an update of this package was not requested.
    - phpunit/php-code-coverage 6.0.4 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 12
    - phpunit/php-timer is locked to version 2.0.0 and an update of this package was not requested.
    - phpunit/php-timer 2.0.0 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 13
    - phpunit/php-token-stream is locked to version 3.0.0 and an update of this package was not requested.
    - phpunit/php-token-stream 3.0.0 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 14
    - phpunit/phpunit is locked to version 7.1.5 and an update of this package was not requested.
    - phpunit/phpunit 7.1.5 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 15
    - phpunit/phpunit-mock-objects is locked to version 6.1.1 and an update of this package was not requested.
    - phpunit/phpunit-mock-objects 6.1.1 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 16
    - ramsey/uuid is locked to version 3.7.3 and an update of this package was not requested.
    - ramsey/uuid 3.7.3 requires php ^5.4 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 17
    - sebastian/code-unit-reverse-lookup is locked to version 1.0.1 and an update of this package was not requested.
    - sebastian/code-unit-reverse-lookup 1.0.1 requires php ^5.6 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 18
    - sebastian/comparator is locked to version 3.0.0 and an update of this package was not requested.
    - sebastian/comparator 3.0.0 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 19
    - sebastian/diff is locked to version 3.0.0 and an update of this package was not requested.
    - sebastian/diff 3.0.0 requires php ^7.1 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 20
    - sebastian/environment is locked to version 3.1.0 and an update of this package was not requested.
    - sebastian/environment 3.1.0 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 21
    - sebastian/exporter is locked to version 3.1.0 and an update of this package was not requested.
    - sebastian/exporter 3.1.0 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 22
    - sebastian/global-state is locked to version 2.0.0 and an update of this package was not requested.
    - sebastian/global-state 2.0.0 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 23
    - sebastian/object-enumerator is locked to version 3.0.3 and an update of this package was not requested.
    - sebastian/object-enumerator 3.0.3 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 24
    - sebastian/object-reflector is locked to version 1.1.1 and an update of this package was not requested.
    - sebastian/object-reflector 1.1.1 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 25
    - sebastian/recursion-context is locked to version 3.0.0 and an update of this package was not requested.
    - sebastian/recursion-context 3.0.0 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 26
    - symfony/console is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/console v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 27
    - symfony/css-selector is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/css-selector v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 28
    - symfony/debug is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/debug v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 29
    - symfony/event-dispatcher is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/event-dispatcher v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 30
    - symfony/finder is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/finder v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 31
    - symfony/http-foundation is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/http-foundation v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 32
    - symfony/http-kernel is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/http-kernel v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 33
    - symfony/process is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/process v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 34
    - symfony/routing is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/routing v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 35
    - symfony/translation is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/translation v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 36
    - symfony/var-dumper is locked to version v4.0.9 and an update of this package was not requested.
    - symfony/var-dumper v4.0.9 requires php ^7.1.3 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 37
    - theseer/tokenizer is locked to version 1.1.0 and an update of this package was not requested.
    - theseer/tokenizer 1.1.0 requires php ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 38
    - tijsverkoyen/css-to-inline-styles is locked to version 2.2.1 and an update of this package was not requested.
    - tijsverkoyen/css-to-inline-styles 2.2.1 requires php ^5.5 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 39
    - webmozart/assert is locked to version 1.3.0 and an update of this package was not requested.
    - webmozart/assert 1.3.0 requires php ^5.3.3 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
  Problem 40
    - orchestra/testbench-core is locked to version v3.6.5 and an update of this package was not requested.
    - fzaninotto/faker v1.7.1 requires php ^5.3.3 || ^7.0 -> your php version (8.2.27) does not satisfy that requirement.
    - orchestra/testbench-core v3.6.5 requires fzaninotto/faker ~1.4 -> satisfiable by fzaninotto/faker[v1.7.1].

@VinceG VinceG self-assigned this Mar 3, 2025
@VinceG VinceG merged commit ded7dd7 into bug/typehinted-exception Mar 3, 2025
@VinceG VinceG deleted the update/composer-82 branch March 3, 2025 23:57
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.

2 participants