From 56d941e1092232ad9f00025cf1a503bc1f50a620 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet@fusiondirectory.org>
Date: Tue, 4 Aug 2020 12:10:20 +0200
Subject: [PATCH] :ambulance: fix(core) Remove typing on setParent to please
 older PHP version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

PHP<7.2 do not like changing typing of the attribute in inheriting
 classes, even if it’s to a larger constraint.

issue #6106
---
 include/management/snapshot/class_SnapshotAttribute.inc         | 2 +-
 include/simpleplugin/attributes/class_BaseSelectorAttribute.inc | 2 +-
 include/simpleplugin/attributes/class_CompositeAttribute.inc    | 2 +-
 include/simpleplugin/attributes/class_FlagsAttribute.inc        | 2 +-
 include/simpleplugin/attributes/class_ObjectSelectAttribute.inc | 2 +-
 include/simpleplugin/attributes/class_SelectAttribute.inc       | 2 +-
 include/simpleplugin/attributes/class_SetAttribute.inc          | 2 +-
 .../simpleplugin/attributes/dialog/class_ObjectAttribute.inc    | 2 +-
 include/simpleplugin/class_Attribute.inc                        | 2 +-
 plugins/personal/generic/class_UserPasswordAttribute.inc        | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/management/snapshot/class_SnapshotAttribute.inc b/include/management/snapshot/class_SnapshotAttribute.inc
index 55acc3095..17c22fd8e 100644
--- a/include/management/snapshot/class_SnapshotAttribute.inc
+++ b/include/management/snapshot/class_SnapshotAttribute.inc
@@ -34,7 +34,7 @@ class SnapshotsAttribute extends OrderedArrayAttribute
     $this->setInLdap(FALSE);
   }
 
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     if (is_object($this->plugin)) {
diff --git a/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc b/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc
index 326dcf38f..19644d559 100644
--- a/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc
+++ b/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc
@@ -51,7 +51,7 @@ class BaseSelectorAttribute extends Attribute
     trigger_error('method setManagedAttributes is not supported for BaseSelectorAttribute');
   }
 
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     if (is_object($this->plugin)) {
diff --git a/include/simpleplugin/attributes/class_CompositeAttribute.inc b/include/simpleplugin/attributes/class_CompositeAttribute.inc
index e8408a3d7..64570f480 100644
--- a/include/simpleplugin/attributes/class_CompositeAttribute.inc
+++ b/include/simpleplugin/attributes/class_CompositeAttribute.inc
@@ -80,7 +80,7 @@ class CompositeAttribute extends Attribute
     unset($attribute);
   }
 
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     foreach ($this->attributes as &$attribute) {
diff --git a/include/simpleplugin/attributes/class_FlagsAttribute.inc b/include/simpleplugin/attributes/class_FlagsAttribute.inc
index 7132e01d4..8d5a30755 100644
--- a/include/simpleplugin/attributes/class_FlagsAttribute.inc
+++ b/include/simpleplugin/attributes/class_FlagsAttribute.inc
@@ -38,7 +38,7 @@ class FlagsAttribute extends StringAttribute
     $this->flags = $flags;
   }
 
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     if (is_object($this->plugin)) {
diff --git a/include/simpleplugin/attributes/class_ObjectSelectAttribute.inc b/include/simpleplugin/attributes/class_ObjectSelectAttribute.inc
index 39420edd3..bbdd4f787 100644
--- a/include/simpleplugin/attributes/class_ObjectSelectAttribute.inc
+++ b/include/simpleplugin/attributes/class_ObjectSelectAttribute.inc
@@ -43,7 +43,7 @@ class ObjectSelectAttribute extends SelectAttribute
     $this->objectFilter = $objectFilter;
   }
 
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     if (is_object($this->plugin)) {
diff --git a/include/simpleplugin/attributes/class_SelectAttribute.inc b/include/simpleplugin/attributes/class_SelectAttribute.inc
index a7a8a971b..b55e36da2 100644
--- a/include/simpleplugin/attributes/class_SelectAttribute.inc
+++ b/include/simpleplugin/attributes/class_SelectAttribute.inc
@@ -240,7 +240,7 @@ class SelectAttribute extends Attribute
     $this->size = $size;
   }
 
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     if ($this->isTemplate() && !in_array('%askme%', $this->choices)) {
diff --git a/include/simpleplugin/attributes/class_SetAttribute.inc b/include/simpleplugin/attributes/class_SetAttribute.inc
index e9952106e..268f3a5aa 100644
--- a/include/simpleplugin/attributes/class_SetAttribute.inc
+++ b/include/simpleplugin/attributes/class_SetAttribute.inc
@@ -349,7 +349,7 @@ class SetAttribute extends Attribute
    *
    *  \param simplePlugin &$plugin The parent plugin
    */
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     if ($this->attribute !== FALSE) {
diff --git a/include/simpleplugin/attributes/dialog/class_ObjectAttribute.inc b/include/simpleplugin/attributes/dialog/class_ObjectAttribute.inc
index 5984a72af..713619534 100644
--- a/include/simpleplugin/attributes/dialog/class_ObjectAttribute.inc
+++ b/include/simpleplugin/attributes/dialog/class_ObjectAttribute.inc
@@ -37,7 +37,7 @@ class ObjectAttribute extends DialogButtonAttribute
     $this->objectType   = $objectType;
   }
 
-  function setParent (simplePlugin &$plugin)
+  function setParent (&$plugin)
   {
     parent::setParent($plugin);
     $infos = objects::infos($this->objectType);
diff --git a/include/simpleplugin/class_Attribute.inc b/include/simpleplugin/class_Attribute.inc
index 6daa9f195..516807ebd 100644
--- a/include/simpleplugin/class_Attribute.inc
+++ b/include/simpleplugin/class_Attribute.inc
@@ -115,7 +115,7 @@ class Attribute
    *
    *  \param SimpleTab &$plugin The parent plugin
    */
-  function setParent (SimpleTab &$plugin)
+  function setParent (&$plugin)
   {
     $this->plugin = $plugin;
     $this->manageAttributes($this->getValue());
diff --git a/plugins/personal/generic/class_UserPasswordAttribute.inc b/plugins/personal/generic/class_UserPasswordAttribute.inc
index 2373a5638..9337e4951 100644
--- a/plugins/personal/generic/class_UserPasswordAttribute.inc
+++ b/plugins/personal/generic/class_UserPasswordAttribute.inc
@@ -69,7 +69,7 @@ class UserPasswordAttribute extends CompositeAttribute
     $this->attributes[4]->setTemplatable(FALSE);
   }
 
-  public function setParent (simplePlugin &$plugin)
+  public function setParent (&$plugin)
   {
     global $config;
     parent::setParent($plugin);
-- 
GitLab