-
Notifications
You must be signed in to change notification settings - Fork 165
Allow URL metric schema to be extended #1492
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a52381d
Allow URL metric schema to be extended
westonruter e244b22
Add get() and __get() methods to OD_URL_Metric
westonruter 079e6d9
Account for type being an array
westonruter bbc97dc
Add od_url_metric_collected action
westonruter 70fd825
Add todos related to store_url_metric()
westonruter 381c829
Adopt Yoast SEO scheme for filter _doing_it_wrong
westonruter e85c683
Fix and clarify message for disallowed required property in extended …
westonruter 0cc9103
Add sanitization in addition to validation to ensure expected PHP types
westonruter 00d57b4
Persist unknown properties in stored URL Metrics but reject in new UR…
westonruter 22711e4
Add return description
westonruter 384fa53
Use properties instead of get methods
westonruter ed58151
Replace remaining use of get_timestamp
westonruter aa1e663
Disallow default value for schema
westonruter 8917ce9
Explicitly fork rest_default_additional_properties_to_false()
westonruter 907d8c3
Add return description for magic getter
westonruter 0db296f
Eliminate magic getter
westonruter ea28aa1
Merge branch 'trunk' of https://github.com/WordPress/performance into…
westonruter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use properties instead of get methods
- Loading branch information
commit 384fa53f9de60b3080b515ab95a06070b50b1a04
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In addition to what I said in https://github.com/WordPress/performance/pull/1492/files#r1752966800, this here is an example where I would even argue it was more ergonomical before.
get_viewport_width()is more intuitive to use thanviewport['width']since for the latter you have to know which keys are available within the viewport array. So that means it's not even always more ergonomical to use read-only properties.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.
Yeah, this isn't necessarily more ergonomical. Nevertheless, the IDE should know that
$new_url_metric->viewportis of typeViewportRectso it should autocomplete the keys:Uh oh!
There was an error while loading. Please reload this page.
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.
Undone in 0db296f