Skip to content
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

Merged
merged 13 commits into from
Aug 3, 2018

Conversation

mjangda
Copy link
Contributor

@mjangda mjangda commented Nov 3, 2017

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 throws Invalid argument supplied for foreach() warnings.

Back-compat for sites using the class directly and relying on it for
extracting images for just a single URL.
Copy link
Contributor

@mdbitz mdbitz left a 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.

@westonruter westonruter changed the base branch from master to develop January 22, 2018 18:11
@westonruter
Copy link
Member

There are some PHPCS errors that need to be corrected to get the build to pass:

includes/utils/class-amp-image-dimension-extractor.php:15:9: error - Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar)
includes/utils/class-amp-image-dimension-extractor.php:31:43: warning - Equals sign not aligned with surrounding assignments; expected 11 spaces but found 1 space (Generic.Formatting.MultipleStatementAlignment.NotSameWarning)
includes/utils/class-amp-image-dimension-extractor.php:45:9: error - Inline comments must end in full-stops, exclamation marks, or question marks (Squiz.Commenting.InlineComment.InvalidEndChar)

westonruter and others added 10 commits January 24, 2018 01:39
## 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)
@mdbitz
Copy link
Contributor

mdbitz commented Aug 2, 2018

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.

@westonruter westonruter added this to the v1.0 milestone Aug 3, 2018
@westonruter westonruter merged commit 06918f1 into develop Aug 3, 2018
@westonruter westonruter deleted the update/img-dimension-back-compat branch August 3, 2018 15:44
@westonruter
Copy link
Member

See also #1314 which undoes a bit of this PR: #1314 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants