} /** * Constructor. Overridden to go through the argument setters. * * @param string $name The event name. * @param array $arguments The event arguments. * * @since 4.0.0 */ public function __construct(string $name, array $arguments = []) { parent::__construct($name, $arguments); foreach ($arguments as $argumentName => $value) { $this->setArgument($argumentName, $value); } } /** * Get an event argument value. * It will use a pre-processing method if one exists. The method has the signature: * * onGet($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) { // B/C check for numeric access to named argument, eg $event->getArgument('0'). if (is_numeric($name)) { if (key($this->arguments) != 0) { $argNames = array_keys($this->arguments); $name = $argNames[$name] ?? ''; } @trigger_error( \sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 7. Event %s argument %s', \get_class($this), $name ), E_USER_DEPRECATED ); } // Look for the method for the value pre-processing/validation $ucfirst = ucfirst($name); $methodName1 = 'onGet' . $ucfirst; $methodName2 = 'get' . $ucfirst; $value = parent::getArgument($name, $default); if (method_exists($this, $methodName1)) { return $this->{$methodName1}($value); } if (method_exists($this, $methodName2)) { @trigger_error( \sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 7. Use "%s" instead. Event %s', $methodName2, $methodName1, \get_class($this) ), E_USER_DEPRECATED ); return $this->{$methodName2}($value); } return $value; } /** * Add argument to event. * It will use a pre-processing method if one exists. The method has the signature: * * onSet($value): mixed * * where: * * $value is the value being set by the user * It returns the value to return to set in the $arguments array of the event. * * @param string $name Argument name. * @param mixed $value Value. * * @return $this * * @since 4.0.0 */ public function setArgument($name, $value) { // B/C check for numeric access to named argument, eg $event->setArgument('0', $value). if (is_numeric($name)) { if (key($this->arguments) != 0) { $argNames = array_keys($this->arguments); $name = $argNames[$name] ?? ''; } @trigger_error( \sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 7. Event %s argument %s', \get_class($this), $name ), E_USER_DEPRECATED ); } // Look for the method for the value pre-processing/validation $ucfirst = ucfirst($name); $methodName1 = 'onSet' . $ucfirst; $methodName2 = 'set' . $ucfirst; if (method_exists($this, $methodName1)) { $value = $this->{$methodName1}($value); } elseif (method_exists($this, $methodName2)) { @trigger_error( \sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 7. Use "%s" instead. Event %s', $methodName2, $methodName1, \get_class($this) ), E_USER_DEPRECATED ); $value = $this->{$methodName2}($value); } return parent::setArgument($name, $value); } } } /** * Constructor. Overridden to go through the argument setters. * * @param string $name The event name. * @param array $arguments The event arguments. * * @since 4.0.0 */ public function __construct(string $name, array $arguments = []) { parent::__construct($name, $arguments); foreach ($arguments as $argumentName => $value) { $this->setArgument($argumentName, $value); } } /** * Get an event argument value. * It will use a pre-processing method if one exists. The method has the signature: * * onGet($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) { // B/C check for numeric access to named argument, eg $event->getArgument('0'). if (is_numeric($name)) { if (key($this->arguments) != 0) { $argNames = array_keys($this->arguments); $name = $argNames[$name] ?? ''; } @trigger_error( \sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 7. Event %s argument %s', \get_class($this), $name ), E_USER_DEPRECATED ); } // Look for the method for the value pre-processing/validation $ucfirst = ucfirst($name); $methodName1 = 'onGet' . $ucfirst; $methodName2 = 'get' . $ucfirst; $value = parent::getArgument($name, $default); if (method_exists($this, $methodName1)) { return $this->{$methodName1}($value); } if (method_exists($this, $methodName2)) { @trigger_error( \sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 7. Use "%s" instead. Event %s', $methodName2, $methodName1, \get_class($this) ), E_USER_DEPRECATED ); return $this->{$methodName2}($value); } return $value; } /** * Add argument to event. * It will use a pre-processing method if one exists. The method has the signature: * * onSet($value): mixed * * where: * * $value is the value being set by the user * It returns the value to return to set in the $arguments array of the event. * * @param string $name Argument name. * @param mixed $value Value. * * @return $this * * @since 4.0.0 */ public function setArgument($name, $value) { // B/C check for numeric access to named argument, eg $event->setArgument('0', $value). if (is_numeric($name)) { if (key($this->arguments) != 0) { $argNames = array_keys($this->arguments); $name = $argNames[$name] ?? ''; } @trigger_error( \sprintf( 'Numeric access to named event arguments is deprecated, and will not work in Joomla 7. Event %s argument %s', \get_class($this), $name ), E_USER_DEPRECATED ); } // Look for the method for the value pre-processing/validation $ucfirst = ucfirst($name); $methodName1 = 'onSet' . $ucfirst; $methodName2 = 'set' . $ucfirst; if (method_exists($this, $methodName1)) { $value = $this->{$methodName1}($value); } elseif (method_exists($this, $methodName2)) { @trigger_error( \sprintf( 'Use method "%s" for value pre-processing is deprecated, and will not work in Joomla 7. Use "%s" instead. Event %s', $methodName2, $methodName1, \get_class($this) ), E_USER_DEPRECATED ); $value = $this->{$methodName2}($value); } return parent::setArgument($name, $value); } } An Error Occurred: Whoops, looks like something went wrong.

Sorry, there was a problem we could not recover from.

The server returned a "500 - Whoops, looks like something went wrong."

Help me resolve this