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

Projects
None yet
3 participants
@mjangda
Contributor

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.

Support extracting dimensions for single URLs
Back-compat for sites using the class directly and relying on it for
extracting images for just a single URL.
@mdbitz

mdbitz approved these changes Jan 22, 2018

Ran tests on local. This looks good hence the approval.

@westonruter westonruter changed the base branch from master to develop Jan 22, 2018

@westonruter

This comment has been minimized.

Member

westonruter commented Jan 22, 2018

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 some commits Jan 24, 2018

Merge pull request #896 from Automattic/0.6
0.6 Release to master
Resolving PHPCS formatting issues.
## 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)
PHPCS Formatting
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

This comment has been minimized.

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.

@hellofromtonya hellofromtonya requested a review from westonruter Aug 2, 2018

@westonruter westonruter added this to the v1.0 milestone Aug 3, 2018

@westonruter westonruter merged commit 06918f1 into develop Aug 3, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the update/img-dimension-back-compat branch Aug 3, 2018

@westonruter

This comment has been minimized.

Member

westonruter commented Aug 11, 2018

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