Comments (10)
It seems you're using windows, just copy paste the error on google, the solution is probably on stackoverflow already https://stackoverflow.com/questions/24782826/the-filename-directory-name-or-volume-label-syntax-is-incorrect-inside-batch
from rector.
Thank you for your report!
We'll need an isolated failing demo link from: http://getrector.com/demo,
that way we can reproduce the bug.
from rector.
Seems that this is happening on Windows with XDEBUG active.
In fact, this exception is related to this LOC change in XdebugHandler.php
(that is loaded in the source code of Rector rather than via Composer): 45987b0#diff-27a6b916747c306f2a8c14d3ebcaeb25ecf6e4359daeb4541f0277712dd1a40c
This change has been introduced in v0.18.6, and still present on 0.18.12.
By the way, in the source of that package (last version v3.0.3) that LOC is slightly different https://github.com/composer/xdebug-handler/blob/3.0.3/src/XdebugHandler.php#L298
So it's not related to the SO page attached.
from rector.
This probably related with PR:
@garas could you verify with relevancy? Thank you.
from rector.
I'm unable to reproduce issue. Rector runs fine on Windows.
Do you still get same error if you allow Xdebug with .\vendor\bin\rector --xdebug
?
from rector.
@garas it works super super slowly. I cannot even perform a search on a project with 16 files in a reasonable time.
The point is that until version 18.5 it was possible to leave XDebug ready for web debugging (by using a dedicated cookie) in PHP.ini (xdebug.mode = develop,debug
), while not creating any issue in Rector.
As said above, the source code of that helper library is different from the one that you have. Don't know if an updated version may solve the issue.
from rector.
According to my analysis, the issue lies here 45987b0#diff-27a6b916747c306f2a8c14d3ebcaeb25ecf6e4359daeb4541f0277712dd1a40c
escapeshellarg
behaves very differently on Linux and Windows. Typically, the native function does not work in a naive way under Windows, and it creates issues in a lot of contexts. The community suggests to implement a dedicated function for Windows environments. References here:
- (good comment in official PHP Docs) https://www.php.net/manual/en/function.escapeshellarg.php#123718
- https://stackoverflow.com/questions/58519037/how-do-i-use-escapeshellarg-on-windows-but-aimed-for-linux-and-vice-versa
from rector.
@scollovati based on php manual comment, is changing with something like:
-$process = \proc_open(\is_array($cmd) ? \implode(' ', \array_map('escapeshellarg', $cmd)) : $cmd, [], $pipes);
+$process = \proc_open(\is_array($cmd) ? \implode(' ', \array_map(
+ function($path) {
+ return '"' . addcslashes($path, '\\"') . '"';
+ }, $cmd)) : $cmd, [], $pipes);
is working? It is unfortunately that we don't have windows env for testing and example code that produce the error. If you can provide a github repo with github action for windows, that would be great to test and fix together.
from rector.
Not working either. I've manually changed the LOC to go back to the previous version and it works.
Same said by using the official package here https://github.com/composer/xdebug-handler/blob/main/src/XdebugHandler.php#L298
from rector.
Related Issues (20)
- ReturnNeverTypeRector results in incompatible function signatures
- Skipper with match: */Expected* should not skip file named MatchParamTypeExpectedNameResolver.php HOT 3
- ReturnTypeFromStrictTypedCallRector infers static return type as static in caller
- fix invalid union return phpdocs with `void`. HOT 5
- can't set a new parameter to have no default value HOT 3
- PHP Fatal error: Uncaught Error: Typed static property RectorPrefix202312 HOT 2
- Documentation on rules is missing details on how to configure them HOT 3
- Incorrect behavior of SensitiveConstantNameRector, NullToStrictStringFuncCallArgRector HOT 1
- System error: "Scope not available on "PhpParser\Node\Expr\Array_" node, but is required by a refactorWithScope() method of "Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector HOT 5
- Rector does not refactor PHP8.3 ldap_connect deprecated signature
- Wrong variable name replacement for `$this` HOT 1
- Rector fails to convert dataProvider annotation to #[DataProvider] attribute for PHPUnit 10 HOT 3
- Enum name in upper snake case instead of upper case [offering to help] HOT 6
- rector debug file HOT 1
- System error: Scope not available on PhpParser\Node\Expr\FuncCall node, but is required by a refactorWithScope() method HOT 1
- Incorrect behavior of TernaryFalseExpressionToIfRector
- [DX] Add RequiredPolyfillInterface to some rule to enable then, once the project is using polyfill package HOT 2
- Incorrect behavior of DowngradeMatchToSwitchRector HOT 2
- Error in SimplifyIfElseWithSameContentRector HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rector.