aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2016-04-07 10:14:00 +0200
committerAndreas Gohr <andi@splitbrain.org>2016-04-07 10:14:00 +0200
commitabaeff3a0c367fb29bc3f1d4b98efde56f7050f5 (patch)
tree9864eb2c287af88fbe07e6d2007ff8499912709f /inc
parenta22471d12799eaccea129e10da5a5d528e4f18c6 (diff)
parentbe4223af833fefca06bd114d7e420ee7071a817e (diff)
downloaddokuwiki-abaeff3a0c367fb29bc3f1d4b98efde56f7050f5.tar.gz
dokuwiki-abaeff3a0c367fb29bc3f1d4b98efde56f7050f5.zip
Merge pull request #1340 from micgro42/closedTagFix
Form TagCloseElements should conform to expectations of functions inherited from Element
Diffstat (limited to 'inc')
-rw-r--r--inc/Form/TagCloseElement.php24
1 files changed, 18 insertions, 6 deletions
diff --git a/inc/Form/TagCloseElement.php b/inc/Form/TagCloseElement.php
index dc0264c21..252c1af77 100644
--- a/inc/Form/TagCloseElement.php
+++ b/inc/Form/TagCloseElement.php
@@ -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');
+ }
}
/**