/**
* Get an event argument value. It will use a getter method if one exists. The getters have the signature:
*
* get<ArgumentName>($value): mixed
*
* where:
*
* $value is the value currently stored in the $arguments array of the event
* It returns the value to return to the caller.
*
* @param string $name The argument name.
* @param mixed $default The default value if not found.
*
* @return mixed The argument value or the default value.
*
* @since 4.0.0
*/
public function getArgument($name, $default = null)
{
$methodName = 'get' . ucfirst($name);
$value = parent::getArgument($name, $default);
if (method_exists($this, $methodName)) {
return $this->{$methodName}($value);
}
return $value;
}