-
-
Notifications
You must be signed in to change notification settings - Fork 737
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | 2.0.10 |
I have multiple libraries that use vendor/bin scripts, and all of those scripts does not have a .php extension.
Rector does not check these files, even when specifically pointed at the file via the process command.
Minimal PHP Code Causing Issue
Create a PHP file called bin/test.php, containing this:
<?php declare(strict_types=1);
class test {
public function test(string $test = null) {
echo $test;
}
}Run rector, ./vendor/bin/rector --dry-run --debug process bin/test.php, rector lists the file and reports a ExplicitNullableParamTypeRector as expected.
[file] .../test.php
1 file with changes
===================
1) bin/test.php:1
---------- begin diff ----------
@@ @@
<?php declare(strict_types=1);
class test {
- public function test(string $test = null) {
+ public function __construct(?string $test = null) {
echo $test;
}
}
----------- end diff -----------
Applied rules:
* ExplicitNullableParamTypeRectorRename the file to test and run rector again, ./vendor/bin/rector --dry-run --debug process bin/test, this time rector just finishes, having processed no files.
[OK] Rector is done!Expected Behaviour
I can understand that it makes sense to skip files without extensions in a large codebase, but it would be nice if it could scan a file when explicitly told to, instead of skipping it based on a filename extension rule.