aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-08-17 12:00:27 +0000
committerElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2023-08-17 12:00:27 +0000
commit387d02b40ce6cc27777bb0c1df1e01cc49c45f41 (patch)
tree13104b1a776598151a0460ce1bba8b1b8584f5f1 /lib
parentb192f35c0716210db45892b8ba9ec50bda8ccf47 (diff)
revert API change, fixes #2949
Closes #2949 Merge request studip/studip!2040
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/forms/Part.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/classes/forms/Part.php b/lib/classes/forms/Part.php
index 1d1c9d0..3609eb4 100644
--- a/lib/classes/forms/Part.php
+++ b/lib/classes/forms/Part.php
@@ -67,13 +67,13 @@ abstract class Part
/**
* Adds an Input to this Part.
* @param Input $input
- * @return $this
+ * @return Input
*/
public function addInput(Input $input)
{
$input->setParent($this);
$this->parts[] = $input;
- return $this;
+ return $input;
}
/**
@@ -81,15 +81,15 @@ abstract class Part
*
* @param string $text The text to be added.
* @param bool $text_is_html Whether the text is HTML (true) or plain text (false). Defaults to true.
- * @return $this
+ * @return Text The added text form part.
*/
- public function addText(string $text, bool $text_is_html = true)
+ public function addText(string $text, bool $text_is_html = true): Text
{
$text_part = new Text();
$text_part->setText($text, $text_is_html);
$text_part->setParent($this);
$this->parts[] = $text_part;
- return $this;
+ return $text_part;
}
/**
@@ -100,16 +100,16 @@ abstract class Part
* @param \Icon|null $icon The icon to be used for the link.
* @param array $attributes Additional link attributes.
*
- * @return $this
+ * @return Link The Text form element containing the link as HTML.
*/
- public function addLink(string $title, string $url, ?\Icon $icon = null, array $attributes = [])
+ public function addLink(string $title, string $url, ?\Icon $icon = null, array $attributes = []): Link
{
$link = new Link($url, $title, $icon);
$link->setAttributes($attributes);
$this->addPart($link);
- return $this;
+ return $link;
}
/**