aboutsummaryrefslogtreecommitdiff
path: root/lib/classes
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2022-11-24 10:29:24 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2022-11-24 10:29:24 +0000
commit7dddea8ccca601bf2da28960f2e27a223fe60ea6 (patch)
treeb34ee92f9a4e0e4c1f7e4dcf5f15b396f9097d6f /lib/classes
parent1231022837beceedef376e4bb8084ff38fbc7d93 (diff)
rework aux lock rules, use sorm model, deprecate old class and let name and description be translatable, fixes #1791
Closes #1791 Merge request studip/studip!1177
Diffstat (limited to 'lib/classes')
-rw-r--r--lib/classes/AuxLockRules.class.php3
-rw-r--r--lib/classes/Markup.class.php2
-rw-r--r--lib/classes/StudipArrayObject.class.php8
-rw-r--r--lib/classes/WidgetContainer.php5
4 files changed, 15 insertions, 3 deletions
diff --git a/lib/classes/AuxLockRules.class.php b/lib/classes/AuxLockRules.class.php
index 6a6dfd9..4d06ca2 100644
--- a/lib/classes/AuxLockRules.class.php
+++ b/lib/classes/AuxLockRules.class.php
@@ -23,6 +23,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+/**
+ * @deprecated since Stud.IP 5.3
+ */
class AuxLockRules
{
diff --git a/lib/classes/Markup.class.php b/lib/classes/Markup.class.php
index af298be..0f5a5c8 100644
--- a/lib/classes/Markup.class.php
+++ b/lib/classes/Markup.class.php
@@ -233,7 +233,7 @@ class Markup
* Create HTML purifier instance with Stud.IP-specific configuration.
*
* @param boolean $autoformat Apply the AutoFormat rules
- * @return HTMLPurifier A new instance of the HTML purifier.
+ * @return \HTMLPurifier A new instance of the HTML purifier.
*/
private static function createPurifier($autoformat)
{
diff --git a/lib/classes/StudipArrayObject.class.php b/lib/classes/StudipArrayObject.class.php
index bb5444c..f025ffb 100644
--- a/lib/classes/StudipArrayObject.class.php
+++ b/lib/classes/StudipArrayObject.class.php
@@ -436,4 +436,12 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable,
throw new InvalidArgumentException("{$key} is a protected property, use a different key");
}
}
+
+ /**
+ * Returns whether the given value is in the underlying array.
+ */
+ public function contains($value): bool
+ {
+ return in_array($value, $this->storage);
+ }
}
diff --git a/lib/classes/WidgetContainer.php b/lib/classes/WidgetContainer.php
index b4aaa8c..108477a 100644
--- a/lib/classes/WidgetContainer.php
+++ b/lib/classes/WidgetContainer.php
@@ -46,10 +46,11 @@ abstract class WidgetContainer
/**
* Add a widget to the container.
*
- * @param Widget $widget The actual widget
+ * @template W of Widget
+ * @param W $widget The actual widget
* @param String $index Optional index/name of the widget, defaults to
* class name without "widget"
- * @return Widget The added widget to allow for easier handling
+ * @return W The added widget to allow for easier handling
*/
public function addWidget(Widget $widget, $index = null)
{