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

Refactor the publication file creator #760

Merged
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
0e1c4c9
Apply fixes from StyleCI
StyleCIBot Dec 16, 2022
32c4bc4
Introduce parameter for defining fields in test helper
caendesilva Dec 16, 2022
37ca1d5
Refactor text capture to use the input stream handler class
caendesilva Dec 16, 2022
39ff5da
Add todo
caendesilva Dec 16, 2022
d313657
Implode the text capture
caendesilva Dec 16, 2022
38192ac
Default to throw on console exception in the test
caendesilva Dec 16, 2022
3c7f750
Test the command with text input
caendesilva Dec 16, 2022
1d8f520
Apply fixes from StyleCI
StyleCIBot Dec 16, 2022
97f912c
Merge branch 'publications-feature' into refactor-the-MakePublication…
caendesilva Dec 17, 2022
194de07
Apply fixes from StyleCI
StyleCIBot Dec 17, 2022
3f11673
Remove duplicate mkdir from merge
caendesilva Dec 17, 2022
24cae1e
Update schema file helper to allow merged array
caendesilva Dec 17, 2022
05adcbe
Apply fixes from StyleCI
StyleCIBot Dec 17, 2022
06abb01
Clarify reason behind thrown exception
caendesilva Dec 18, 2022
49df459
Further clarify exception message
caendesilva Dec 18, 2022
fa5539b
Change name of tested field to be more realistic
caendesilva Dec 18, 2022
6ecfcdd
Apply fixes from StyleCI
StyleCIBot Dec 18, 2022
31db6af
Add Copilot context comments
caendesilva Dec 18, 2022
b210812
Generate array input test
caendesilva Dec 18, 2022
9ec4bea
Use the input stream handler instead of STDIN read which freezes tests
caendesilva Dec 18, 2022
4b88d95
Extract method to handleMissingCanonicalField
caendesilva Dec 18, 2022
f6c96be
Clarify exception message
caendesilva Dec 18, 2022
cbb2d80
If the canonical field name is __createdAt return that
caendesilva Dec 18, 2022
147427c
Allow all meta fields to be canonical
caendesilva Dec 18, 2022
a256668
Merge branch 'publications-feature' into refactor-the-MakePublication…
caendesilva Dec 18, 2022
802a375
Method should return object not string
caendesilva Dec 18, 2022
0ee0819
Merge branch 'publications-feature' into refactor-the-MakePublication…
caendesilva Dec 18, 2022
6511c27
Apply fixes from StyleCI
StyleCIBot Dec 18, 2022
d0ecf73
Update exception message
caendesilva Dec 18, 2022
bfbff57
Merge branch 'refactor-the-MakePublicationCommand-class' into support…
caendesilva Dec 18, 2022
43a9460
Apply fixes from StyleCI
StyleCIBot Dec 18, 2022
166baff
Merge pull request #764 from hydephp/support-meta-fields-as-canonical…
caendesilva Dec 18, 2022
9095508
Introduce parameter for test helper
caendesilva Dec 18, 2022
3e9ef1c
Merge pull request #764 from hydephp/support-meta-fields-as-canonical…
caendesilva Dec 18, 2022
9f70722
Update CreatesNewPublicationPageTest.php
caendesilva Dec 18, 2022
7078a24
Merge branch 'refactor-the-MakePublicationCommand-class' of github.co…
caendesilva Dec 18, 2022
28d5be5
Test without canonical
caendesilva Dec 18, 2022
bd50fcd
Replace '?:' with if
caendesilva Dec 18, 2022
3a6872b
Flip if/else to make code clearer
caendesilva Dec 18, 2022
7ba3e56
Extract method
caendesilva Dec 18, 2022
d78962b
Format code
caendesilva Dec 18, 2022
ec4483f
Use the enum
caendesilva Dec 18, 2022
7ce315b
Extract method
caendesilva Dec 18, 2022
525638c
Deprecate helper
caendesilva Dec 18, 2022
4a0afa4
Port helper to the publication type class
caendesilva Dec 18, 2022
e98d8e1
Better handle missing canonical value
caendesilva Dec 18, 2022
5a8a1a9
Throw if the canonical field is not set in type
caendesilva Dec 18, 2022
3938c00
Revert "Throw if the canonical field is not set in type" as it can ne…
caendesilva Dec 18, 2022
4d47f95
Add todo
caendesilva Dec 18, 2022
0450a9e
Apply fixes from StyleCI
StyleCIBot Dec 18, 2022
a99646d
Code format
caendesilva Dec 18, 2022
ea476e3
Test create method without supplying required field
caendesilva Dec 18, 2022
a68442a
Use strict comparisons
caendesilva Dec 19, 2022
7f4260f
Use the enum types
caendesilva Dec 19, 2022
e7d6891
Explode value if it's a string
caendesilva Dec 19, 2022
7a88230
Add fixme markers
caendesilva Dec 19, 2022
6d76f36
Test with text type
caendesilva Dec 19, 2022
cb55401
Apply fixes from StyleCI
StyleCIBot Dec 19, 2022
e09fe59
Test with array type
caendesilva Dec 19, 2022
4f17abd
Apply fixes from StyleCI
StyleCIBot Dec 19, 2022
288b7df
Compare entire file
caendesilva Dec 19, 2022
18bc65c
Use __createdAt as test publication canonical field
caendesilva Dec 19, 2022
5b3751c
Return canonical type instance for meta fields
caendesilva Dec 19, 2022
612fd1e
Return the datetime if the canonical field is set to the createdAt me…
caendesilva Dec 19, 2022
d52daf3
Revert "Use __createdAt as test publication canonical field"
caendesilva Dec 19, 2022
0b1729d
Update array test
caendesilva Dec 19, 2022
bd73388
Test command when using schema with meta field as canonical
caendesilva Dec 19, 2022
46562e3
Apply fixes from StyleCI
StyleCIBot Dec 19, 2022
c5d7150
Test it creates valid Yaml
caendesilva Dec 19, 2022
cc78271
Apply fixes from StyleCI
StyleCIBot Dec 19, 2022
a5886e3
Update CreatesNewPublicationPageTest.php
caendesilva Dec 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected function handleCreate(): void
protected function getCanonicalValue(PublicationFieldType $canonicalFieldDefinition, string $canonicalFieldName): string
{
try {
// TODO: Is it reasonable to use arrays as canonical field values?
caendesilva marked this conversation as resolved.
Show resolved Hide resolved
if ($canonicalFieldDefinition->type === PublicationFieldTypes::Array) {
$canonicalValue = $this->fieldData->{$canonicalFieldName}[0];
} else {
Expand Down