Skip to content

Commit

Permalink
#3 Fix Method ReflectionParameter::getClass() is deprecated
Browse files Browse the repository at this point in the history
As well as done:
- Add generic for $reflection_cache
- Add phpstan/phpstan-deprecation-rules checks
- Add case in a class for testing where we have default parameter as object.
- Add PHP8 to composer.json
- Increased PHPStan version up to PHP8.2
  • Loading branch information
renakdup committed Apr 28, 2024
1 parent 10e8f38 commit fc41ebd
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 143 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

d.run:
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp pimlab/composer:2.0.0-alpha3-php7.4 sh
d.run74:
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp pimlab/composer:2.0.0-alpha3-php7.4 sh


d.run82:
docker run --rm -it -v "${PWD}":/usr/src/myapp -w /usr/src/myapp shopware/development:8.2-composer-2 bash
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Simple PHP DI Container with autowiring in a single file allows you to easily us
4. Supports Lazy Load class instantiating.
5. Allow you following the best practices for developing your code.
6. Supports PSR11 (read more about below).
7. Supports PHP ^8 and PHP 7.4.

## How to integrate it in a project?
1. Just copy the file `./src/Container.php` to your plugin directory or theme.
Expand Down Expand Up @@ -206,7 +207,7 @@ use Psr\Container\NotFoundExceptionInterface;
- [x] Add resolved service storage (getting singleton).
- [x] Add ability to create new instances of service every time.
- [x] Improve performance.
- [ ] Fix deprecated `Use ReflectionParameter::getType() and the ReflectionType APIs should be used instead.` for PHP8
- [x] Fix deprecated `Use ReflectionParameter::getType() and the ReflectionType APIs should be used instead.` for PHP8
- [ ] Circular dependency protector.
- [ ] Allow to set definitions via `__constructor`.
- [ ] Bind $container instance by default.
Expand Down
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
],
"minimum-stability": "stable",
"require": {
"php": "^7.4"
"php": "^7.4|^8"
},
"require-dev": {
"phpunit/phpunit": "^9.6.13",
"symfony/var-dumper": "^5.4",
"phpstan/phpstan": "^1.10"
"phpstan/phpstan": "^1.10",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1"
},
"autoload-dev": {
"psr-4": {
Expand All @@ -30,5 +32,10 @@
"phpstan": "phpstan analyse -c phpstan.neon",
"phpstan.baselane": "phpstan analyse -c phpstan.neon --generate-baseline",
"phpunit": "phpunit"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
Loading

0 comments on commit fc41ebd

Please sign in to comment.