Skip to content
Snippets Groups Projects
Commit abaeff3a authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #1340 from micgro42/closedTagFix

Form TagCloseElements should conform to expectations of functions inherited from Element
parents a22471d1 be4223af
No related branches found
No related tags found
No related merge requests found
......@@ -34,11 +34,15 @@ class TagCloseElement extends ValueElement {
* do not call this
*
* @param $id
* @return void
* @return string
* @throws \BadMethodCallException
*/
public function id($id = null) {
throw new \BadMethodCallException('You can\t add ID to closing tag');
if ($id === null) {
return '';
} else {
throw new \BadMethodCallException('You can\t add ID to closing tag');
}
}
/**
......@@ -46,22 +50,30 @@ class TagCloseElement extends ValueElement {
*
* @param $name
* @param $value
* @return void
* @return string
* @throws \BadMethodCallException
*/
public function attr($name, $value = null) {
throw new \BadMethodCallException('You can\t add attributes to closing tag');
if ($value === null) {
return '';
} else {
throw new \BadMethodCallException('You can\t add attributes to closing tag');
}
}
/**
* do not call this
*
* @param $attributes
* @return void
* @return array
* @throws \BadMethodCallException
*/
public function attrs($attributes = null) {
throw new \BadMethodCallException('You can\t add attributes to closing tag');
if ($attributes === null) {
return array();
} else {
throw new \BadMethodCallException('You can\t add attributes to closing tag');
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment