Skip to content

Commit 4264dcd

Browse files
committed
BaseControl::setAttribute() and setType() marked as deprecated
1 parent 7d98a42 commit 4264dcd

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

src/Forms/Controls/BaseControl.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,20 +350,17 @@ public function getHtmlId()
350350
*/
351351
public function setHtmlAttribute($name, $value = TRUE)
352352
{
353-
return $this->setAttribute($name, $value);
353+
$this->control->$name = $value;
354+
return $this;
354355
}
355356

356357

357358
/**
358-
* Alias for setHtmlAttribute()
359-
* @param string name
360-
* @param mixed value
361-
* @return static
359+
* @deprecated use setHtmlAttribute()
362360
*/
363361
public function setAttribute($name, $value = TRUE)
364362
{
365-
$this->control->$name = $value;
366-
return $this;
363+
return $this->setHtmlAttribute($name, $value);
367364
}
368365

369366

src/Forms/Controls/TextInput.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,17 @@ public function loadHttpData()
4848
*/
4949
public function setHtmlType($type)
5050
{
51-
return $this->setType($type);
51+
$this->control->type = $type;
52+
return $this;
5253
}
5354

5455

5556
/**
56-
* Alias for setHtmlType()
57-
* @param string
58-
* @return static
57+
* @deprecated use setHtmlType()
5958
*/
6059
public function setType($type)
6160
{
62-
$this->control->type = $type;
63-
return $this;
61+
return $this->setHtmlType($type);
6462
}
6563

6664

0 commit comments

Comments
 (0)