@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $e = new Element('p'); |
| 18 | 18 | $this->assertEquals('<p></p>', $e->__toString()); |
| 19 | 19 | |
| 20 | - foreach(Element::VOID_ELEMENTS as $tag){ |
|
| 20 | + foreach (Element::VOID_ELEMENTS as $tag) { |
|
| 21 | 21 | $e = new Element($tag); |
| 22 | 22 | $this->assertEquals('<'.$tag.'/>', $e->__toString()); |
| 23 | 23 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $e = new Element('p', $message); |
| 31 | 31 | $this->assertEquals('<p>'.$message.'</p>', $e->__toString()); |
| 32 | 32 | |
| 33 | - foreach(Element::VOID_ELEMENTS as $tag){ |
|
| 33 | + foreach (Element::VOID_ELEMENTS as $tag) { |
|
| 34 | 34 | $e = new Element($tag, $message); |
| 35 | 35 | $this->assertEquals('<'.$tag.'/>', $e->__toString()); |
| 36 | 36 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $e = new Element('p', $message); |
| 41 | 41 | $this->assertEquals('<p></p>', $e->__toString()); |
| 42 | 42 | |
| 43 | - foreach(Element::VOID_ELEMENTS as $tag){ |
|
| 43 | + foreach (Element::VOID_ELEMENTS as $tag) { |
|
| 44 | 44 | $e = new Element($tag, $message); |
| 45 | 45 | $this->assertEquals('<'.$tag.'/>', $e->__toString()); |
| 46 | 46 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $e = new Element('p', $message); |
| 50 | 50 | $this->assertEquals('<p></p>', $e->__toString()); |
| 51 | 51 | |
| 52 | - foreach(Element::VOID_ELEMENTS as $tag){ |
|
| 52 | + foreach (Element::VOID_ELEMENTS as $tag) { |
|
| 53 | 53 | $e = new Element($tag, $message); |
| 54 | 54 | $this->assertEquals('<'.$tag.'/>', $e->__toString()); |
| 55 | 55 | } |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | $message = 'lorem ipsum'; |
| 61 | 61 | $attributes = ['id' => 'test_id']; |
| 62 | 62 | |
| 63 | - $e = new Element('p', $message, $attributes); |
|
| 63 | + $e = new Element('p', $message, $attributes); |
|
| 64 | 64 | $this->assertEquals('<p id="test_id">'.$message.'</p>', $e->__toString()); |
| 65 | 65 | |
| 66 | - foreach(Element::VOID_ELEMENTS as $tag){ |
|
| 67 | - $e = new Element($tag, $message, $attributes); |
|
| 66 | + foreach (Element::VOID_ELEMENTS as $tag) { |
|
| 67 | + $e = new Element($tag, $message, $attributes); |
|
| 68 | 68 | $this->assertEquals('<'.$tag.' id="test_id"/>', $e->__toString()); |
| 69 | 69 | } |
| 70 | 70 | } |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | $message = 'lorem ipsum'; |
| 75 | 75 | $attributes = ['id' => 'test_id', 'checked', 'class' => 'test_class', 'required']; |
| 76 | 76 | |
| 77 | - $e = new Element('p', $message, $attributes); |
|
| 77 | + $e = new Element('p', $message, $attributes); |
|
| 78 | 78 | $this->assertEquals('<p id="test_id" checked class="test_class" required>'.$message.'</p>', $e->__toString()); |
| 79 | 79 | |
| 80 | - foreach(Element::VOID_ELEMENTS as $tag){ |
|
| 81 | - $e = new Element($tag, $message, $attributes); |
|
| 80 | + foreach (Element::VOID_ELEMENTS as $tag) { |
|
| 81 | + $e = new Element($tag, $message, $attributes); |
|
| 82 | 82 | $this->assertEquals('<'.$tag.' id="test_id" checked class="test_class" required/>', $e->__toString()); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | $message = 'lorem ipsum'; |
| 89 | 89 | $attributes = ['id' => 'test_id', 'class' => 'test_class', 'style="color:red;"']; |
| 90 | - $e = new Element('p', $message, $attributes); |
|
| 90 | + $e = new Element('p', $message, $attributes); |
|
| 91 | 91 | $this->assertEquals('<p id="test_id" class="test_class" style="color:red;">'.$message.'</p>', $e->__toString()); |
| 92 | 92 | |
| 93 | - $attributes = ['class' => 'test_class', 'style="color:red;"','id' => 'test_id']; |
|
| 94 | - $e = new Element('p', $message, $attributes); |
|
| 93 | + $attributes = ['class' => 'test_class', 'style="color:red;"', 'id' => 'test_id']; |
|
| 94 | + $e = new Element('p', $message, $attributes); |
|
| 95 | 95 | $this->assertEquals('<p class="test_class" style="color:red;" id="test_id">'.$message.'</p>', $e->__toString()); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -100,13 +100,13 @@ discard block |
||
| 100 | 100 | $message = 'lorem ipsum'; |
| 101 | 101 | $attributes = ['id' => 'test_id', 'checked', 'class' => 'test_class', 'required']; |
| 102 | 102 | |
| 103 | - $e = new Element('p', $message, $attributes); |
|
| 104 | - $e_stat = Element::p($message, $attributes); |
|
| 103 | + $e = new Element('p', $message, $attributes); |
|
| 104 | + $e_stat = Element::p($message, $attributes); |
|
| 105 | 105 | $this->assertEquals($e->__toString(), $e_stat); |
| 106 | 106 | |
| 107 | - foreach(Element::VOID_ELEMENTS as $tag){ |
|
| 108 | - $e = new Element($tag, $message, $attributes); |
|
| 109 | - $e_stat = Element::$tag($message, $attributes); |
|
| 107 | + foreach (Element::VOID_ELEMENTS as $tag) { |
|
| 108 | + $e = new Element($tag, $message, $attributes); |
|
| 109 | + $e_stat = Element::$tag($message, $attributes); |
|
| 110 | 110 | $this->assertEquals($e_stat, $e->__toString()); |
| 111 | 111 | } |
| 112 | 112 | } |
@@ -199,7 +199,7 @@ |
||
| 199 | 199 | $ret = ''; |
| 200 | 200 | foreach ($this->attributes as $k => $v) { |
| 201 | 201 | if ($this->isValidValue($v)) { |
| 202 | - $ret .= ' ' . ($this->isBooleanAttribute($k) ? $v : sprintf('%s="%s"', $k, $v)); |
|
| 202 | + $ret .= ' '.($this->isBooleanAttribute($k) ? $v : sprintf('%s="%s"', $k, $v)); |
|
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | return $ret; |