Passed
Push — master ( 1d27da...a57f3d )
by Jean-Christophe
02:11
created
Ajax/semantic/html/collections/form/HtmlFormInput.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
7 7
 class HtmlFormInput extends HtmlFormField {
8 8
 	use TextFieldsTrait;
9 9
 
10
-	public function __construct($identifier, $label = NULL, $type = "text", $value = NULL, $placeholder = NULL) {
11
-		if (! isset($placeholder) && $type === "text")
12
-			$placeholder = $label;
13
-		parent::__construct("field-" . $identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
14
-		$this->_identifier = $identifier;
10
+	public function __construct($identifier, $label=NULL, $type="text", $value=NULL, $placeholder=NULL) {
11
+		if (!isset($placeholder) && $type==="text")
12
+			$placeholder=$label;
13
+		parent::__construct("field-".$identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
14
+		$this->_identifier=$identifier;
15 15
 	}
16 16
 
17 17
 	public function getDataField() {
18
-		$field = $this->getField();
18
+		$field=$this->getField();
19 19
 		if ($field instanceof HtmlInput)
20
-			$field = $field->getDataField();
20
+			$field=$field->getDataField();
21 21
 		return $field;
22 22
 	}
23 23
 
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 	 *
27 27
 	 * @param string $keyIcon
28 28
 	 */
29
-	public function asPassword($keyIcon = 'key') {
29
+	public function asPassword($keyIcon='key') {
30 30
 		$this->setInputType('password');
31
-		if ($keyIcon != '') {
31
+		if ($keyIcon!='') {
32 32
 			$this->addIcon($keyIcon);
33 33
 		}
34 34
 	}
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 	 * @param string $slashIcon
42 42
 	 * @return mixed|\Ajax\semantic\html\elements\HtmlButton
43 43
 	 */
44
-	public function addTogglePasswordAction($buttonIcon = 'eye', $keyIcon = 'key', $slashIcon = 'slash') {
44
+	public function addTogglePasswordAction($buttonIcon='eye', $keyIcon='key', $slashIcon='slash') {
45 45
 		$this->asPassword($keyIcon);
46
-		$action = $this->addAction('see');
46
+		$action=$this->addAction('see');
47 47
 		$action->asIcon($buttonIcon);
48
-		$action->onClick('$(this).find(".icon").toggleClass("' . $slashIcon . '");$(this).closest(".field").find("input").attr("type",(_,attr)=>(attr=="text")?"password":"text")');
48
+		$action->onClick('$(this).find(".icon").toggleClass("'.$slashIcon.'");$(this).closest(".field").find("input").attr("type",(_,attr)=>(attr=="text")?"password":"text")');
49 49
 		return $action;
50 50
 	}
51 51
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,16 +8,18 @@
 block discarded – undo
8 8
 	use TextFieldsTrait;
9 9
 
10 10
 	public function __construct($identifier, $label = NULL, $type = "text", $value = NULL, $placeholder = NULL) {
11
-		if (! isset($placeholder) && $type === "text")
12
-			$placeholder = $label;
11
+		if (! isset($placeholder) && $type === "text") {
12
+					$placeholder = $label;
13
+		}
13 14
 		parent::__construct("field-" . $identifier, new HtmlInput($identifier, $type, $value, $placeholder), $label);
14 15
 		$this->_identifier = $identifier;
15 16
 	}
16 17
 
17 18
 	public function getDataField() {
18 19
 		$field = $this->getField();
19
-		if ($field instanceof HtmlInput)
20
-			$field = $field->getDataField();
20
+		if ($field instanceof HtmlInput) {
21
+					$field = $field->getDataField();
22
+		}
21 23
 		return $field;
22 24
 	}
23 25
 
Please login to merge, or discard this patch.