-
-
Notifications
You must be signed in to change notification settings - Fork 633
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
FR: Handle the values passed via CLI arguments in a case-insensitive manner #2434
Comments
To see the issue, first run: ```bash phpdoc -f ./src/issue2434.php ``` The generated documentation will be empty. Next, run: ```bash phpdoc -f ./src/Issue2434.php ``` And all works fine. Ref: phpDocumentor/phpDocumentor#2434
For quite a few things I agree, but file and folders handling needs to be case sensitive because some filesystems are case sensitive, and files with the same name but a different case can co-exist. (let's not debate whether this is a good idea; that would be a short debate 😆 ) I see you also mention visibility, and that can very well be case insensitive. Sounds like a good improvement :) |
I understand your point of view regarding file/folder names, though that could possibly be solved by doing a case-sensitive check to find the file first and if not found, falling back to a case-insensitive one. If you like, I could look into how other tools do this as I'm fairly confident that both tools I mentioned before, do support it. Glad to hear though that, at a minimum, for everything else this is accepted as a viable feature request. |
Those checks can be bad for performance, especially when working with remote filesystems. We try to follow the rules for glob (although these are not in a proper specification). Although I am interested in how other tools deal with this; I do think that changing this specific part may have edge cases that can be problematic. |
I made the visibility case insensitive. For now that will be the only change. |
Thanks @jaapio ! |
Feature request
When providing CLI arguments, it is common for tools to allow passing those in a case-insensitive manner.
At this moment, this is not the case in phpDocumentor and I would like to suggest changing this to treat all values passed to CLI arguments in a case-insensitive manner.
Precedent
PHPUnit
Given a test class called
MyArbitraryTest
, I can run just that test by calling:I.e. the value of the command line argument is handled in a case-insensitive manner.
PHP_CodeSniffer
If I'd want to run the PHPCompatibility standard over a codebase (provided the standard is installed), I can do this by calling:
I.e. the value of the command line argument is handled in a case-insensitive manner.
Current behaviour in phpDocumentor - example 1
Given a simple test file saved as
./src/Issue2434.php
containing the following:Running phpDocumentor 3 with the following command:
Results in:
And no docs being generated:
Running phpDocumentor 3 with the following command (correct case):
... works fine as expected:
Current behaviour in phpDocumentor - example 2
The text was updated successfully, but these errors were encountered: