-
-
Notifications
You must be signed in to change notification settings - Fork 422
Add missing types in code templates #1109
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
Conversation
// ->getQuery() | ||
// ->getResult() | ||
// ; | ||
// } |
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.
sticking to a consistent CS for examples
{ | ||
// ... | ||
} | ||
|
||
public static function getSubscribedEvents() | ||
public static function getSubscribedEvents(): array |
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.
triggers a deprecation without the return type
@@ -11,15 +11,15 @@ class <?= $class_name ?> extends Voter | |||
public const EDIT = 'POST_EDIT'; | |||
public const VIEW = 'POST_VIEW'; | |||
|
|||
protected function supports(<?= $use_type_hints ? 'string ' : null ?>$attribute, $subject): bool | |||
protected function supports(string $attribute, $subject): bool |
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.
Kernel is at 5.4 minimum already
{ | ||
// TODO: return your encoded data | ||
return ''; | ||
} | ||
|
||
public function supportsEncoding($format): bool | ||
public function supportsEncoding(string $format, array $context = []): bool |
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.
not adding $context is deprecated
{ | ||
$data = $this->normalizer->normalize($object, $format, $context); | ||
|
||
// Here: add, edit, or delete some data | ||
// TODO: add, edit, or delete some data |
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.
consistency
*/ | ||
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] |
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.
because we can, isn't it?
ebb2c18
to
f53c858
Compare
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.
Looks good! Thanks @nicolas-grekas quick comment on the test return types.
/cc @weaverryan
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 is really nice 👍
Thanks Nicolas! |
No description provided.