Skip to content

MigrationEvent improvements #54

@HermanPeeren

Description

@HermanPeeren
  • Why do you override the constructor and the getArguments() method? Doesn't make sense to me. Look at the code of the AbstractEvent parent.
  • You use a property $results (an array), but you didn't declare that property, nor is it a property of an ancester of MigrationEvent. Hence: you created the property dynamically. But: In PHP 8.2, Dynamic Properties are deprecated (https://wiki.php.net/rfc/deprecate_dynamic_properties), and will result in a fatal error from PHP 9 onwards.
  • Results in Joomla's Events are stored in the $arguments['result'] array. You should implement the Joomla\CMS\Event\Result\ResultAwareInterface in your Event and use the Joomla\CMS\Event\Result\ResultAware trait, so the 'result' is added as a key to the $arguments array. You'll have to implement the getResults() method yourself, it is not in the ResultAware trait. That method should retrieve $this->getArgument('result', []). You use that getResults()method in your ImportModel, line 69.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions