-
Notifications
You must be signed in to change notification settings - Fork 155
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
#102 Add alternative for php pathinfo function is discouraged #123
#102 Add alternative for php pathinfo function is discouraged #123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add also all functions from https://github.com/magento/magento2/blob/2.3/lib/internal/Magento/Framework/Filesystem/Io/File.php?
For instance mkdir
, rmdir
, unlink
, etc.
@ihor-sviziev all requested changes are now done. |
@buskamuza could you please have a look at these recommendations? It looks like we need to suggest something different from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest referencing \Magento\Framework\Filesystem\DriverInterface
interface instead of concrete driver. But I don't insist.
Io
should only be used as a last resort. Looks like there is only one method that exists in Io
and doesn't exist in Filesystem
: pathinfo
.
Thanks, @lenaorobei . The proposal is not ready yet, but at least we should avoid recommending |
Thanks @buskamuza @lenaorobei I'll update this PR today |
@buskamuza requested changes are done, please have a look when you get a chance |
@@ -39,11 +39,11 @@ class DiscouragedFunctionSniff extends ForbiddenFunctionsSniff | |||
'^call_user_func_array$' => null, | |||
'^chdir$' => null, | |||
'^chgrp$' => null, | |||
'^chmod$' => null, | |||
'^chmod$' => '\Magento\Framework\Filesystem\DriverInterface::changePermissions() or \Magento\Framework\Filesystem\DriverInterface::changePermissionsRecursively()', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix Line exceeds maximum limit of 120 characters; contains 171 characters
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use interface recommendation instead of specific class.
Sorry, I missed this at the first glance.
…magento-coding-standard-334 [Imported] Fix unit tests
#102