-
-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Downgrade Php 7.2] Add opt-out parameter for unsafe types to avoid piling list of safe types #1448
Conversation
4ec40a4
to
77afe08
Compare
…iling list of safe types
77afe08
to
e65daa9
Compare
@TomasVotruba it seems make error in rector scoped at https://github.com/rectorphp/rector |
@TomasVotruba error scoped bare run shown too at https://github.com/rectorphp/rector-src/runs/4481808266?check_suite_focus=true |
I'm currently working on it... |
@TomasVotruba now seems error in php 7.1: Run php bin/rector --version --ansi
PHP Warning: Declaration of RectorPrefix20211210\Symfony\Component\DependencyInjection\Loader\FileLoader::import($resource, ?string $type = NULL, $ignoreErrors = false, ?string $sourceResource = NULL, $exclude = NULL) should be compatible with RectorPrefix20211210\Symfony\Component\Config\Loader\FileLoader::import($resource, ?string $type = NULL, bool $ignoreErrors = false, ?string $sourceResource = NULL, $exclude = NULL) in /home/runner/work/rector/rector/vendor/symfony/dependency-injection/Loader/FileLoader.php on line 213
Warning: Declaration of RectorPrefix20211210\Symfony\Component\DependencyInjection\Loader\FileLoader::import($resource, ?string $type = NULL, $ignoreErrors = false, ?string $sourceResource = NULL, $exclude = NULL) should be compatible with RectorPrefix20211210\Symfony\Component\Config\Loader\FileLoader::import($resource, ?string $type = NULL, bool $ignoreErrors = false, ?string $sourceResource = NULL, $exclude = NULL) in /home/runner/work/rector/rector/vendor/symfony/dependency-injection/Loader/FileLoader.php on line 213
Rector f409d3d5286aedbc4b580515d451b655ac0df774 https://github.com/rectorphp/rector/runs/4482567098?check_suite_focus=true#step:4:1 |
@TomasVotruba I tried locally, by add LoaderInterface::class => [
- 'load'
+ 'load',
+ 'import', It happen only in php 7.1 and 7.2: |
@TomasVotruba looking for existing error at php 7.1 at https://github.com/rectorphp/rector-src/runs/4482411634?check_suite_focus=true#step:23:6
The diff seems on -import($resource, ?string $type = NULL, $ignoreErrors = false, ?string $sourceResource = NULL, $exclude = NULL)
+import($resource, ?string $type = NULL, bool $ignoreErrors = false, ?string $sourceResource = NULL, $exclude = NULL) |
@TomasVotruba here the reproduced error https://3v4l.org/ZQBp3#v7.1.33 The issue seems possibly due to changed of |
@TomasVotruba it seems because there are 2
which in |
@TomasVotruba it seems php 7.1 error with the following code: class A
{
public function import($resource, string $type = null, bool $ignoreErrors = false, string $sourceResource = null, $exclude = null){}
}
class B extends A
{
public function import($resource, string $type = null, $ignoreErrors = false, string $sourceResource = null, $exclude = null){}
} while it working on php >7.2, ref https://3v4l.org/CLL3e#v7.1.33 |
Could you add the |
I tried that, got syntax error, it seems the existing
|
Seeing the list of safe types in
downgrade-config.php
, it looks like we only have to maintain all the interfaces and parent types.On the other hand, there are just 2 methods that are currently unsafe:
Instead of a "removing all types bug X", we should use "remove types on these known cases", to safe work and make list of weak methods easy to see.