Skip to content

Commit

Permalink
Fix getLabel() return type (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-worman authored Jul 7, 2023
1 parent 3f9b225 commit 9ff20ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
4 changes: 1 addition & 3 deletions packages/zend-dojo/library/Zend/Dojo/Form/Element/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ public function __construct($spec, $options = null)
* If no label is present, returns the currently set name.
*
* If a translator is present, returns the translated label.
*
* @return string
*/
public function getLabel()
public function getLabel(): string|null
{
$value = parent::getLabel();

Expand Down
7 changes: 1 addition & 6 deletions packages/zend-form/library/Zend/Form/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,7 @@ public function setLabel($label)
return $this;
}

/**
* Retrieve element label
*
* @return string
*/
public function getLabel()
public function getLabel(): string|null
{
$translator = $this->getTranslator();
if (null !== $translator) {
Expand Down
6 changes: 2 additions & 4 deletions packages/zend-form/library/Zend/Form/Element/Hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ public function getTimeout()

/**
* Override getLabel() to always be empty
*
* @return null
*/
public function getLabel()
public function getLabel(): string|null
{
return null;
}
Expand Down Expand Up @@ -251,7 +249,7 @@ public function render(Zend_View_Interface $view = null)
*/
protected function _generateHash()
{
$this->_hash = md5((string)
$this->_hash = md5((string)
Zend_Crypt_Math::randBytes(32)
);
$this->setValue($this->_hash);
Expand Down
4 changes: 1 addition & 3 deletions packages/zend-form/library/Zend/Form/Element/Submit.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ public function __construct($spec, $options = null)
* If no label is present, returns the currently set name.
*
* If a translator is present, returns the translated label.
*
* @return string
*/
public function getLabel()
public function getLabel(): string|null
{
$value = parent::getLabel();

Expand Down

0 comments on commit 9ff20ae

Please sign in to comment.