-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fixes phpcs errors and warnings for Magento\Framework\Image #26036
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
Fixes phpcs errors and warnings for Magento\Framework\Image #26036
Conversation
Hi @krisdante. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
bfab420
to
c1ce202
Compare
947174b
to
9131cff
Compare
* If some folders of path does not exist they will be created | ||
* | ||
* @param null|string $destination | ||
* @param null|string $newName | ||
* @return void | ||
* @throws \Exception If destination path is not writable | ||
* @throws \Magento\Framework\Exception\LocalizedException If destination path is not writable |
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.
Use imported class name
@@ -241,7 +253,7 @@ public function crop($top = 0, $left = 0, $right = 0, $bottom = 0) | |||
* @param bool $tile | |||
* @return void | |||
* @throws \LogicException |
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.
Import class.
lib/internal/Magento/Framework/Image/Adapter/AbstractAdapter.php
Outdated
Show resolved
Hide resolved
8360c5a
to
61d5a4b
Compare
* | ||
* @param $positionX | ||
* @param $positionY | ||
* @param \Imagick $watermark |
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 import the \Imagick
class.
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.
What is the benefit of such import?
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.
The imports are consistent.
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 followed this suggestion and phpstan raged. Reversing
@krisdante Fix the Static tests and import |
@magento run tests |
61d5a4b
to
d8df6af
Compare
Jezus this is boring.... what now. Why the way to test is locally is not documented. phpcs is passing for me. |
9a2190a
to
a54e356
Compare
I was working with those classes and spotted a few warnings and errors that prevent from smooth pull requests. This PR fixes them. It introduces Localized Exceptions in place of \Exception too. Watermark method was to long so it was devided to separate parts
Those tests are passing with my clone of Magento. I do not know why they are failing for B2B test here. I cannot reproduce it. Also, the failed functional test has nothing to do with the change here . |
@krisdante Don't worry about Functional Tests - this is known bug of Magento Use
|
I do not know how to fix them. They are passing on local. See my message. |
@krisdante Let me ping the right person for that kind of issue. |
This issue is caused because Please add |
ImageMagick adapter is non default one and can be configured It is not included in Test Enviroment
a54e356
to
4ced5da
Compare
@lbajsarowicz I did. Static tests are now passing. Failing B2B test is irrelevant. |
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.
Thank you for the great contribution!
Hi @lbajsarowicz, thank you for the review.
|
This DB error is false. I am not going to re-run this test anymore. Merge it or delete the whole PR. |
@krisdante Don't worry about false negatives. These are also verified manually by Commeng team, so as long as it's false negative, we're able to skip it. |
Failed Database Compare not related to the changes in this PR |
Hi @krisdante, thank you for your contribution! |
Description (*)
I was working with those classes and spotted a few warnings and errors
that prevent smooth pull requests. This PR fixes them.
It introduces Localized Exceptions in place of \Exception too.
Manual testing scenarios (*)
vendor/bin/phpcs --standard=dev/tests/static/framework/Magento/ruleset.xml lib/internal/Magento/Framework/Image/
Contribution checklist (*)