Back to WebAssetRegistryAssetChanged class

Method setSubject

protected \Joomla\CMS\WebAsset\WebAssetRegistryInterface
setSubject
(mixed $value)
Setter for the subject argument
Parameters
  • \Joomla\CMS\WebAsset\WebAssetRegistryInterface $value The value to set
Returns
  • \Joomla\CMS\WebAsset\WebAssetRegistryInterface
Since
  • 4.0.0
-
  • \BadMethodCallException if the argument is not of the expected type

Method setSubject - Source code

/**
 * Setter for the subject argument
 *
 * @param   WebAssetRegistryInterface  $value  The value to set
 *
 * @return  WebAssetRegistryInterface
 *
 * @throws  BadMethodCallException  if the argument is not of the expected type
 *
 * @since  4.0.0
 */
protected function setSubject($value)
{
    if (!$value || !$value instanceof WebAssetRegistryInterface) {
        throw new BadMethodCallException("Argument 'subject' of event {$this->name} is not of the expected type");
    }
    return $value;
}