/** * @throws RunTimeException when content as already been added * @param string $name * @param string $value default null * @return ScriptTag */ public function addAttribute($name, $value = null) { if ('src' === $name && !$this->isEmpty()) { $err = 'can not add a source attribute to a script with content'; throw new RunTimeException($err); } return parent::addAttribute($name, $value); }