-
Notifications
You must be signed in to change notification settings - Fork 383
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
Support extracting dimensions for single URLs #793
Conversation
Back-compat for sites using the class directly and relying on it for extracting images for just a single URL.
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.
Ran tests on local. This looks good hence the approval.
There are some PHPCS errors that need to be corrected to get the build to pass:
|
0.6 Release to master
…g-dimension-back-compat
## PHP_CodeSniffer Time: 1.08 secs; Memory: 16Mb tests/test-amp-image-dimension-extractor.php:39:12: error - Missing doc comment for function single_url__add_mock_dimension_callback() (Squiz.Commenting.FunctionComment.Missing) tests/test-amp-image-dimension-extractor.php:43:12: error - Missing doc comment for function single_url__mock_dimension_callback() (Squiz.Commenting.FunctionComment.Missing) tests/test-amp-image-dimension-extractor.php:52:12: error - Missing doc comment for function test__single_url() (Squiz.Commenting.FunctionComment.Missing) tests/test-amp-image-dimension-extractor.php:53:147: error - Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar) tests/test-amp-image-dimension-extractor.php:56:19: warning - Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)
tests/test-amp-image-dimension-extractor.php:47:8: error - Doc comment short description must start with a capital letter (Generic.Commenting.DocComment.ShortNotCapital)
Hi @westonruter Weston sorry this has sat, It's been on the back burner for quite a while. Let me or Mo know if any concerns. Thanks. |
See also #1314 which undoes a bit of this PR: #1314 (review) |
Back-compat for sites using the class directly and relying on it for extracting images for just a single URL.
Fixes issues when doing something like:
AMP_Image_Dimension_Extractor::extract( $image_url )
where$image_url
is a string and throwsInvalid argument supplied for foreach()
warnings.