Skip to content

Commit 92380b9

Browse files
committed
BaseControl::setAttribute() and setType() marked as deprecated
1 parent 47053c3 commit 92380b9

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Forms/Controls/BaseControl.php

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

336337

337338
/**
338-
* Alias for setHtmlAttribute()
339+
* @deprecated use setHtmlAttribute()
339340
* @return static
340341
*/
341342
public function setAttribute(string $name, $value = TRUE)
342343
{
343-
$this->control->$name = $value;
344-
return $this;
344+
return $this->setHtmlAttribute($name, $value);
345345
}
346346

347347

src/Forms/Controls/TextInput.php

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

5253

5354
/**
54-
* Alias for setHtmlType()
55+
* @deprecated use setHtmlType()
5556
* @return static
5657
*/
5758
public function setType(string $type)
5859
{
59-
$this->control->type = $type;
60-
return $this;
60+
return $this->setHtmlType($type);
6161
}
6262

6363

0 commit comments

Comments
 (0)