Skip to content

Commit 27785a8

Browse files
committed
BaseControl::setAttribute() and setType() marked as deprecated
1 parent d246681 commit 27785a8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Forms/Controls/BaseControl.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,18 +329,18 @@ public function getHtmlId()
329329
*/
330330
public function setHtmlAttribute(string $name, $value = TRUE)
331331
{
332-
return $this->setAttribute($name, $value);
332+
$this->control->$name = $value;
333+
return $this;
333334
}
334335

335336

336337
/**
337-
* Alias for setHtmlAttribute()
338+
* @deprecated use setHtmlAttribute()
338339
* @return static
339340
*/
340341
public function setAttribute(string $name, $value = TRUE)
341342
{
342-
$this->control->$name = $value;
343-
return $this;
343+
return $this->setHtmlAttribute($name, $value);
344344
}
345345

346346

src/Forms/Controls/TextInput.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ public function loadHttpData(): void
4545
*/
4646
public function setHtmlType(string $type)
4747
{
48-
return $this->setType($type);
48+
$this->control->type = $type;
49+
return $this;
4950
}
5051

5152

5253
/**
53-
* Alias for setHtmlType()
54+
* @deprecated use setHtmlType()
5455
* @return static
5556
*/
5657
public function setType(string $type)
5758
{
58-
$this->control->type = $type;
59-
return $this;
59+
return $this->setHtmlType($type);
6060
}
6161

6262

0 commit comments

Comments
 (0)