-
Notifications
You must be signed in to change notification settings - Fork 5
Feature/viewmodel/teaser non article content #1
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
Feature/viewmodel/teaser non article content #1
Conversation
@@ -14,7 +14,7 @@ | |||
final public function offsetGet($offset) | |||
{ | |||
if (false === $this->offsetExists($offset)) { | |||
return null; | |||
return; |
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.
This change was introduced by php-cs-fixer
, and is outside the scope of the fileset for the feature addressed by this pull request.
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.
See symfony/symfony#17201. In this case the intent is to return null
, but PHP doesn't currently have a void
return type so it ends up being null
anyway. However, PHP 7.1 has introduced them, so we should match it.
I think you can disable that check in the fixer.
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.
Hmm, I can't recreate it.
All checks pass when running locally within PHPStorm, but the Travis checks failed. There are 10 failures, all along the same lines. It's complaining
See details of the Travis run for more information. |
The Travis failure is due to Puli being broken with Composer 1.1 (see puli/issues#190). I'll look at what we can do. |
2eb9c71 fixes Travis. |
use eLife\Patterns\CastsToArray; | ||
use eLife\Patterns\ReadOnlyArrayAccess; | ||
|
||
class Date implements CastsToArray |
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.
final
Todo: tests for date; add more tests for pasring of json schema for required fields; add more tests for input/output of required fields; add optional fields; add tests for optional fields;
use eLife\Patterns\ViewModel; | ||
use Traversable; | ||
|
||
class TeaserNonArticleContent implements ViewModel |
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.
final
Adds tests and implementations for most fields, outstanding are date and image. Date needs to be its own pattern in patternlab so that it has a template path, before being able to inherit from
ViewModel
here. Image looks like it's going to be its own patternlab pattern too.Due to incomplete nature of this, I don't mind if this pull request is not merged yet as it stands, but I think a sanity check on the approach will be valuable.
Small atomic commits are used in order to maintain good separation while I'm learning the codebase. These can be squashed before/on merge.