-
Notifications
You must be signed in to change notification settings - Fork 231
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
[TASK] Compatibility with PHP7 #970
Conversation
Looks good 👍 |
@@ -42,18 +42,25 @@ class HasValidatorViewHelper extends AbstractConditionViewHelper { | |||
static protected $staticReflectionService; | |||
|
|||
/** | |||
* Initializes the "then" and "else" arguments | |||
*/ | |||
public function __construct() { |
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.
Use initializeArguments. Using constructor to register arguments is indeed also done in few places in the core, but it is extremely bad practice and will be removed soon.
Needs a bit of description of some decisions. It's far from obvious why many of the changes here are made. |
parent::__construct(); | ||
$this->registerArgument('property', 'string', 'The property name, dotted path supported, to determine required.', TRUE); | ||
$this->registerArgument('validatorName', 'string', 'The class name of the Validator that indicates the property is required.', FALSE, NULL); | ||
$this->registerArgument('object', DomainObjectInterface::class, 'Optional object - if not specified, grabs the associated form object.', FALSE, NULL); |
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.
We're not quite ready for the ::class
conversion yet since we don't declare a PHP 5.5 minimum requirement. Tests use it extensively but the "active" code should not - yet.
Changes in |
@@ -42,18 +42,24 @@ class HasValidatorViewHelper extends AbstractConditionViewHelper { | |||
static protected $staticReflectionService; | |||
|
|||
/** | |||
* Initializes the "then" and "else" arguments |
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 comment needs a fixup ;) other than that, looks good now. Math ViewHelpers will likely be refactored and made compilable but this patch should work for now.
[TASK] Compatibility with PHP7
No description provided.