for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ORM\Entity;
trait EventHandlers
{
/**
* Empty event handler
*
* Get called when the entity get initialized.
* @param bool $new Whether or not the entity is new or from database
* @codeCoverageIgnore dummy event handler
*/
public function onInit($new)
$new
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function onInit(/** @scrutinizer ignore-unused */ $new)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
}
* Get called when something is changed with magic setter.
* @param string $attribute The variable that got changed.merge(node.inheritedProperties)
* @param mixed $oldValue The old value of the variable
* @param mixed $value The new value of the variable
public function onChange($attribute, $oldValue, $value)
$value
public function onChange($attribute, $oldValue, /** @scrutinizer ignore-unused */ $value)
$oldValue
public function onChange($attribute, /** @scrutinizer ignore-unused */ $oldValue, $value)
$attribute
public function onChange(/** @scrutinizer ignore-unused */ $attribute, $oldValue, $value)
* Get called before the entity get inserted in database.
public function prePersist()
* Get called before the entity get updated in database.
public function preUpdate()
* Get called after the entity got inserted in database.
public function postPersist()
* Get called after the entity got updated in database.
public function postUpdate()
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.