-
-
Notifications
You must be signed in to change notification settings - Fork 12
[2.x] Breaking: Improve the new Authors API #1798
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 all commits
Commits
Show all changes
125 commits
Select commit
Hold shift + click to select a range
48beca6
Add missing array keys to mocked config values
emmadesilva b2dcd7a
Clarify test name and expect the described result
emmadesilva f43a3af
Remove readonly modifier from author username
emmadesilva 26be37d
Update parser to tap author to set the username to the array key
emmadesilva fb12b6b
Throw an InvalidArgumentException when missing the array key
emmadesilva fbfa507
Deprecate the `Author::create` method's `$username` parameter
emmadesilva a1b9cfe
Update the `Author::create` method to support all parameters
emmadesilva f5a66ee
Create InvalidConfigurationException.php
emmadesilva 26aeea7
Update InvalidConfigurationException to extend InvalidArgumentException
emmadesilva 1bdda78
Throw custom InvalidConfigurationException
emmadesilva fb029e1
Override constructor
emmadesilva 771d84d
Create initial logic to find the errored config line
emmadesilva e7748bc
Replace break with early return
emmadesilva 5f414e5
Add spacing
emmadesilva e57592a
Annotate return types
emmadesilva d343f0a
Remove graceful handling as internal developer needs to use proper paths
emmadesilva 901b058
Cleanup and improve the line finder code
emmadesilva 56306f7
Inline local variables
emmadesilva ba2a352
Mark helper as experimental
emmadesilva 46d0bd2
Clarify trait scope
emmadesilva 4b369ec
Specify the exception location
emmadesilva ff935aa
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva 34d6d0b
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva 49f3be1
Add missing generics closing tag
emmadesilva 89a3eb7
Make the socials array nullable to match other properties in class
emmadesilva 239e67c
Document the deprecation reason
emmadesilva 1564619
Make deprecated parameter optional
emmadesilva 93b812a
Document remaining constructor properties
emmadesilva 9c7c4f4
Add name identifiers to the author fields in the config example
emmadesilva 4500a5f
Fill in all the author fields in the config example
emmadesilva b0d9115
Comment out extra author fields
emmadesilva a6263d1
Improve the author configuration documentation
emmadesilva 960989c
Improve inline author config documentation
emmadesilva c780fc8
Return new static
emmadesilva 8030c18
Test against new post author
emmadesilva 4ade214
Annotate the closure return
emmadesilva dd08262
Remove unused use statement
emmadesilva 5639b1b
Set default blank username to guest
emmadesilva e9731c9
Test can define author with no data in config
emmadesilva ac9f5f7
Capitalize the username when making the name fallback
emmadesilva 94588e4
Revert "Capitalize the username when making the name fallback"
emmadesilva aa81aba
Revert "Set default blank username to guest"
emmadesilva 8ea1b91
Update PostAuthorTest.php
emmadesilva b9235dc
Create a new and improved Author facade system
emmadesilva b8dc3a4
Update Author getters to return null when username is not found
emmadesilva fabf404
Simplify get or create method logic
emmadesilva 05c5254
Revert "Simplify get or create method logic"
emmadesilva 66212b8
Reapply "Simplify get or create method logic"
emmadesilva a892c1b
Move assignment out of the condition
emmadesilva dca9991
Remove unnecessary parentheses
emmadesilva 65c7dec
New ternary logic
emmadesilva 43dda0b
Revert "New ternary logic"
emmadesilva 7872a23
Revert "Remove unnecessary parentheses"
emmadesilva 5eb61be
Revert "Move assignment out of the condition"
emmadesilva e41853c
Revert "Reapply "Simplify get or create method logic""
emmadesilva 53f61cf
Fall back to method retry with username
emmadesilva d9e7a8b
Revert "Fall back to method retry with username"
emmadesilva 473a625
Reapply "Fall back to method retry with username"
emmadesilva 57ab544
Clarify test method names
emmadesilva 9d689b4
Extract new more scoped create method
emmadesilva 1e9f09d
Deprecate the `PostAuthor::getOrCreate` method
emmadesilva bf10755
Use the create method as there should be no models before parsing
emmadesilva b673d6b
Add todo
emmadesilva a2d15ee
Add todo
emmadesilva cf4831d
Extract helper method
emmadesilva fdc4d83
Introduce local variable
emmadesilva ceec673
Inline the helper method usage into last remaining usage
emmadesilva fa4213f
Ignore coverage for deprecated method
emmadesilva 672cfb5
Use static instead of self
emmadesilva 9fa15e6
Update documentation for replacement method
emmadesilva bac4eb2
Remove the `PostAuthor::getOrCreate` method
emmadesilva 557168f
Normalize documentation formatting
emmadesilva c527046
Document that username will never be null
emmadesilva 2f16657
Document where the key comes from
emmadesilva 7290ccd
Document string to string map type
emmadesilva f86d01c
Update fallback username to be lowercase
emmadesilva b8bad25
Normalize post author usernames to lowercase
emmadesilva 33a75b2
Normalize post author usernames to snake case
emmadesilva 1fd4ef2
Extract helper method
emmadesilva b41c4a6
Test the username is normalized
emmadesilva c5c7611
Remove fixture with no bearing on test
emmadesilva f7fac01
Generate the name as a proper title
emmadesilva 88303fc
Normalize name before making it into a title
emmadesilva 27225c0
Revert "Normalize name before making it into a title"
emmadesilva 6c30e0a
Use more complex title parsing
emmadesilva a0c832e
Initial Yaml config error rethrow proof of concept
emmadesilva 4c7cd81
Revert "Initial Yaml config error rethrow proof of concept"
emmadesilva 9bb7853
Rethrow type errors as configuration exceptions
emmadesilva 2ad5de2
Update custom exception class to accept previous throwable
emmadesilva 106b4c1
Custom exception testing as default breaks file memory
emmadesilva 41e0d19
Fix wrong test names
emmadesilva 58711e6
Improve formatting
emmadesilva c4f0cd6
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva 1279d87
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva 2643303
Merge branch 'master' into 2.x-dev
emmadesilva 91e300f
Merge branch 'master' into 2.x-dev
emmadesilva 86e3f47
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva 88fd588
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva faac499
Merge branch 'master' of github.com:hydephp/develop into 2.x-dev
emmadesilva 7ad322d
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva 41f5a91
Normalize the usernames when retrieving them
emmadesilva fc9bd9e
Move up test
emmadesilva 9cdbed3
Make protected normalization helper public internal
emmadesilva d9ceeef
Normalize the usernames when parsing the author config
emmadesilva 196ceb7
Test covers HasKernelData trait
emmadesilva a035415
Add a filter pass to only keep the first author with matching username
emmadesilva e91e646
Revert "Add a filter pass to only keep the first author"
emmadesilva 838fa42
Remove todo
emmadesilva 86f9025
Write new release notes for the new author system
emmadesilva 7d9db6a
Merge branch 'master' into 2.x-dev
emmadesilva 1136e0a
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva f25e442
Document all breaking author changes in changelist
emmadesilva 0db6918
Merge branch '2.x-dev' into reduce-author-username-duplication
emmadesilva 50de689
Test all post author fields can be set in front matter
emmadesilva 6c3f56d
Update customization documentation for new author system
emmadesilva c788172
Improve wording
emmadesilva 9510e21
Link to related docs
emmadesilva 33d786b
Test configured post author fields can be customized in front matter
emmadesilva b1bb99a
Fix documented discrepancy against actuality as changes are not merged
emmadesilva b8a2b10
Improve documentation section wording
emmadesilva 5fda706
Document the optional fields better
emmadesilva a5fe0e0
Document fields and notes
emmadesilva 60b6831
Link to the source code
emmadesilva 931f429
Link to the facade
emmadesilva d1927e5
Update blog post documentation for new author system
emmadesilva 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
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
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
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
Oops, something went wrong.
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.
Maybe we do not need this here, as they are not yet used, and they are in the documentation. However, if https://github.com/hydephp/develop/issues/1762 will use these they can be kept, hence why I'm holding off on removing them.