diff --git a/include/class_SnapshotDialogs.inc b/include/class_SnapshotDialogs.inc
index 9fbbe4f753ae3419af51f6724a503b0322f71b77..b5862888c7752920268d264e1aa04cd72f33e3b9 100644
--- a/include/class_SnapshotDialogs.inc
+++ b/include/class_SnapshotDialogs.inc
@@ -26,28 +26,28 @@ class SnapshotCreateDialog extends simplePlugin
 {
   public $aclCategory;
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName' => 'SnapshotCreateDialog',
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'main' => array(
         'name'  => _('Creating an object snapshot'),
         'attrs' => array(
-          new DisplayAttribute (
+          new DisplayAttribute(
             _('Object'), _('DN of the object you are creating a snapshot of'),
             'object_dn', FALSE
           ),
-          new DisplayAttribute (
+          new DisplayAttribute(
             _('Timestamp'), _('Timestamp of this snapshot creation'),
             'timestamp', FALSE
           ),
-          new TextAreaAttribute (
+          new TextAreaAttribute(
             _('Reason'), _('Reason for creating this snapshot'),
             'description', TRUE,
             '',
@@ -71,7 +71,7 @@ class SnapshotCreateDialog extends simplePlugin
    *
    * \param mixed $attr Attribute object or name (in this case it will be fetched from attributesAccess)
    */
-  function attrIsWriteable($attr)
+  function attrIsWriteable($attr): bool
   {
     global $ui;
 
@@ -100,7 +100,7 @@ class SnapshotCreateDialog extends simplePlugin
     return parent::renderAttributes($readOnly);
   }
 
-  function execute ()
+  function execute (): string
   {
     $this->timestamp  = date(_('Y-m-d, H:i:s'));
     $str = parent::execute();
@@ -113,7 +113,7 @@ class SnapshotCreateDialog extends simplePlugin
     return $str;
   }
 
-  function save ()
+  function save (): array
   {
     $this->parent->createSnapshot($this->object_dn, $this->description);
   }
@@ -243,25 +243,25 @@ class SnapshotRestoreDialog extends simplePlugin
   protected $snapDn;
   protected $snapAction;
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName' => 'SnapshotRestoreDialog',
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'main' => array(
         'name'  => _('Restoring snapshots'),
         'class' => array('fullwidth'),
         'attrs' => array(
-          new DisplayAttribute (
+          new DisplayAttribute(
             _('Object'), _('DN of the object you are creating a snapshot of'),
             'object_dn', FALSE
           ),
-          new SnapshotsAttribute (
+          new SnapshotsAttribute(
             _('Snapshots'), _('Existing snapshots for this object'),
             'snapshots', FALSE,
             array(),
@@ -295,7 +295,7 @@ class SnapshotRestoreDialog extends simplePlugin
     }
   }
 
-  function execute ()
+  function execute (): string
   {
     global $ui;
     if ($this->dialog == 'delete') {
@@ -349,7 +349,7 @@ class SnapshotRestoreDialog extends simplePlugin
     return $str;
   }
 
-  function attrIsWriteable($attr)
+  function attrIsWriteable($attr): bool
   {
     global $ui;
 
@@ -375,7 +375,7 @@ class SnapshotRestoreDialog extends simplePlugin
     $this->snapDn = $dn;
   }
 
-  function save_object()
+  function save_object ()
   {
     if ($this->dialog == 'delete') {
       if (isset($_POST['delete_confirmed'])) {
@@ -403,7 +403,7 @@ class SnapshotRestoreDialog extends simplePlugin
     $this->updateList();
   }
 
-  function save ()
+  function save (): array
   {
   }
 }
diff --git a/include/class_acl.inc b/include/class_acl.inc
index 6d6fb0075d9c014ff3cba87642f59f417774c4c5..94b1aa3a19171c67502cee0dd44d002573d7e1ac 100644
--- a/include/class_acl.inc
+++ b/include/class_acl.inc
@@ -29,7 +29,7 @@
  */
 class acl
 {
-  static function plInfo()
+  static function plInfo ()
   {
     return array(
       'plShortName'   => _('ACL'),
diff --git a/include/class_template.inc b/include/class_template.inc
index f827e7707b45ef48f81892ff5f08a717fa9b1b34..bc1ef52c152ef8740501bf7d7430815a38211166 100644
--- a/include/class_template.inc
+++ b/include/class_template.inc
@@ -37,7 +37,7 @@ class template
 
   static protected $uiSpecialAttributes = array('dn','cn','uid','sn','givenName');
 
-  static function plInfo()
+  static function plInfo ()
   {
     return array(
       'plShortName'   => _('Template'),
diff --git a/include/management/class_FilterElement.inc b/include/management/class_FilterElement.inc
index 6791d85febdec938018b0d5820bdfcda2f3380c6..c47596e185bc62c1363d9e960e5851e7e99203ac 100644
--- a/include/management/class_FilterElement.inc
+++ b/include/management/class_FilterElement.inc
@@ -26,7 +26,7 @@ class FilterElement
 {
   protected $parent;
 
-  public function __construct(managementFilter $parent)
+  public function __construct (managementFilter $parent)
   {
     $this->parent = $parent;
   }
diff --git a/include/management/class_ManagementConfigurationDialog.inc b/include/management/class_ManagementConfigurationDialog.inc
index a209f2eb3bb8cc0c912fb5acd06cf870ae52ab43..e48e2d2c827c52de65fbb8d0733308800068c0e3 100644
--- a/include/management/class_ManagementConfigurationDialog.inc
+++ b/include/management/class_ManagementConfigurationDialog.inc
@@ -32,14 +32,14 @@ class ManagementColumnAttribute extends CompositeAttribute
  */
 class ManagementConfigurationDialog extends simplePlugin
 {
-  static function plInfo ()
+  static function plInfo (): array
   {
     return array(
       'plShortName' => 'ManagementConfigurationDialog',
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     global $class_mapping;
 
@@ -57,8 +57,8 @@ class ManagementConfigurationDialog extends simplePlugin
         'class' => array('fullwidth'),
         'name'  => _('Management configuration'),
         'attrs' => array(
-          new OrderedArrayAttribute (
-            new ManagementColumnAttribute (
+          new OrderedArrayAttribute(
+            new ManagementColumnAttribute(
               _('Columns'),
               _('Columns displayed for this management list'),
               'managementColumns',
@@ -120,7 +120,7 @@ class ManagementConfigurationDialog extends simplePlugin
     $this->attributesAccess['managementColumns']->setValue($value);
   }
 
-  function attrIsWriteable($attr)
+  function attrIsWriteable($attr): bool
   {
     global $config, $ui;
 
@@ -134,7 +134,7 @@ class ManagementConfigurationDialog extends simplePlugin
     }
   }
 
-  function execute ()
+  function execute (): string
   {
     global $config, $ui;
 
@@ -151,7 +151,7 @@ class ManagementConfigurationDialog extends simplePlugin
     return $str;
   }
 
-  function save ()
+  function save (): array
   {
     global $config;
     $columnInfos  = array();
diff --git a/include/management/class_management.inc b/include/management/class_management.inc
index 7a09c9f62b9e3ff318271d6f996b980c4aba98eb..4f2b6cd6e398b4d7763ee4d8e03d94c8e8ef31a4 100644
--- a/include/management/class_management.inc
+++ b/include/management/class_management.inc
@@ -81,7 +81,7 @@ class management
   // Whether to display a header or not.
   protected $skipHeader = FALSE;
 
-  function __construct($objectTypes = FALSE)
+  function __construct ($objectTypes = FALSE)
   {
     global $config, $class_mapping;
 
@@ -418,7 +418,7 @@ class management
    * \brief  Execute this plugin
    *          Handle actions/events, locking, snapshots, dialogs, tabs,...
    */
-  function execute()
+  function execute (): string
   {
     // Ensure that html posts and gets are kept even if we see a 'Entry islocked' dialog.
     $vars = array('/^act$/','/^listing/','/^PID$/');
@@ -433,7 +433,7 @@ class management
     // Handle actions (POSTs and GETs)
     $action = $this->detectPostActions();
     if (!empty($action['action'])) {
-      @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action, 'Action');
+      @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action, 'Action');
       try {
         $str = $this->handleAction($action);
         if ($str) {
@@ -643,7 +643,7 @@ class management
       return;
     } else {
       if (!$cancel) {
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Template applied!');
+        @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Template applied!');
       }
       del_lock($this->currentDn);
       if (empty($this->currentDns)) {
@@ -686,7 +686,7 @@ class management
 
     // Open object
     $this->openTabObject(objects::create($type), $this->listing->getBase());
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Create entry initiated');
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Create entry initiated');
   }
 
   function newEntryTemplate(array $action)
@@ -806,7 +806,7 @@ class management
 
     // Open object
     $this->openTabObject(objects::open($this->currentDn, $entry->getTemplatedType()), $this->currentDn);
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Edit entry initiated');
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Edit entry initiated');
     if (isset($action['subaction'])
       && ($this->handleSubAction($action) === FALSE)) {
       trigger_error('Was not able to handle subaction: '.$action['subaction']);
@@ -846,7 +846,7 @@ class management
         msg_dialog::displayChecks($msgs);
         return;
       } else {
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry saved');
+        @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry saved');
         $this->remove_lock();
         $this->closeDialogs();
       }
@@ -858,7 +858,7 @@ class management
         return;
       } else {
         $this->dialogObject->save();
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Dialog saved');
+        @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Dialog saved');
         $this->remove_lock();
         $this->closeDialogs();
       }
@@ -876,7 +876,7 @@ class management
       if (count($msgs)) {
         msg_dialog::displayChecks($msgs);
       } else {
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Modifications applied');
+        @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Modifications applied');
         $this->tabObject->re_init();
         /* Avoid applying the POST a second time */
         $_POST = array();
@@ -893,7 +893,7 @@ class management
     $disallowed       = array();
     $this->currentDns = array();
 
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Entry deletion requested');
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Entry deletion requested');
 
     // Check permissons for each target
     foreach ($action['targets'] as $dn) {
@@ -957,7 +957,7 @@ class management
   function removeConfirmed(array $action)
   {
     global $ui;
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry deletion confirmed');
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDns, 'Entry deletion confirmed');
 
     foreach ($this->currentDns as $dn) {
       $entry = $this->listing->getEntry($dn);
@@ -1010,11 +1010,11 @@ class management
         $entry = $this->listing->getEntry($dn);
         if (($action['action'] == 'copy') && $entry->checkAcl('r')) {
           $this->cpHandler->add_to_queue($dn, 'copy', $entry->getTemplatedType());
-          @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry copied!');
+          @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry copied!');
         }
         if (($action['action'] == 'cut') && $entry->checkAcl('rd')) {
           $this->cpHandler->add_to_queue($dn, 'cut', $entry->getTemplatedType());
-          @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry cut!');
+          @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Entry cut!');
         }
       }
     }
@@ -1047,7 +1047,7 @@ class management
   function createSnapshotDialog(array $action)
   {
     global $config, $ui;
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Snaptshot creation initiated!');
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $action['targets'], 'Snaptshot creation initiated!');
 
     $this->currentDn = array_pop($action['targets']);
     if (empty($this->currentDn)) {
@@ -1085,7 +1085,7 @@ class management
     }
 
     if ($ui->allow_snapshot_restore($this->currentDn, $aclCategory, empty($action['targets']))) {
-      @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Snaptshot restoring initiated!');
+      @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->currentDn, 'Snaptshot restoring initiated!');
       $this->dialogObject = new SnapshotRestoreDialog($this->currentDn, $this, empty($action['targets']), $aclCategory);
     } else {
       msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to restore a snapshot for %s.'), $this->currentDn),
@@ -1174,7 +1174,7 @@ class management
     }
     if (!empty($dn) && $ui->allow_snapshot_create($dn, $this->dialogObject->aclCategory)) {
       $this->snapHandler->createSnapshot($dn, $description);
-      @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snaptshot created!');
+      @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snaptshot created!');
     } else {
       msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to restore a snapshot for %s.'), $dn),
           ERROR_DIALOG);
@@ -1191,7 +1191,7 @@ class management
     global $ui;
     if (!empty($dn) && $ui->allow_snapshot_restore($dn, $this->dialogObject->aclCategory, $this->dialogObject->global)) {
       $this->snapHandler->restoreSnapshot($dn);
-      @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snaptshot restored');
+      @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snaptshot restored');
       $this->closeDialogs();
     } else {
       msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to restore a snapshot for %s.'), $dn),
@@ -1209,7 +1209,7 @@ class management
     global $ui;
     if (!empty($dn) && $ui->allow_snapshot_delete($dn, $this->dialogObject->aclCategory)) {
       $this->snapHandler->removeSnapshot($dn);
-      @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snaptshot deleted');
+      @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, 'Snaptshot deleted');
     } else {
       msg_dialog::display(_('Permission'), sprintf(_('You are not allowed to delete a snapshot for %s.'), $dn),
           ERROR_DIALOG);
diff --git a/include/simpleplugin/attributes/class_DateAttribute.inc b/include/simpleplugin/attributes/class_DateAttribute.inc
index d1ffc7490499cbe3d5e9d3f2e19df9d233cc0932..16dcbc1c99a2f4d6ee75dd35e36928dc8ab34a49 100644
--- a/include/simpleplugin/attributes/class_DateAttribute.inc
+++ b/include/simpleplugin/attributes/class_DateAttribute.inc
@@ -202,21 +202,21 @@ class TimeHisAttribute extends CompositeAttribute
 {
   protected $convert;
 
-  function __construct($label, $description, $ldapName, $required, $convert = TRUE, $acl = '')
+  function __construct ($label, $description, $ldapName, $required, $convert = TRUE, $acl = '')
   {
     $this->convert = $convert;
     $attributes = array(
-      new IntAttribute (
+      new IntAttribute(
         '',  _('Hours'),
         $ldapName.'_hours', TRUE,
         0, 23, 1
       ),
-      new IntAttribute (
+      new IntAttribute(
         ':', _('Minutes'),
         $ldapName.'_minutes', TRUE,
         0, 59, 0
       ),
-      new IntAttribute (
+      new IntAttribute(
         ':', _('Seconds'),
         $ldapName.'_seconds', TRUE,
         0, 59, 0
@@ -276,16 +276,16 @@ class TimeHisAttribute extends CompositeAttribute
  */
 class TimeHiAttribute extends TimeHisAttribute
 {
-  function __construct($label, $description, $ldapName, $required, $convert = TRUE, $acl = '')
+  function __construct ($label, $description, $ldapName, $required, $convert = TRUE, $acl = '')
   {
     $this->convert = $convert;
     $attributes = array(
-      new IntAttribute (
+      new IntAttribute(
         '',  _('Hours'),
         $ldapName.'_hours', TRUE,
         0, 23, 1
       ),
-      new IntAttribute (
+      new IntAttribute(
         ':', _('Minutes'),
         $ldapName.'_minutes', TRUE,
         0, 59, 0
@@ -301,7 +301,7 @@ class TimeHiAttribute extends TimeHisAttribute
  */
 class DateTimeAttribute extends CompositeAttribute
 {
-  function __construct($label, $description, $ldapName, $required, $acl = '')
+  function __construct ($label, $description, $ldapName, $required, $acl = '')
   {
     $attributes = array(
       new DateAttribute(
diff --git a/include/simpleplugin/attributes/class_SetAttribute.inc b/include/simpleplugin/attributes/class_SetAttribute.inc
index 322ce22b980583643a586f4d236fee0895abe71b..f3c2a589ae59cee7bfcf9ce5f5df6fc93f473c8c 100644
--- a/include/simpleplugin/attributes/class_SetAttribute.inc
+++ b/include/simpleplugin/attributes/class_SetAttribute.inc
@@ -543,7 +543,7 @@ class OrderedArrayAttribute extends SetAttribute
     return array ($img, $nbicons);
   }
 
-  protected function getAttributeArrayValue($key, $value)
+  protected function getAttributeArrayValue ($key, $value)
   {
     $this->attribute->setValue($value);
     return $this->attribute->getArrayValue();
diff --git a/include/simpleplugin/class_multiPlugin.inc b/include/simpleplugin/class_multiPlugin.inc
index 74d358ade2c4043450b921d8aebe97cbc9153876..786f56d7f1da3af84b542fb573f63c56e037cce1 100644
--- a/include/simpleplugin/class_multiPlugin.inc
+++ b/include/simpleplugin/class_multiPlugin.inc
@@ -32,7 +32,7 @@ class multiPlugin extends simplePlugin
 
   var $tabClass = '';
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array();
   }
@@ -60,7 +60,7 @@ class multiPlugin extends simplePlugin
     }
   }
 
-  function execute()
+  function execute (): string
   {
     $display = "";
 
@@ -102,7 +102,7 @@ class multiPlugin extends simplePlugin
 
 
   /* Save data to object */
-  function save_object()
+  function save_object ()
   {
     foreach ($this->plugin as &$plug) {
       $plug->save_object();
@@ -110,7 +110,7 @@ class multiPlugin extends simplePlugin
     unset($plug);
   }
 
-  function check()
+  function check (): array
   {
     $message = parent::check();
 
@@ -125,7 +125,7 @@ class multiPlugin extends simplePlugin
     return $message;
   }
 
-  function set_acl_category($cat)
+  function set_acl_category ($cat)
   {
     parent::set_acl_category($cat);
     foreach ($this->plugin as &$plug) {
@@ -134,7 +134,7 @@ class multiPlugin extends simplePlugin
     unset($plug);
   }
 
-  function set_acl_base($base)
+  function set_acl_base ($base)
   {
     parent::set_acl_base($base);
     foreach ($this->plugin as &$plug) {
@@ -153,7 +153,7 @@ class multiPlugin extends simplePlugin
   }
 
   /* Save to LDAP */
-  function save()
+  function save (): array
   {
     $errors = array();
     /* Save objects */
@@ -172,7 +172,7 @@ class multiPlugin extends simplePlugin
     return $errors;
   }
 
-  function remove($fulldelete = FALSE)
+  function remove (bool $fulldelete = FALSE): array
   {
     $errors = array();
     /* Remove objects */
@@ -187,7 +187,7 @@ class multiPlugin extends simplePlugin
     return $errors;
   }
 
-  function adapt_from_template($attrs, $skip = array())
+  function adapt_from_template (array $attrs, array $skip = array())
   {
     /* Adapt objects */
     foreach ($this->plugin as &$plug) {
@@ -197,7 +197,7 @@ class multiPlugin extends simplePlugin
     unset($plug);
   }
 
-  function resetCopyInfos()
+  function resetCopyInfos ()
   {
     $this->dn = 'new';
     foreach ($this->plugin as &$plug) {
diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc
index da5493673d3f84dc4745cfa6dc584239fd13a741..ae2d2d5cbc6255fe22d5ad782598ece2755f1f3c 100644
--- a/include/simpleplugin/class_simplePlugin.inc
+++ b/include/simpleplugin/class_simplePlugin.inc
@@ -251,7 +251,7 @@ class simplePlugin
 
       /* Set the template flag according to the existence of objectClass fdTemplate */
       if (isset($this->attrs['objectClass']) && in_array_ics('fdTemplate', $this->attrs['objectClass'])) {
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, 'found', 'Template check');
+        @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, 'found', 'Template check');
         $this->setTemplate(TRUE);
         $this->templateLoadAttrs($this->attrs);
       }
@@ -259,7 +259,7 @@ class simplePlugin
       /* Is Account? */
       if ($this->is_this_account($this->attrs)) {
         $this->is_account = TRUE;
-        @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, get_class($this), 'Tab active');
+        @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, get_class($this), 'Tab active');
       }
     }
 
@@ -302,7 +302,7 @@ class simplePlugin
     }
   }
 
-  protected function loadAttributes()
+  protected function loadAttributes ()
   {
     // We load attributes values
     // First the one flagged as preInit
@@ -325,7 +325,7 @@ class simplePlugin
     unset($sectionInfo);
   }
 
-  function is_this_account($attrs)
+  function is_this_account ($attrs)
   {
     $result = static::isAccount($attrs);
     if ($result === NULL) {
@@ -337,7 +337,7 @@ class simplePlugin
         if (preg_match('/^top$/i', $obj)) {
           continue;
         }
-        if (!isset($attrs['objectClass']) || !in_array_ics ($obj, $attrs['objectClass'])) {
+        if (!isset($attrs['objectClass']) || !in_array_ics($obj, $attrs['objectClass'])) {
           $found = FALSE;
           break;
         }
@@ -381,7 +381,7 @@ class simplePlugin
     }
   }
 
-  protected function templateLoadAttrs(array $template_attrs)
+  protected function templateLoadAttrs (array $template_attrs)
   {
     if ($this->mainTab) {
       $this->_template_cn = $template_attrs['cn'][0];
@@ -389,7 +389,7 @@ class simplePlugin
     $this->attrs = templateHandling::fieldsFromLDAP($template_attrs);
   }
 
-  protected function templateSaveAttrs()
+  protected function templateSaveAttrs ()
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -424,7 +424,7 @@ class simplePlugin
    * It calls the getValue method on the concerned attribute
    * It also adds the $plugin->attribtues syntax to get attributes list
    */
-  public function __get($name)
+  public function __get ($name)
   {
     if ($name == 'attributes') {
       $plugin = $this;
@@ -446,7 +446,7 @@ class simplePlugin
 
     It calls the setValue method on the concerned attribute
    */
-  public function __set($name, $value)
+  public function __set ($name, $value)
   {
     if ($name == 'attributes') {
       trigger_error('Tried to set obsolete attribute "attributes" (it is now dynamic)');
@@ -462,7 +462,7 @@ class simplePlugin
 
     It returns FALSE if the attribute has an empty value.
    */
-  public function __isset($name)
+  public function __isset ($name)
   {
     if ($name == 'attributes') {
       return TRUE;
@@ -472,7 +472,7 @@ class simplePlugin
 
   /*! \brief This function returns the dn this object should have
    */
-  public function compute_dn(): string
+  public function compute_dn (): string
   {
     global $config;
     if (!$this->mainTab) {
@@ -539,7 +539,7 @@ class simplePlugin
    *
    * \return array [dn] => "..name"  // All deps. we are allowed to act on.
   */
-  function get_allowed_bases(): array
+  function get_allowed_bases (): array
   {
     global $config;
     $deps = array();
@@ -568,7 +568,7 @@ class simplePlugin
    *
    * \param string $base
    */
-  function set_acl_base($base)
+  function set_acl_base ($base)
   {
     $this->acl_base = $base;
   }
@@ -578,7 +578,7 @@ class simplePlugin
    *
    * \param string $category
    */
-  function set_acl_category(string $category)
+  function set_acl_category (string $category)
   {
     $this->acl_category = "$category/";
   }
@@ -592,7 +592,7 @@ class simplePlugin
     *
     * \return TRUE on success, error string on failure
     */
-  function move(string $src_dn, string $dst_dn)
+  function move (string $src_dn, string $dst_dn)
   {
     global $config, $ui;
 
@@ -633,7 +633,7 @@ class simplePlugin
     return TRUE;
   }
 
-  function getRequiredAttributes(): array
+  function getRequiredAttributes (): array
   {
     $tmp = array();
     foreach ($this->attributesAccess as $attr) {
@@ -657,16 +657,16 @@ class simplePlugin
   }
 
   /*! \brief Indicates if this object is opened as read-only (because of locks) */
-  function readOnly()
+  function readOnly ()
   {
     return $this->read_only;
   }
 
   /*! \brief This function display the plugin and return the html code
    */
-  function execute(): string
+  function execute (): string
   {
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, "execute");
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, "execute");
 
     /* Reset Lock message POST/GET check array, to prevent preg_match errors */
     session::set('LOCK_VARS_TO_USE', array());
@@ -726,7 +726,7 @@ class simplePlugin
     return $this->header.$smarty->fetch($this->templatePath);
   }
 
-  public function getDisplayHeaderInfos(): array
+  public function getDisplayHeaderInfos (): array
   {
     $plInfo   = pluglist::pluginInfos(get_class($this));
     $disabled = $this->acl_skip_write();
@@ -786,7 +786,7 @@ class simplePlugin
    *
    * \param string $name The html name of the input, defaults to modify_state
    */
-  function show_header(string $button_text, string $text, bool $plugin_enabled, bool $button_disabled = FALSE, string $name = 'modify_state'): string
+  function show_header (string $button_text, string $text, bool $plugin_enabled, bool $button_disabled = FALSE, string $name = 'modify_state'): string
   {
     if ($button_disabled || ((!$this->acl_is_createable() && !$plugin_enabled) || (!$this->acl_is_removeable() && $plugin_enabled))) {
         $state = 'disabled="disabled"';
@@ -803,7 +803,7 @@ class simplePlugin
    *
    * \param mixed $attr Attribute object or name (in this case it will be fetched from attributesAccess)
    */
-  function attrIsWriteable($attr): bool
+  function attrIsWriteable ($attr): bool
   {
     if (!is_object($attr)) {
       $attr = $this->attributesAccess[$attr];
@@ -817,7 +817,7 @@ class simplePlugin
     return $this->acl_is_writeable($attr->getAcl(), $this->acl_skip_write());
   }
 
-  function renderAttributes(bool $readOnly = FALSE)
+  function renderAttributes (bool $readOnly = FALSE)
   {
     global $ui;
     $smarty = get_smarty();
@@ -871,7 +871,7 @@ class simplePlugin
     $smarty->assign("sections", $sections);
   }
 
-  function inheritanceDisplay(): string
+  function inheritanceDisplay (): string
   {
     if (!$this->member_of_group) {
       return "";
@@ -915,7 +915,7 @@ class simplePlugin
   }
 
   /*! \brief Can we write the attribute */
-  function acl_is_writeable($attribute, bool $skipWrite = FALSE): bool
+  function acl_is_writeable ($attribute, bool $skipWrite = FALSE): bool
   {
     return preg_match('/w/', $this->aclGetPermissions($attribute, NULL, $skipWrite));
   }
@@ -925,7 +925,7 @@ class simplePlugin
    *
    * \param string $attribute
    */
-  function acl_is_readable($attribute): bool
+  function acl_is_readable ($attribute): bool
   {
     return preg_match('/r/', $this->aclGetPermissions($attribute));
   }
@@ -935,7 +935,7 @@ class simplePlugin
    *
    * \param string $base Empty string
    */
-  function acl_is_createable(string $base = NULL): bool
+  function acl_is_createable (string $base = NULL): bool
   {
     return preg_match('/c/', $this->aclGetPermissions('0', $base));
   }
@@ -945,7 +945,7 @@ class simplePlugin
    *
    * \param string $base Empty string
    */
-  function acl_is_removeable(string $base = NULL): bool
+  function acl_is_removeable (string $base = NULL): bool
   {
     return preg_match('/d/', $this->aclGetPermissions('0', $base));
   }
@@ -955,13 +955,13 @@ class simplePlugin
    *
    * \param string $base Empty string
    */
-  function acl_is_moveable(string $base = NULL): bool
+  function acl_is_moveable (string $base = NULL): bool
   {
     return preg_match('/m/', $this->aclGetPermissions('0', $base));
   }
 
   /*! \brief Get the acl permissions for an attribute or the plugin itself */
-  function aclGetPermissions($attribute = '0', string $base = NULL, bool $skipWrite = FALSE): string
+  function aclGetPermissions ($attribute = '0', string $base = NULL, bool $skipWrite = FALSE): string
   {
     if (isset($this->parent) && isset($this->parent->ignoreAcls) && $this->parent->ignoreAcls) {
       return 'cdmr'.($skipWrite ? '' : 'w');
@@ -976,7 +976,7 @@ class simplePlugin
 
   /*! \brief This function removes the object from LDAP
    */
-  function remove($fulldelete = FALSE): array
+  function remove (bool $fulldelete = FALSE): array
   {
     if (!$this->initially_was_account) {
       return array();
@@ -1017,7 +1017,7 @@ class simplePlugin
 
       /* Get current objectClasses in order to add the required ones */
       $ldap->cat($this->dn);
-      $tmp  = $ldap->fetch ();
+      $tmp  = $ldap->fetch();
       $oc   = array();
       if ($this->is_template) {
         if (isset($tmp['fdTemplateField'])) {
@@ -1051,7 +1051,7 @@ class simplePlugin
     }
   }
 
-  protected function ldap_remove(): array
+  protected function ldap_remove (): array
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -1086,7 +1086,7 @@ class simplePlugin
    */
   function save_object ()
   {
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'save_object');
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'save_object');
     if ($this->displayHeader && isset($_POST[get_class($this).'_modify_state'])) {
       if ($this->is_account && $this->acl_is_removeable()) {
         $this->is_account = FALSE;
@@ -1117,7 +1117,7 @@ class simplePlugin
     }
   }
 
-  protected function prepareSavedAttributes()
+  protected function prepareSavedAttributes ()
   {
     /* Prepare saved attributes */
     $this->saved_attributes = $this->attrs;
@@ -1151,7 +1151,7 @@ class simplePlugin
    * \brief Remove attributes, empty arrays, arrays
    * single attributes that do not differ
    */
-  function cleanup()
+  function cleanup ()
   {
     foreach ($this->attrs as $index => $value) {
 
@@ -1192,7 +1192,7 @@ class simplePlugin
     }
   }
 
-  function prepareNextCleanup()
+  function prepareNextCleanup ()
   {
     /* Update saved attributes and ensure that next cleanups will be successful too */
     foreach ($this->attrs as $name => $value) {
@@ -1202,9 +1202,9 @@ class simplePlugin
 
   /*! \brief This function saves the object in the LDAP
    */
-  function save(): array
+  function save (): array
   {
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, "save");
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, "save");
     $errors = $this->prepare_save();
     if (!empty($errors)) {
       return $errors;
@@ -1237,7 +1237,7 @@ class simplePlugin
     return array();
   }
 
-  protected function shouldSave(): bool
+  protected function shouldSave (): bool
   {
     if ($this->mainTab && !$this->initially_was_account) {
       return TRUE;
@@ -1246,12 +1246,12 @@ class simplePlugin
   }
 
   /* Used by prepare_save and template::apply */
-  public function mergeObjectClasses(array $oc): array
+  public function mergeObjectClasses (array $oc): array
   {
     return array_merge_unique($oc, $this->objectclasses);
   }
 
-  protected function prepare_save(): array
+  protected function prepare_save (): array
   {
     global $config;
     /* prepare $this->attrs */
@@ -1311,7 +1311,7 @@ class simplePlugin
   }
 
   /* Returns an array with the errors or an empty array */
-  protected function ldap_save(): array
+  protected function ldap_save (): array
   {
     global $config;
 
@@ -1347,7 +1347,7 @@ class simplePlugin
    *
    * This function calls hooks, update foreign keys and log modification
    */
-  protected function post_save()
+  protected function post_save ()
   {
     /* Propagate and log the event */
     if ($this->initially_was_account) {
@@ -1371,7 +1371,7 @@ class simplePlugin
    *
    * \param  array  $addAttrs
    */
-  protected function handle_hooks(string $when, string $mode, array $addAttrs = array())
+  protected function handle_hooks (string $when, string $mode, array $addAttrs = array())
   {
     switch ($mode) {
       case 'add':
@@ -1392,7 +1392,7 @@ class simplePlugin
   /*! \brief Forward command execution requests
    *         to the post hook execution method.
    */
-  function handle_post_events(string $mode, array $addAttrs = array())
+  function handle_post_events (string $mode, array $addAttrs = array())
   {
     /* Update foreign keys */
     if ($mode == 'remove') {
@@ -1407,7 +1407,7 @@ class simplePlugin
    *  \brief Forward command execution requests
    *         to the pre hook execution method.
    */
-  function handle_pre_events(string $mode, array $addAttrs = array())
+  function handle_pre_events (string $mode, array $addAttrs = array())
   {
     global $config;
 
@@ -1427,7 +1427,7 @@ class simplePlugin
    *           Replaces placeholder by class values of this plugin instance.
    *       Allows to a add special replacements.
    */
-  function callHook($cmd, array $addAttrs = array(), &$returnOutput = array(), &$returnCode = NULL): array
+  function callHook ($cmd, array $addAttrs = array(), &$returnOutput = array(), &$returnCode = NULL): array
   {
     if ($this->is_template) {
       return array();
@@ -1495,9 +1495,9 @@ class simplePlugin
 
   /*! \brief This function checks the attributes values and yell if something is wrong
    */
-  function check(): array
+  function check (): array
   {
-    @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'check');
+    @DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $this->dn, 'check');
     $messages = array();
 
     foreach ($this->attributesInfo as $sectionInfo) {
@@ -1548,7 +1548,7 @@ class simplePlugin
     );
   }
 
-  function browseForeignKeys(string $mode, $param1 = NULL, $param2 = NULL)
+  function browseForeignKeys (string $mode, $param1 = NULL, $param2 = NULL)
   {
     global $config, $plist;
 
@@ -1828,7 +1828,7 @@ class simplePlugin
    *
    * \param string $base
    */
-  function create_unique_dn(string $attribute, string $base): string
+  function create_unique_dn (string $attribute, string $base): string
   {
     global $config;
     $ldap = $config->get_ldap_link();
@@ -1867,7 +1867,7 @@ class simplePlugin
   /*
    * \brief Adapt from template
    */
-  function adapt_from_template(array $attrs, array $skip = array())
+  function adapt_from_template (array $attrs, array $skip = array())
   {
     $this->attrs = $attrs;
 
@@ -1889,7 +1889,7 @@ class simplePlugin
   /*!
    * \brief This function is called on the copied object to set its dn to where it will be saved
    */
-  function resetCopyInfos()
+  function resetCopyInfos ()
   {
     $this->dn       = 'new';
     $this->orig_dn  = $this->dn;
@@ -1898,22 +1898,22 @@ class simplePlugin
     $this->initially_was_account  = FALSE;
   }
 
-  protected function attributeHaveChanged(string $field): bool
+  protected function attributeHaveChanged (string $field): bool
   {
     return $this->attributesAccess[$field]->hasChanged();
   }
 
-  protected function attributeValue(string $field)
+  protected function attributeValue (string $field)
   {
     return $this->attributesAccess[$field]->getValue();
   }
 
-  protected function attributeInitialValue(string $field)
+  protected function attributeInitialValue (string $field)
   {
     return $this->attributesAccess[$field]->getInitialValue();
   }
 
-  function foreignKeyUpdate(string $field, $oldvalue, $newvalue, array $source)
+  function foreignKeyUpdate (string $field, $oldvalue, $newvalue, array $source)
   {
     if (!isset($source['MODE'])) {
       $source['MODE'] = 'move';
@@ -1936,7 +1936,7 @@ class simplePlugin
     return $this->attributesAccess[$field]->foreignKeyCheck($value, $source);
   }
 
-  function deserializeValues(array $values, bool $checkAcl = TRUE)
+  function deserializeValues (array $values, bool $checkAcl = TRUE)
   {
     foreach ($values as $name => $value) {
       if (isset($this->attributesAccess[$name])) {
@@ -1956,7 +1956,7 @@ class simplePlugin
   }
 
   /* Returns TRUE if this attribute should be asked in the creation by template dialog */
-  function showInTemplate(string $attr, array $templateAttrs): bool
+  function showInTemplate (string $attr, array $templateAttrs): bool
   {
     if (isset($templateAttrs[$attr])) {
       return FALSE;
@@ -1964,12 +1964,12 @@ class simplePlugin
     return TRUE;
   }
 
-  function is_modal_dialog(): bool
+  function is_modal_dialog (): bool
   {
     return (isset($this->dialog) && $this->dialog);
   }
 
-  static function fillAccountAttrsNeeded(&$needed)
+  static function fillAccountAttrsNeeded (&$needed)
   {
     $infos = pluglist::pluginInfos(get_called_class());
     if (isset($infos['plFilterObject'])) {
@@ -1982,7 +1982,7 @@ class simplePlugin
     }
   }
 
-  static function isAccount($attrs)
+  static function isAccount ($attrs)
   {
     $infos = pluglist::pluginInfos(get_called_class());
     if (isset($infos['plFilterObject'])) {
@@ -1991,7 +1991,7 @@ class simplePlugin
     return NULL;
   }
 
-  static function getLdapFilter()
+  static function getLdapFilter ()
   {
     $infos = pluglist::pluginInfos(get_called_class());
     if (isset($infos['plFilter'])) {
@@ -2000,7 +2000,7 @@ class simplePlugin
     return NULL;
   }
 
-  static function getLdapFilterObject()
+  static function getLdapFilterObject ()
   {
     $infos = pluglist::pluginInfos(get_called_class());
     if (isset($infos['plFilterObject'])) {
@@ -2014,7 +2014,7 @@ class simplePlugin
    *
    * \return an array
    */
-  static function plInfo(): array
+  static function plInfo (): array
   {
     return array();
   }
@@ -2023,7 +2023,7 @@ class simplePlugin
    *
    *  \param array $attributesInfo the attribute array
    */
-  static function generatePlProvidedAcls(array $attributesInfo): array
+  static function generatePlProvidedAcls (array $attributesInfo): array
   {
     $plProvidedAcls = array();
     foreach ($attributesInfo as $sectionInfo) {
diff --git a/include/simpleplugin/class_simpleService.inc b/include/simpleplugin/class_simpleService.inc
index f7d52841dac5c44607b490167c6c4e3312f854b7..5245eb6072783f370bcb431a10fe8deca9cdf1ff 100644
--- a/include/simpleplugin/class_simpleService.inc
+++ b/include/simpleplugin/class_simpleService.inc
@@ -47,7 +47,7 @@ class simpleService extends simplePlugin
 
   /*! \brief This function display the service and return the html code
    */
-  function execute()
+  function execute (): string
   {
     $str = parent::execute();
 
@@ -61,13 +61,13 @@ class simpleService extends simplePlugin
     return $str;
   }
 
-  protected function acl_skip_write()
+  protected function acl_skip_write (): bool
   {
     return FALSE;
   }
 
   /*! \brief Get service information for serverService plugin */
-  function getListEntry()
+  function getListEntry ()
   {
     /* Assign status flag */
     $fields['Status']       = $this->status;
@@ -96,7 +96,7 @@ class simpleService extends simplePlugin
   }
 
   /*! \brief This function save new status flag */
-  function setStatus($value)
+  function setStatus ($value)
   {
     /* Can't set status flag for new services (Object doesn't exists in ldap tree) */
     if (!$this->initially_was_account) {
@@ -106,7 +106,7 @@ class simpleService extends simplePlugin
     $this->status = $value;
   }
 
-  static function generatePlProvidedAcls ($attributesInfo)
+  static function generatePlProvidedAcls ($attributesInfo): array
   {
     $acls = parent::generatePlProvidedAcls($attributesInfo);
     if (static::$showActions) {
diff --git a/plugins/addons/dashboard/class_dashboard.inc b/plugins/addons/dashboard/class_dashboard.inc
index c0a519cdd92778d06b4a5fb650a235f27a2deea3..6560242fe2aa999f99cec10133de040d7a96e54b 100644
--- a/plugins/addons/dashboard/class_dashboard.inc
+++ b/plugins/addons/dashboard/class_dashboard.inc
@@ -21,7 +21,7 @@
 
 class dashboard extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Dashboard'),
@@ -44,7 +44,7 @@ class dashboard extends simplePlugin
     );
   }
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'stats' => array(
diff --git a/plugins/addons/dashboard/class_dashboardPasswords.inc b/plugins/addons/dashboard/class_dashboardPasswords.inc
index 27510686b26117482682a427fd77a59fefaf5af2..bd283470a80aab9b6be6e0df4670acf264fd9439 100644
--- a/plugins/addons/dashboard/class_dashboardPasswords.inc
+++ b/plugins/addons/dashboard/class_dashboardPasswords.inc
@@ -20,7 +20,7 @@
 
 class dashboardPassword extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Passwords'),
@@ -32,7 +32,7 @@ class dashboardPassword extends simplePlugin
     );
   }
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'pwds' => array(
diff --git a/plugins/addons/dashboard/class_dashboardUsers.inc b/plugins/addons/dashboard/class_dashboardUsers.inc
index 323a9858c8a813fa317e7e3ef197ba0c4671989b..84d1b3fd1cc58d8879bfc60ef77f01406c42cf76 100644
--- a/plugins/addons/dashboard/class_dashboardUsers.inc
+++ b/plugins/addons/dashboard/class_dashboardUsers.inc
@@ -21,7 +21,7 @@
 
 class dashboardUsers extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Users'),
@@ -33,7 +33,7 @@ class dashboardUsers extends simplePlugin
     );
   }
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'userstats' => array(
diff --git a/plugins/admin/acl/class_aclAssignment.inc b/plugins/admin/acl/class_aclAssignment.inc
index 721eff3291a160f710055794528ddc2f1de9b802..1cd801eddf5ef77b16bc61eeb0876955504a3d4d 100644
--- a/plugins/admin/acl/class_aclAssignment.inc
+++ b/plugins/admin/acl/class_aclAssignment.inc
@@ -20,7 +20,7 @@
 
 class aclAssignmentDialogWindow extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('ACL Assignment Dialog'),
@@ -31,7 +31,7 @@ class aclAssignmentDialogWindow extends simplePlugin
     );
   }
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'properties' => array(
@@ -92,7 +92,7 @@ class aclAssignmentDialogWindow extends simplePlugin
     }
   }
 
-  function execute()
+  function execute (): string
   {
     $smarty = get_smarty();
     $display = parent::execute();
@@ -128,7 +128,7 @@ class ACLsAssignmentDialog extends GenericDialog
   protected $post_finish = 'add_acl_finish';
   protected $dialogClass = 'aclAssignmentDialogWindow';
 
-  function __construct($simplePlugin, $attribute, $acl = NULL)
+  function __construct ($simplePlugin, $attribute, $acl = NULL)
   {
     $isContainer = FALSE;
     if (isset($simplePlugin->attrs['objectClass'])) {
@@ -260,7 +260,7 @@ class ACLsAssignmentAttribute extends DialogOrderedArrayAttribute
 
 class aclAssignment extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     global $config;
     $oc = array(
@@ -296,7 +296,7 @@ class aclAssignment extends simplePlugin
     );
   }
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'main' => array(
@@ -318,12 +318,12 @@ class aclAssignment extends simplePlugin
     $this->attributesInfo['main']['name'] = sprintf(_('Assignments on object or subtree %s'), $this->dn);
   }
 
-  function compute_dn()
+  function compute_dn (): string
   {
     return $this->dn;
   }
 
-  function save()
+  function save (): array
   {
     $this->ignore_account = FALSE;
     $this->is_account = (count($this->gosaAclEntry) != 0);
@@ -344,7 +344,7 @@ class aclAssignment extends simplePlugin
     session::global_set('ui', $ui);
   }
 
-  function post_save()
+  function post_save ()
   {
     parent::post_save();
 
@@ -354,7 +354,7 @@ class aclAssignment extends simplePlugin
     session::global_set('ui', $ui);
   }
 
-  function foreignKeyUpdate($field, $oldvalue, $newvalue, array $source)
+  function foreignKeyUpdate (string $field, $oldvalue, $newvalue, array $source)
   {
     /* Handle foreign keys only as the main tab so that they are not handled twice */
     if ($this->parent->getBaseObject() !== $this) {
diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc
index 439a9619bee2a98b181f29f34927c1bd95066337..96946d139d73f866edbc4c7f52d63c070337b471 100644
--- a/plugins/admin/acl/class_aclManagement.inc
+++ b/plugins/admin/acl/class_aclManagement.inc
@@ -25,7 +25,7 @@ class aclAssignmentCreationDialog extends simplePlugin
   protected $post_cancel = 'add_cancel';
   protected $management;
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('ACL assignment creation'),
@@ -37,7 +37,7 @@ class aclAssignmentCreationDialog extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     global $config;
     return array(
@@ -45,7 +45,7 @@ class aclAssignmentCreationDialog extends simplePlugin
         'name'  => _('ACL assignment creation'),
         'class' => array('fullwidth'),
         'attrs' => array(
-          new StringAttribute (
+          new StringAttribute(
             _('Dn'), _('DN you wish to add assignments for'),
             'baseDn', TRUE,
             $config->current['BASE'], 'aclMode',
@@ -68,7 +68,7 @@ class aclAssignmentCreationDialog extends simplePlugin
     $this->attributesAccess['baseDn']->setInLdap(FALSE);
   }
 
-  function save_object()
+  function save_object ()
   {
     parent::save_object();
     if (isset($_POST[$this->post_cancel])) {
@@ -80,11 +80,11 @@ class aclAssignmentCreationDialog extends simplePlugin
     return TRUE;
   }
 
-  function save()
+  function save (): array
   {
   }
 
-  function execute()
+  function execute (): string
   {
     if ($this->save_object()) {
       $smarty = get_smarty();
@@ -135,7 +135,7 @@ class aclManagement extends management
     array('ActionsColumn',    array('label' => 'Actions')),
   );
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('ACL assignments'),
diff --git a/plugins/admin/aclrole/class_aclRole.inc b/plugins/admin/aclrole/class_aclRole.inc
index ad7d038b02f08c1c4b2f9ed0b33b424741ee70b8..b73fd858c0906fbc0de0cdbe39b24f256ea495f8 100644
--- a/plugins/admin/aclrole/class_aclRole.inc
+++ b/plugins/admin/aclrole/class_aclRole.inc
@@ -69,7 +69,7 @@ class ACLsAttribute extends DialogOrderedArrayAttribute
 
 class aclRole extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Role'),
@@ -87,7 +87,7 @@ class aclRole extends simplePlugin
     );
   }
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'properties' => array(
diff --git a/plugins/admin/departments/class_country.inc b/plugins/admin/departments/class_country.inc
index 1da697f29c85bf395ebe49c2e731c636ad4c18bc..9a68dd0323738cf0073aa301dafc7de8159c096e 100644
--- a/plugins/admin/departments/class_country.inc
+++ b/plugins/admin/departments/class_country.inc
@@ -23,7 +23,7 @@ class country extends department
   static protected $namingAttr  = 'c';
   protected $structuralOC       = array('country');
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Country'),
@@ -47,7 +47,7 @@ class country extends department
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     $attributesInfo = parent::getDepartmentAttributesInfo(_('country'));
     unset($attributesInfo['location']);
diff --git a/plugins/admin/departments/class_dcObject.inc b/plugins/admin/departments/class_dcObject.inc
index aad3f77df7554f4a46571ed0b8764be1c480a389..0439d84ed9f8f2919a28680557c1e92f1fc576fc 100644
--- a/plugins/admin/departments/class_dcObject.inc
+++ b/plugins/admin/departments/class_dcObject.inc
@@ -23,7 +23,7 @@ class dcObject extends department
   static protected $namingAttr  = 'dc';
   protected $structuralOC       = array('locality');
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Domain Component'),
@@ -46,7 +46,7 @@ class dcObject extends department
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     $attributesInfo = parent::getDepartmentAttributesInfo(_('domain component'));
     unset($attributesInfo['location']);
diff --git a/plugins/admin/departments/class_department.inc b/plugins/admin/departments/class_department.inc
index a1a096e2dbc7df6a4d9a8343c625b82573289e58..d7537df1c135e48dac4e6423764236a3c8a61479 100644
--- a/plugins/admin/departments/class_department.inc
+++ b/plugins/admin/departments/class_department.inc
@@ -24,7 +24,7 @@ class department extends simplePlugin
   static protected $namingAttr  = 'ou';
   protected $structuralOC       = array('organizationalUnit');
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Department'),
@@ -52,7 +52,7 @@ class department extends simplePlugin
     );
   }
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return static::getDepartmentAttributesInfo(_('department'));
   }
@@ -102,7 +102,7 @@ class department extends simplePlugin
             _('Address'), sprintf(_('A postal address for this %s'), $name),
             'postalAddress', FALSE
           ),
-          new PhoneNumberButtonAttribute (
+          new PhoneNumberButtonAttribute(
             _('Phone'), _('Telephone number'),
             'telephoneNumber', FALSE,
             '',
@@ -161,7 +161,7 @@ class department extends simplePlugin
   }
 
   /* Check values */
-  function check()
+  function check (): array
   {
     /* Call common method to give check the hook */
     $message = parent::check();
@@ -175,7 +175,7 @@ class department extends simplePlugin
     return $message;
   }
 
-  function get_allowed_bases()
+  function get_allowed_bases (): array
   {
     /* Hide all departments, that are subtrees of this department */
     $bases = parent::get_allowed_bases();
@@ -189,7 +189,7 @@ class department extends simplePlugin
     return $bases;
   }
 
-  function prepare_save()
+  function prepare_save (): array
   {
     if (static::$namingAttr != 'ou') {
       $this->attributesAccess['ou']->setValue($this->attributesAccess[static::$namingAttr]->getValue());
diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc
index 20700f36310da5f7ccfb611bcd6a013c1af0db15..bff9b3bf5488f20fbb1b13ab830ea07a809c02c8 100644
--- a/plugins/admin/departments/class_departmentManagement.inc
+++ b/plugins/admin/departments/class_departmentManagement.inc
@@ -23,7 +23,7 @@ class departmentManagement extends management
 {
   public static $skipSnapshots  = TRUE;
 
-  public static function plInfo()
+  public static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Departments'),
diff --git a/plugins/admin/departments/class_domain.inc b/plugins/admin/departments/class_domain.inc
index d5ef9224995500a9bea9b5d5b013f9680294ed76..a46d0b6a3c4ed19297fcd1b0ec4b076b9c3b2385 100644
--- a/plugins/admin/departments/class_domain.inc
+++ b/plugins/admin/departments/class_domain.inc
@@ -23,7 +23,7 @@ class domain extends department
   static protected $namingAttr  = 'dc';
   protected $structuralOC       = array('domain');
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Domain'),
@@ -46,7 +46,7 @@ class domain extends department
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     $attributesInfo = parent::getDepartmentAttributesInfo(_('domain'));
     unset($attributesInfo['location']);
diff --git a/plugins/admin/departments/class_locality.inc b/plugins/admin/departments/class_locality.inc
index badd41c807fd8aad495de439c5cb11ff4a9a926c..e3cc9173b52906c11dedf4cbef7bc2419b98f1f6 100644
--- a/plugins/admin/departments/class_locality.inc
+++ b/plugins/admin/departments/class_locality.inc
@@ -23,7 +23,7 @@ class locality extends department
   static protected $namingAttr  = 'l';
   protected $structuralOC       = array('locality');
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Locality'),
@@ -47,7 +47,7 @@ class locality extends department
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     $attributesInfo = parent::getDepartmentAttributesInfo(_('locality'));
     unset($attributesInfo['location']);
diff --git a/plugins/admin/departments/class_organization.inc b/plugins/admin/departments/class_organization.inc
index 179c7821770345689dfb9fef07b64e7098ff3a56..6babd9ded4692a7dbd99e05ea4dee449c9e7d45d 100644
--- a/plugins/admin/departments/class_organization.inc
+++ b/plugins/admin/departments/class_organization.inc
@@ -23,7 +23,7 @@ class organization extends department
   static protected $namingAttr  = 'o';
   protected $structuralOC       = array('organization');
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Organization'),
@@ -47,7 +47,7 @@ class organization extends department
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return parent::getDepartmentAttributesInfo(_('organization'));
   }
diff --git a/plugins/admin/groups/class_ogroup.inc b/plugins/admin/groups/class_ogroup.inc
index 941c090e5195b6a6a9b034922b4d26ac33340676..16924d949d154de42c2d899d00d53c75547e2d75 100644
--- a/plugins/admin/groups/class_ogroup.inc
+++ b/plugins/admin/groups/class_ogroup.inc
@@ -183,7 +183,7 @@ class ogroup extends simplePlugin
     'D' => 'simpleSecurityObject',
   );
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Object group'),
@@ -220,7 +220,7 @@ class ogroup extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'main' => array(
@@ -315,7 +315,7 @@ class ogroup extends simplePlugin
     $this->savedTypedMembers = $this->attributesAccess['member']->getTypedValues();
   }
 
-  function prepare_save()
+  function prepare_save (): array
   {
     $this->reload();
     $errors = parent::prepare_save();
@@ -339,7 +339,7 @@ class ogroup extends simplePlugin
     $this->gosaGroupObjects = $this->attributesAccess['member']->listObjectTypes();
   }
 
-  function check()
+  function check (): array
   {
     $message = parent::check();
     $this->reload();
@@ -350,7 +350,7 @@ class ogroup extends simplePlugin
     return $message;
   }
 
-  function ldap_save()
+  function ldap_save (): array
   {
     global $ui;
 
diff --git a/plugins/admin/groups/class_roleGeneric.inc b/plugins/admin/groups/class_roleGeneric.inc
index 76475a66f7f673b1486afefafa82ab0cf339a804..64a79bb1d8ebfdd78aa7a5c3119bd4ed4fa35ad7 100644
--- a/plugins/admin/groups/class_roleGeneric.inc
+++ b/plugins/admin/groups/class_roleGeneric.inc
@@ -47,7 +47,7 @@ class RoleMembersAttribute extends UsersAttribute
 
 class roleGeneric extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Role'),
@@ -75,27 +75,27 @@ class roleGeneric extends simplePlugin
    /*!
    *  \brief The main function : information about attributes
    */
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'main' => array(
         'name'  => _('Information'),
         'attrs' => array(
-          new BaseSelectorAttribute (get_ou('roleRDN')),
+          new BaseSelectorAttribute(get_ou('roleRDN')),
           new StringAttribute(
             _('Name'), _('Name of this group'),
             'cn', TRUE,
             '', '', (strict_uid_mode() ? '/^[a-z0-9_-]+$/i' : '/^[a-z0-9_.-]+$/i')
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Description'), _('Description of the role'),
             'description'
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Phone number'), _('Phone number'),
             'telephoneNumber'
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Fax number'), _('Fax number'),
             'facsimileTelephoneNumber'
           )
@@ -104,7 +104,7 @@ class roleGeneric extends simplePlugin
       'members' => array(
         'name'  => _('Role members'),
         'attrs' => array(
-          new RoleMembersAttribute (
+          new RoleMembersAttribute(
             '', _('Add users for the role'),
             'roleOccupant', FALSE
           )
@@ -113,7 +113,7 @@ class roleGeneric extends simplePlugin
     );
   }
 
-  function ldap_save()
+  function ldap_save (): array
   {
     global $ui;
 
diff --git a/plugins/config/class_configInLdap.inc b/plugins/config/class_configInLdap.inc
index 596565dfa460e6905a547f791b0f4565f0fd4f9d..e67359eab67fb5168c710cc9e0f6e6265ddfa811 100644
--- a/plugins/config/class_configInLdap.inc
+++ b/plugins/config/class_configInLdap.inc
@@ -48,7 +48,7 @@ class DebugLevelAttribute extends SetAttribute
 
 class configInLdap extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'     => _('Configuration'),
@@ -74,7 +74,7 @@ class configInLdap extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     global $config;
     $plugins = array();
@@ -86,62 +86,62 @@ class configInLdap extends simplePlugin
       'look_n_feel' => array(
         'name'  => _('Look and feel'),
         'attrs' => array(
-          new SelectAttribute (
+          new SelectAttribute(
             _('Language'), _('Language of the application. If \'automatic\' or not available, the one asked by the browser will be used. This setting can be overriden per user.'),
             'fdLanguage', FALSE,
             array('')
           ),
-          new SelectAttribute (
+          new SelectAttribute(
             _('Theme'), _('Theme to be used'),
             'fdTheme', TRUE,
             static::get_themes(),
             'breezy'
           ),
-          new SelectAttribute (
+          new SelectAttribute(
             _('Timezone'), _('Timezone to be used'),
             'fdTimezone', TRUE,
             array('America/New_York')
           ),
-          new HiddenAttribute ('fusionConfigMd5'),
+          new HiddenAttribute('fusionConfigMd5'),
         )
       ),
       'core_settings' => array(
         'name'  => _('Core settings'),
         'attrs' => array(
-          new IntAttribute (
+          new IntAttribute(
             _('LDAP size limit'), _('Defines the number of entries to get from LDAP by default.'),
             'fdLdapSizeLimit', FALSE,
             0 /*min*/, FALSE /*no max*/, 200
           ),
-          new SelectAttribute (
+          new SelectAttribute(
             _('Edit locking'),
             _('Check if a entry currently being edited has been modified outside of FusionDirectory in the meantime.'),
             'fdModificationDetectionAttribute', FALSE,
             array('', 'entryCSN', 'contextCSN'), 'entryCSN'
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Enable logging'),
             _('Event logging on FusionDirectory side.'),
             'fdLogging', FALSE,
             TRUE
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Schema validation'),
             _('Enables schema checking during login.'),
             'fdSchemaCheck', FALSE,
             TRUE
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Enable snapshots'), _('This enables you to save certain states of entries and restore them later on.'),
             'fdEnableSnapshots', FALSE,
             TRUE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Snapshot base'), _('The base where snapshots should be stored inside of the LDAP.'),
             'fdSnapshotBase', FALSE,
             'ou=snapshots,'.$config->current['BASE']
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Wildcard foreign keys'), _('Enables wildcard searches like member=* when moving a whole departement. This will open all existing groups and roles to make sure foreign keys are respected. Slow on big trees.'),
             'fdWildcardForeignKeys', FALSE,
             TRUE
@@ -151,35 +151,35 @@ class configInLdap extends simplePlugin
       'password' => array(
         'name'  => _('Password settings'),
         'attrs' => array(
-          new SelectAttribute (
+          new SelectAttribute(
             _('Password default hash'), _('Default hash to be used'),
             'fdPasswordDefaultHash', TRUE,
             array('ssha')
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Force default hash'), _('Force the use of the default password hash'),
             'fdForcePasswordDefaultHash'
           ),
-          new IntAttribute (
+          new IntAttribute(
             _('Password minimum length'), _('Minimum length of user passwords'),
             'fdPasswordMinLength', FALSE,
             0 /*min*/, FALSE /*no max*/
           ),
-          new IntAttribute (
+          new IntAttribute(
             _('Password minimum differs'), _('Minimum number of different characters from last password'),
             'fdPasswordMinDiffer', FALSE,
             0 /*min*/, FALSE /*no max*/
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Use account expiration'),
             _('Enables shadow attribute tests during the login to FusionDirectory and forces password renewal or account locking'),
             'fdHandleExpiredAccounts'
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('SASL Realm'), _('SASL Realm'),
             'fdSaslRealm'
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('SASL Exop'), _('Attribute to be stored in the userPassword attribute'),
             'fdSaslExop'
           ),
@@ -188,35 +188,35 @@ class configInLdap extends simplePlugin
       'login' => array(
         'name'  => _('Login and session'),
         'attrs' => array(
-          new SelectAttribute (
+          new SelectAttribute(
             _('Login attribute'),
             _('Which LDAP attribute should be used as the login name during login.'),
             'fdLoginAttribute', TRUE,
             array('uid', 'mail', 'uid,mail'), 'uid',
             array('uid', 'mail', 'both')
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Enforce encrypted connections'),
             _('Enables PHP security checks to force encrypted access (https) to the web interface.'),
             'fdForceSSL'
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Warn if session is not encrypted'),
             _('will display a warning to the user when http is used instead of https.'),
             'fdWarnSSL', FALSE,
             TRUE
           ),
-          new IntAttribute (
+          new IntAttribute(
             _('Session lifetime'), _('Defines when a session will expire in seconds (0 to disable).'),
             'fdSessionLifeTime', TRUE,
             0 /*min*/, FALSE /*no max*/, 1800
           ),
-          new SelectAttribute (
+          new SelectAttribute(
             _('Login method'),
             _('Which login method should be used for connecting to FusionDirectory'),
             'fdLoginMethod', TRUE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Header name'), _('Name of the header containing user identifier.'),
             'fdHttpHeaderAuthHeaderName', FALSE,
             'AUTH_USER'
@@ -226,17 +226,17 @@ class configInLdap extends simplePlugin
       'ssl' => array(
         'name'  => _('SSL'),
         'attrs' => array(
-          new TrimmedStringAttribute (
+          new TrimmedStringAttribute(
             _('Key path'), _('Path to FusionDirectory private key. Unused for now.'),
             'fdSslKeyPath', FALSE,
             '/etc/ssl/private/fd.key'
           ),
-          new TrimmedStringAttribute (
+          new TrimmedStringAttribute(
             _('Certificate path'), _('Path to FusionDirectory certificate. Unused for now.'),
             'fdSslCertPath', FALSE,
             '/etc/ssl/certs/fd.cert'
           ),
-          new TrimmedStringAttribute (
+          new TrimmedStringAttribute(
             _('CA certificate path'), _('Path to the CA certificate. Used for validating Argonaut Server host.'),
             'fdSslCaCertPath', FALSE,
             '/etc/ssl/certs/ca.cert'
@@ -246,22 +246,22 @@ class configInLdap extends simplePlugin
       'cas' => array(
         'name'  => _('CAS'),
         'attrs' => array(
-          new TrimmedStringAttribute (
+          new TrimmedStringAttribute(
             _('CA certificate path'), _('Path to the CA certificate of the CAS server'),
             'fdCasServerCaCertPath', FALSE,
             '/etc/ssl/certs/ca.cert'
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Host'), _('Host of the CAS server'),
             'fdCasHost', FALSE,
             'localhost'
           ),
-          new IntAttribute (
+          new IntAttribute(
             _('Port'), _('Port the CAS server is listening on'),
             'fdCasPort', FALSE,
             0 /*min*/, FALSE /*no max*/, 443
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('CAS context'), _('CAS context to be used'),
             'fdCasContext', FALSE,
             '/cas'
@@ -272,41 +272,41 @@ class configInLdap extends simplePlugin
         'name'  => _('People and group storage'),
         'class' => array('critical'),
         'attrs' => array(
-          new SelectAttribute (
+          new SelectAttribute(
             _('People DN attribute'), _('Attribute to use at the beginning of users dn'),
             'fdAccountPrimaryAttribute', TRUE,
             array('uid', 'cn')
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('CN pattern'), _('The pattern to use to build the common name field'),
             'fdCnPattern', TRUE,
             '%givenName% %sn%'
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Strict naming policy'),
             _('Enables strict checking of user and group names'),
             'fdStrictNamingRules', FALSE,
             TRUE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Users RDN'), _('The branch where users are stored.'),
             'fdUserRDN', TRUE,
             'ou=people'
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('ACL role RDN'), _('The branch where ACL roles are stored.'),
             'fdAclRoleRDN', TRUE,
             'ou=aclroles'
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Restrict role members'), _('When enabled only users from the same branch or members of groups from the same branch can be added to a role.'),
             'fdRestrictRoleMembers'
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Separate address fields'), _('Expose street, postOfficeBox and postalCode fields instead of postalAddress.'),
             'fdSplitPostalAddress'
           ),
-          new PostalAddressAttribute (
+          new PostalAddressAttribute(
             _('Postal address pattern'), _('When using separate address fields, you can use a pattern to fill postalAddress field.'),
             'fdPostalAddressPattern'
           ),
@@ -315,23 +315,23 @@ class configInLdap extends simplePlugin
       'debug' => array(
         'name'  => _('Debugging'),
         'attrs' => array(
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Display errors'),
             _('Shows PHP errors in the upper part of the screen. This should be disabled in productive deployments, because there might be some passwords in it.'),
             'fdDisplayErrors'
           ),
-          new IntAttribute (
+          new IntAttribute(
             _('Maximum LDAP query time'), _('Stop LDAP actions if there is no answer within the specified number of seconds.'),
             'fdLdapMaxQueryTime', FALSE,
             0 /*min*/, FALSE /*no max*/
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Log LDAP statistics'),
             _('Track LDAP timing statistics to the syslog. This may help to find indexing problems or bad search filters.'),
             'fdLdapStats'
           ),
-          new DebugLevelAttribute (
-            new SelectAttribute (
+          new DebugLevelAttribute(
+            new SelectAttribute(
               _('Debug level'),
               _('Display certain information on each page load.'),
               'fdDebugLevel', FALSE,
@@ -347,19 +347,19 @@ class configInLdap extends simplePlugin
       'miscellaneous' => array(
         'name'  => _('Miscellaneous'),
         'attrs' => array(
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Display summary in listings'),
             _('Determines whether a status bar will be shown on the bottom of lists, displaying a short summary of type and number of elements in the list.'),
             'fdListSummary', FALSE,
             TRUE
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Show ACL tab on all objects'),
             _('For very specific ACL rights setting where you might need to give right on a single object.'),
             'fdAclTabOnObjects'
           ),
           new SetAttribute(
-            new StringAttribute (
+            new StringAttribute(
               _('Available department categories'), _('Available categories in the departments dropdown'),
               'fdDepartmentCategories', FALSE
             ),
@@ -389,15 +389,15 @@ class configInLdap extends simplePlugin
             array()
           ),
           // Needed here for ACLs
-          new HiddenAttribute ('fdManagementConfig'),
+          new HiddenAttribute('fdManagementConfig'),
         )
       ),
       'hooks' => array(
         'name'  => _('Hooks'),
         'class' => array('fullwidth'),
         'attrs' => array(
-          new OrderedArrayAttribute (
-            new CompositeAttribute (
+          new OrderedArrayAttribute(
+            new CompositeAttribute(
               _('Hooks that are called when specific actions happens'),
               'fdTabHook',
               array(
@@ -427,7 +427,7 @@ class configInLdap extends simplePlugin
             array(),
             TRUE // edition
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Display hook output'),
             _('When enabled successful hook execution output is displayed to the user using a dialog.'),
             'fdDisplayHookOutput'
@@ -573,12 +573,12 @@ class configInLdap extends simplePlugin
     }
   }
 
-  function compute_dn()
+  function compute_dn (): string
   {
     return $this->dn;
   }
 
-  function check()
+  function check (): array
   {
     $messages = parent::check();
     if (($this->fdPasswordDefaultHash == 'sasl') && ($this->fdSaslRealm == '') && ($this->fdSaslExop == '')) {
diff --git a/plugins/config/class_dashBoardConfig.inc b/plugins/config/class_dashBoardConfig.inc
index f506098ffe9ddbbb371ea5a58bc370c9ff3bb71e..77d90c5d3aea89ef1bfd51fee0c179ca6f7f1397 100644
--- a/plugins/config/class_dashBoardConfig.inc
+++ b/plugins/config/class_dashBoardConfig.inc
@@ -20,7 +20,7 @@
 
 class dashboardConfig extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'     => _('Dashboard configuration'),
@@ -33,19 +33,19 @@ class dashboardConfig extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'systems' => array(
         'name'  => _('Dashboard name schema'),
         'attrs' => array(
-          new IntAttribute (
+          new IntAttribute(
             _('Number of digits'), _('Number of digits to use after prefix'),
             'fdDashboardNumberOfDigit', FALSE,
             1, 20, 3
           ),
-          new SetAttribute (
-            new StringAttribute (
+          new SetAttribute(
+            new StringAttribute(
               _('Prefixes'), _('Prefixes to be used for computer ids'),
               'fdDashboardPrefix', TRUE
             ),
@@ -56,7 +56,7 @@ class dashboardConfig extends simplePlugin
       'users' => array(
         'name'  => _('Dashboard expired users'),
         'attrs' => array(
-          new IntAttribute (
+          new IntAttribute(
             _('Number of days'), _('Number of days before expiration needed for an account to show in the dashboard next expired accounts list'),
             'fdDashboardExpiredAccountsDays', FALSE,
             1, FALSE, 15
diff --git a/plugins/config/class_mainPluginsConfig.inc b/plugins/config/class_mainPluginsConfig.inc
index dd6e4fef39a890c523f840eedf307510cd1d8e5b..ac7415e155cb8508078caffc2ad80e95e67a88f9 100644
--- a/plugins/config/class_mainPluginsConfig.inc
+++ b/plugins/config/class_mainPluginsConfig.inc
@@ -20,7 +20,7 @@
 
 class mainPluginsConfig extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'     => _('Plugins configuration'),
@@ -33,13 +33,13 @@ class mainPluginsConfig extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'ogroups' => array(
         'name'  => _('Object groups'),
         'attrs' => array(
-          new StringAttribute (
+          new StringAttribute(
             _('Groups RDN'), _('Branch in which object groups will be stored'),
             'fdOGroupRDN', TRUE,
             'ou=groups'
@@ -49,7 +49,7 @@ class mainPluginsConfig extends simplePlugin
       'sasl' => array(
         'name'  => _('SASL'),
         'attrs' => array(
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Force to ask for password'), _('Useful if you add a hook using password value when SASL user passwords are edited'),
             'fdForceSaslPasswordAsk', TRUE,
             FALSE
diff --git a/plugins/config/class_pluginsConfigInLdap.inc b/plugins/config/class_pluginsConfigInLdap.inc
index c797cf0b745d69c21a3b182806d8a63bef6088af..b2034fd13622e6b96eb4dd519f59a0ec1e7806fe 100644
--- a/plugins/config/class_pluginsConfigInLdap.inc
+++ b/plugins/config/class_pluginsConfigInLdap.inc
@@ -22,7 +22,7 @@ class pluginsConfigInLdap extends multiPlugin
 {
   var $tabClass = 'SMALLCONFIGTABS';
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('Plugins'),
diff --git a/plugins/config/class_recoveryConfig.inc b/plugins/config/class_recoveryConfig.inc
index 905cec0c65d183924638faaea4fc1f5a8f691518..c32fe6eb2f3e434332a3ce14b4f2d7f9060d5145 100644
--- a/plugins/config/class_recoveryConfig.inc
+++ b/plugins/config/class_recoveryConfig.inc
@@ -20,7 +20,7 @@
 
 class recoveryConfig extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'     => _('Password recovery'),
@@ -32,7 +32,7 @@ class recoveryConfig extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array (
       'settings' => array (
@@ -40,40 +40,40 @@ class recoveryConfig extends simplePlugin
         'class'     => array ('alone'),
         'template'  => get_template_path('simpleplugin_section_alone.tpl'),
         'attrs'     => array (
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Activate password recovery'),
             _('Whether to activate or not password recovery feature'),
             'fdPasswordRecoveryActivated',
             FALSE
           ),
-          new MailAttribute (
+          new MailAttribute(
             _('Sender email address'),
             _('Email address from which mails will be sent'),
             'fdPasswordRecoveryEmail',
             TRUE,
             'to.be@chang.ed'
           ),
-          new IntAttribute (
+          new IntAttribute(
             _('Link validity (minutes)'),
             _('Number of minutes before a recovery link expires'),
             'fdPasswordRecoveryValidity',
             TRUE,
             0, FALSE, 10
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Salt for tokens'),
             _('Just a security measure, you can put anything in there, even random characters'),
             'fdPasswordRecoverySalt',
             TRUE,
             "SomethingSecretAndVeryLong"
           ),
-          new BooleanAttribute (
+          new BooleanAttribute(
             _('Allow the use of alternate addresses'),
             _('Users will also be able to enter one of theirs alternate addresses to recover their password'),
             'fdPasswordRecoveryUseAlternate',
             FALSE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Login attribute'), _('Usually uid, but you can use something else for instance in case of SSO'),
             'fdPasswordRecoveryLoginAttribute', TRUE,
             'uid'
@@ -83,14 +83,14 @@ class recoveryConfig extends simplePlugin
       'first_email' => array (
         'name' => _('First email'),
         'attrs' => array (
-          new StringAttribute (
+          new StringAttribute(
             _('Subject'),
             _('Subject of the first email'),
             'fdPasswordRecoveryMailSubject',
             TRUE,
             _("[FusionDirectory] Password recovery link")
           ),
-          new TextAreaAttribute (
+          new TextAreaAttribute(
             _('Body (first %s is login, second is link)'),
             _('Body of the first email, sent when the user ask for a new password. Use %s for the login and the recovery link.'),
             'fdPasswordRecoveryMailBody',
@@ -102,14 +102,14 @@ class recoveryConfig extends simplePlugin
       'second_email' => array (
         'name' => _('Second email'),
         'attrs' => array (
-          new StringAttribute (
+          new StringAttribute(
             _('Subject'),
             _('Subject of the second email'),
             'fdPasswordRecoveryMail2Subject',
             TRUE,
             _("[FusionDirectory] Password recovery successful")
           ),
-          new TextAreaAttribute (
+          new TextAreaAttribute(
             _('Body (%s is login)'),
             _('Body of the second email, sent to confirm the password has been changed. Use %s for the user login.'),
             'fdPasswordRecoveryMail2Body',
diff --git a/plugins/generic/references/class_reference.inc b/plugins/generic/references/class_reference.inc
index de8b2e5b0104aeea9b0ac21e32d91167188b8f8f..8d5c7f29ca42382eaf0a198ce939f00b0bd5ab9f 100644
--- a/plugins/generic/references/class_reference.inc
+++ b/plugins/generic/references/class_reference.inc
@@ -20,7 +20,7 @@
 
 class reference extends simplePlugin
 {
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('References'),
@@ -37,7 +37,7 @@ class reference extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'main' => array(
@@ -58,7 +58,7 @@ class reference extends simplePlugin
     $this->refs = NULL;
   }
 
-  function execute()
+  function execute (): string
   {
     if ($this->refs === NULL) {
       $this->fillRefs();
@@ -77,16 +77,16 @@ class reference extends simplePlugin
     $this->refs = $this->browseForeignKeys('references');
   }
 
-  function check()
+  function check (): array
   {
   }
 
-  function save()
+  function save (): array
   {
     return array();
   }
 
-  function remove($fulldelete = FALSE)
+  function remove (bool $fulldelete = FALSE): array
   {
     return array();
   }
diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc
index 254d762c2d14a9d7ba9ede9030402734fd7c71dd..6c5877e5dec9718aa955bcd5454ade4e7680765a 100644
--- a/plugins/personal/generic/class_user.inc
+++ b/plugins/personal/generic/class_user.inc
@@ -47,7 +47,7 @@ class user extends simplePlugin
 {
   private $was_locked;
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'   => _('User'),
@@ -77,8 +77,7 @@ class user extends simplePlugin
     );
   }
 
-  // The main function : information about attributes
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     global $config;
     $languages = Language::getList(TRUE);
@@ -90,21 +89,21 @@ class user extends simplePlugin
         'icon'  => 'geticon.php?context=types&icon=user&size=16',
         'attrs' => array(
           new HiddenAttribute('cn'),
-          new StringAttribute (
+          new StringAttribute(
             _('Last name'), _('Last name of this user'),
             'sn', TRUE,
             '', '', '/^[^,+"?()=<>;\\\\]+$/'
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('First name'), _('First name of this user'),
             'givenName', TRUE,
             '', '', '/^[^,+"?()=<>;\\\\]+$/'
           ),
-          new TextAreaAttribute (
+          new TextAreaAttribute(
             _('Description'), _('Short description of the user'),
             'description', FALSE
           ),
-          new ImageAttribute (
+          new ImageAttribute(
             _('Picture'), _('The avatar for this user'),
             'jpegPhoto', FALSE,
             150, 200, 'jpeg'
@@ -115,43 +114,43 @@ class user extends simplePlugin
         'name'  => _('Organizational contact information'),
         'icon'  => 'geticon.php?context=types&icon=contact&size=16',
         'attrs' => array(
-          new StringAttribute (
+          new StringAttribute(
             _('Location'), _('Location'),
             'l', FALSE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('State'), _('State'),
             'st', FALSE
           ),
-          new PostalAddressAttribute (
+          new PostalAddressAttribute(
             _('Address'), _('Business postal address'),
             'postalAddress', FALSE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Room No.'), _('Room number'),
             'roomNumber', FALSE
           ),
-          new PhoneNumberButtonAttribute (
+          new PhoneNumberButtonAttribute(
             _('Phone'), _('Business phone number'),
             'telephoneNumber', FALSE,
             '',
             'phone'
           ),
-          new PhoneNumberButtonAttribute (
+          new PhoneNumberButtonAttribute(
             _('Mobile'), _('Business mobile number'),
             'mobile', FALSE,
             '',
             'mobile'
           ),
-          new PhoneNumberAttribute (
+          new PhoneNumberAttribute(
             _('Pager'), _('Business pager number'),
             'pager', FALSE
           ),
-          new PhoneNumberAttribute (
+          new PhoneNumberAttribute(
             _('Fax'), _('Business fax number'),
             'facsimileTelephoneNumber', FALSE
           ),
-          new URLAttribute (
+          new URLAttribute(
             _('Homepage'), _('Personal homepage'),
             'labeledURI', FALSE
           ),
@@ -161,12 +160,12 @@ class user extends simplePlugin
         'name'  => _('Account information'),
         'icon'  => 'geticon.php?context=applications&icon=ldap&size=16',
         'attrs' => array(
-          new BaseSelectorAttribute (get_ou("userRDN")),
-          new UidAttribute (
+          new BaseSelectorAttribute(get_ou("userRDN")),
+          new UidAttribute(
             _('Login'), _('Login of this user'),
             'uid', TRUE
           ),
-          new SelectAttribute (
+          new SelectAttribute(
             _('Preferred language'), _('Preferred language'),
             'preferredLanguage', FALSE,
             array_keys($languages), '', array_values($languages)
@@ -181,15 +180,15 @@ class user extends simplePlugin
         'name'  => _('Personal contact information'),
         'icon'  => 'geticon.php?context=types&icon=contact&size=16',
         'attrs' => array(
-          new StringAttribute (
+          new StringAttribute(
             _('Display name'), _('Name this user should appear as. Used by Exchange.'),
             'displayName', FALSE
           ),
-          new PostalAddressAttribute (
+          new PostalAddressAttribute(
             _('Home address'), _('Home postal address'),
             'homePostalAddress', FALSE
           ),
-          new PhoneNumberAttribute (
+          new PhoneNumberAttribute(
             _('Private phone'), _('Home phone number'),
             'homePhone', FALSE
           ),
@@ -199,29 +198,29 @@ class user extends simplePlugin
         'name'  => _('Organizational information'),
         'icon'  => 'geticon.php?context=places&icon=folder&size=16',
         'attrs' => array(
-          new SetAttribute (
-            new StringAttribute (
+          new SetAttribute(
+            new StringAttribute(
               _('Title'), _('Title of a person in their organizational context. Each title is one value of this multi-valued attribute'),
               'title', FALSE
             )
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Organization'), _('Organization'),
             'o', FALSE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Unit'), _('Organizational unit this user belongs to'),
             'ou', FALSE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Department No.'), _('Department number'),
             'departmentNumber', FALSE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Employee No.'), _('Employee number'),
             'employeeNumber', FALSE
           ),
-          new StringAttribute (
+          new StringAttribute(
             _('Employee type'), _('Employee type'),
             'employeeType', FALSE
           ),
@@ -235,15 +234,15 @@ class user extends simplePlugin
     if ($config->get_cfg_value('SplitPostalAddress') == 'TRUE') {
       $attributesInfo['contact']['attrs'][2]->setVisible(FALSE);
       array_splice($attributesInfo['contact']['attrs'], 3, 0, array(
-        new StringAttribute (
+        new StringAttribute(
           _('Street'), _('Street part of the address'),
           'street', FALSE
         ),
-        new StringAttribute (
+        new StringAttribute(
           _('Post office box'), _('Post office box'),
           'postOfficeBox', FALSE
         ),
-        new IntAttribute (
+        new IntAttribute(
           _('Postal code'), _('Postal code'),
           'postalCode', FALSE,
           0, FALSE
@@ -262,13 +261,13 @@ class user extends simplePlugin
     $this->attributesAccess['uid']->setDisabled($this->initially_was_account && !$this->is_template);
 
     $filename = './plugins/users/images/default.jpg';
-    $fd       = fopen ($filename, 'rb');
-    $this->attributesAccess['jpegPhoto']->setPlaceholder(fread ($fd, filesize($filename)));
+    $fd       = fopen($filename, 'rb');
+    $this->attributesAccess['jpegPhoto']->setPlaceholder(fread($fd, filesize($filename)));
 
     $this->was_locked = $this->attributesAccess['userPassword']->isLocked();
   }
 
-  function resetCopyInfos()
+  function resetCopyInfos ()
   {
     parent::resetCopyInfos();
     $this->attributesAccess['uid']->setDisabled($this->initially_was_account && !$this->is_template);
@@ -305,7 +304,7 @@ class user extends simplePlugin
     return templateHandling::parseString($pattern, $attrs);
   }
 
-  function compute_dn()
+  function compute_dn (): string
   {
     global $config;
 
@@ -319,14 +318,14 @@ class user extends simplePlugin
     return $this->create_unique_dn($attribute, get_ou('userRDN').$this->base);
   }
 
-  function execute()
+  function execute (): string
   {
     $smarty = get_smarty();
     $smarty->append('css_files', 'plugins/users/style/user_tab.css');
     return parent::execute();
   }
 
-  protected function shouldSave()
+  protected function shouldSave (): bool
   {
     if ($this->attributesAccess['userPassword']->getClear() != '') {
       /* There may be hooks using this even if LDAP object is not modified */
@@ -335,7 +334,7 @@ class user extends simplePlugin
     return parent::shouldSave();
   }
 
-  protected function prepare_save ()
+  protected function prepare_save (): array
   {
     global $config;
     if ($config->get_cfg_value('SplitPostalAddress') == 'TRUE') {
@@ -348,7 +347,7 @@ class user extends simplePlugin
     return parent::prepare_save();
   }
 
-  function ldap_save()
+  function ldap_save (): array
   {
     $errors = parent::ldap_save();
 
@@ -365,7 +364,7 @@ class user extends simplePlugin
     return $errors;
   }
 
-  function post_save()
+  function post_save ()
   {
     global $ui;
 
@@ -379,7 +378,7 @@ class user extends simplePlugin
     return parent::post_save();
   }
 
-  function adapt_from_template($attrs, $skip = array())
+  function adapt_from_template (array $attrs, array $skip = array())
   {
     if ($this->uid != '') {
       $skip[] = 'uid';
@@ -390,7 +389,7 @@ class user extends simplePlugin
     }
   }
 
-  function callHook($cmd, array $addAttrs = array(), &$returnOutput = array(), &$returnCode = NULL)
+  function callHook ($cmd, array $addAttrs = array(), &$returnOutput = array(), &$returnCode = NULL): array
   {
     $addAttrs['passwordMethod'] = $this->attributesAccess['userPassword']->getMethod();
     $addAttrs['userLocked']     = (int)($this->attributesAccess['userPassword']->isLocked());
diff --git a/plugins/personal/roles/class_userRoles.inc b/plugins/personal/roles/class_userRoles.inc
index 95be4ba933063e18c98faf218c05598e5c5632cd..4b9348a0912f2bf8aa377160285b07769ca82c78 100644
--- a/plugins/personal/roles/class_userRoles.inc
+++ b/plugins/personal/roles/class_userRoles.inc
@@ -27,7 +27,7 @@ class userRoles extends simplePlugin
   protected $templateGroups         = array();
   protected $templateRoles          = array();
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array(
       'plShortName'     => _('Groups and roles'),
@@ -42,7 +42,7 @@ class userRoles extends simplePlugin
     );
   }
 
-  static function getAttributesInfo ()
+  static function getAttributesInfo (): array
   {
     return array(
       'groups' => array(
@@ -153,7 +153,7 @@ class userRoles extends simplePlugin
     $this->initially_was_account = $this->is_account;
   }
 
-  function is_this_account($attrs)
+  function is_this_account ($attrs)
   {
     if (!isset($attrs['dn'])) {
       if (isset($attrs['userGroups'])) { /* Template groups field */
@@ -167,7 +167,7 @@ class userRoles extends simplePlugin
     return FALSE;
   }
 
-  protected function ldap_remove()
+  protected function ldap_remove (): array
   {
     if ($this->is_template) {
       return parent::ldap_remove();
@@ -194,13 +194,13 @@ class userRoles extends simplePlugin
     return array();
   }
 
-  function save_object()
+  function save_object ()
   {
     parent::save_object();
     $this->is_account = ((count($this->rolesMembership) > 0) || (count($this->groupsMembership) > 0));
   }
 
-  protected function shouldSave()
+  protected function shouldSave (): bool
   {
     if (parent::shouldSave()) {
       return TRUE;
@@ -214,7 +214,7 @@ class userRoles extends simplePlugin
     return FALSE;
   }
 
-  function prepare_save()
+  function prepare_save (): array
   {
     $errors = parent::prepare_save();
     if ($this->is_template) {
@@ -224,7 +224,7 @@ class userRoles extends simplePlugin
     return $errors;
   }
 
-  function prepare_remove()
+  function prepare_remove ()
   {
     parent::prepare_remove();
     if ($this->is_template) {
@@ -233,7 +233,7 @@ class userRoles extends simplePlugin
     }
   }
 
-  function ldap_save()
+  function ldap_save (): array
   {
     $errors = parent::ldap_save();
 
@@ -344,7 +344,7 @@ class userRoles extends simplePlugin
     return $errors;
   }
 
-  function adapt_from_template($attrs, $skip = array())
+  function adapt_from_template (array $attrs, array $skip = array())
   {
     parent::adapt_from_template($attrs, $skip);
 
diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc
index 6c051d8ac0d656eaec41b6da466a7fba28286fea..1f323af32e6e4440db408e9a73ca4a99fe8bb213 100644
--- a/setup/class_setupStep.inc
+++ b/setup/class_setupStep.inc
@@ -31,69 +31,69 @@ class setupStep extends simplePlugin
 
   var $header_image = '';
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array();
   }
 
-  function __construct($parent)
+  function __construct ($parent)
   {
     parent::__construct(NULL, NULL, $parent);
     $this->update_strings();
   }
 
-  function update_strings()
+  function update_strings ()
   {
     die('abstract method');
   }
 
-  function get_short_name()
+  function get_short_name ()
   {
     return $this->s_short_name;
   }
 
-  function get_title()
+  function get_title ()
   {
     return $this->s_title;
   }
 
-  function get_description()
+  function get_description ()
   {
     return $this->s_description;
   }
 
-  function is_active()
+  function is_active ()
   {
     return $this->is_active;
   }
 
-  function is_enabled()
+  function is_enabled ()
   {
     return $this->is_enabled;
   }
 
-  function is_completed()
+  function is_completed ()
   {
     return $this->is_completed;
   }
 
-  function set_active($value = TRUE)
+  function set_active ($value = TRUE)
   {
     $this->is_active = (bool) $value;
   }
 
-  function set_enabled($value = TRUE)
+  function set_enabled ($value = TRUE)
   {
     $this->is_enabled = (bool) $value;
   }
 
-  function set_completed($value = TRUE)
+  function set_completed ($value = TRUE)
   {
     $this->is_completed = (bool) $value;
   }
 
   /* Return attributes handled by this setup step */
-  function get_attributes()
+  function get_attributes ()
   {
     $tmp = array();
     foreach (array_keys($this->attributesAccess) as $attr) {
@@ -103,7 +103,7 @@ class setupStep extends simplePlugin
   }
 
   /* bypass LDAP loading */
-  protected function loadAttributes()
+  protected function loadAttributes ()
   {
     foreach ($this->attributesInfo as $sectionInfo) {
       foreach ($sectionInfo['attrs'] as $attr) {
diff --git a/setup/class_setupStepChecks.inc b/setup/class_setupStepChecks.inc
index bdd7aa8269d3506bbcbc2a052707d33f0b6f725a..324fefb175ea582cd904467ae1901a9a06eb029e 100644
--- a/setup/class_setupStepChecks.inc
+++ b/setup/class_setupStepChecks.inc
@@ -23,7 +23,7 @@ class setupStepChecks extends setupStep
 {
   var $header_image = 'geticon.php?context=categories&icon=checks&size=48';
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'modules' => array(
@@ -43,7 +43,7 @@ class setupStepChecks extends setupStep
     );
   }
 
-  function update_strings()
+  function update_strings ()
   {
     $this->s_short_name   = _('Installation check');
     $this->s_title        = _('Installation check');
@@ -51,7 +51,7 @@ class setupStepChecks extends setupStep
   }
 
   /* Execute and display template */
-  function execute()
+  function execute (): string
   {
     $this->run_checks();
     return parent::execute();
@@ -237,7 +237,7 @@ class setupStepChecks extends setupStep
     $this->config_checks  = $config_checks;
   }
 
-  function save_object()
+  function save_object ()
   {
     parent::save_object();
      /* If everything is fine, set this step to completed
diff --git a/setup/class_setupStepConfig.inc b/setup/class_setupStepConfig.inc
index 7d66c1230f5b63c7031655bed5323506364623bd..172bea42b2ca27b2bb536e86ad4b5f57fca2847d 100644
--- a/setup/class_setupStepConfig.inc
+++ b/setup/class_setupStepConfig.inc
@@ -21,7 +21,7 @@
 
 class setupStepConfig_before_init extends setupStep
 {
-  function update_strings()
+  function update_strings ()
   {
     global $config;
     if (!isset($config->current['BASE'])) {
@@ -44,12 +44,12 @@ class setupStepConfig extends configInLdap
 
   protected $objectclasses = array('fusionDirectoryConf');
 
-  static function plInfo()
+  static function plInfo (): array
   {
     return array();
   }
 
-  function __construct($parent, $cv)
+  function __construct ($parent, $cv)
   {
     global $config;
     parent::__construct(CONFIGRDN.$config->current['BASE'], NULL, $parent, TRUE);
@@ -60,31 +60,31 @@ class setupStepConfig extends configInLdap
     $this->fdLanguage     = $cv['lang_selected'];
   }
 
-  function update_strings()
+  function update_strings ()
   {
     $infos = parent::plInfo();
     $this->header_image = $infos['plIcon'];
   }
 
-  function get_short_name()
+  function get_short_name ()
   {
     $infos = parent::plInfo();
     return $infos['plTitle'];
   }
 
-  function get_title()
+  function get_title ()
   {
     return $this->get_description();
   }
 
-  function get_description()
+  function get_description ()
   {
     $infos = parent::plInfo();
     return $infos['plDescription'];
   }
 
   /* Return attributes handled by this setup step */
-  function get_attributes()
+  function get_attributes ()
   {
     $tmp = array();
     foreach (array_keys($this->attributesAccess) as $attr) {
@@ -93,7 +93,7 @@ class setupStepConfig extends configInLdap
     return $tmp;
   }
 
-  function save_object()
+  function save_object ()
   {
     global $config;
     parent::save_object();
@@ -127,64 +127,64 @@ class setupStepConfig extends configInLdap
     }
   }
 
-  function is_active()
+  function is_active ()
   {
     return $this->is_active;
   }
 
-  function is_enabled()
+  function is_enabled ()
   {
     return $this->is_enabled;
   }
 
-  function is_completed()
+  function is_completed ()
   {
     return $this->is_completed;
   }
 
-  function set_active($value = TRUE)
+  function set_active ($value = TRUE)
   {
     $this->is_active = (bool) $value;
   }
 
-  function set_enabled($value = TRUE)
+  function set_enabled ($value = TRUE)
   {
     $this->is_enabled = (bool) $value;
   }
 
-  function set_completed($value = TRUE)
+  function set_completed ($value = TRUE)
   {
     $this->is_completed = (bool) $value;
   }
 
   /* bypass acl system as there is no user login */
-  function acl_is_writeable($attribute, $skip_write = FALSE)
+  function acl_is_writeable ($attribute, $skip_write = FALSE): bool
   {
     return TRUE;
   }
-  function acl_is_readable($attribute)
+  function acl_is_readable ($attribute): bool
   {
     return TRUE;
   }
-  function acl_is_createable($base = "")
+  function acl_is_createable ($base = ""): bool
   {
     return TRUE;
   }
-  function acl_is_removeable($base = "")
+  function acl_is_removeable ($base = ""): bool
   {
     return TRUE;
   }
-  function acl_is_moveable($base = "")
+  function acl_is_moveable ($base = ""): bool
   {
     return TRUE;
   }
-  function aclGetPermissions($attribute = '0', $base = NULL, $skipWrite = FALSE)
+  function aclGetPermissions ($attribute = '0', $base = NULL, $skipWrite = FALSE): string
   {
     return 'cmdrw';
   }
 
   /* We need static method to work as if we were configInLdap */
-  static function isAccount($attrs)
+  static function isAccount ($attrs)
   {
     return configInLdap::isAccount($attrs);
   }
diff --git a/setup/class_setupStepFinish.inc b/setup/class_setupStepFinish.inc
index ca05ea45af72f98a608e30d93c97f6a63e1f891f..1a2960c3e4d7a68065317702089c0d9d9a940254 100644
--- a/setup/class_setupStepFinish.inc
+++ b/setup/class_setupStepFinish.inc
@@ -23,7 +23,7 @@ class setupStepFinish extends setupStep
 {
   var $header_image = 'geticon.php?context=devices&icon=server&size=48';
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'welcome' => array(
@@ -35,7 +35,7 @@ class setupStepFinish extends setupStep
     );
   }
 
-  function update_strings()
+  function update_strings ()
   {
     $this->s_short_name   = _('Finish');
     $this->s_title        = _('Finish - write the configuration file');
@@ -79,7 +79,7 @@ class setupStepFinish extends setupStep
     $config->checkLdapConfig(TRUE);
   }
 
-  function execute()
+  function execute (): string
   {
     /* Check if there is currently an active fusiondirectory.conf */
     $exists   = file_exists(CONFIG_DIR."/".CONFIG_FILE);
@@ -98,7 +98,7 @@ class setupStepFinish extends setupStep
     return parent::execute();
   }
 
-  function save_object()
+  function save_object ()
   {
     parent::save_object();
     $exists = file_exists(CONFIG_DIR.'/'.CONFIG_FILE);
diff --git a/setup/class_setupStepLanguage.inc b/setup/class_setupStepLanguage.inc
index 746634e4a77a22c66faf99a44b5d360892ab19e9..4c0307a461a8080f9478150e7d62f4d94de1cc17 100644
--- a/setup/class_setupStepLanguage.inc
+++ b/setup/class_setupStepLanguage.inc
@@ -23,7 +23,7 @@ class setupStepLanguage extends setupStep
 {
   var $header_image = 'geticon.php?context=applications&icon=config-language&size=48';
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'lang' => array(
@@ -47,14 +47,14 @@ class setupStepLanguage extends setupStep
     );
   }
 
-  function __construct($parent)
+  function __construct ($parent)
   {
     parent::__construct($parent);
     $this->lang = Language::detect();
     $this->attributesAccess['lang_selected']->setSize(20);
   }
 
-  function update_strings()
+  function update_strings ()
   {
     $this->s_short_name   = _('Language setup');
     $this->s_title        = _('Language setup');
@@ -62,7 +62,7 @@ class setupStepLanguage extends setupStep
     $this->msg            = _('At this point, you can select the site wide default language. Choosing "automatic" will use the language requested by the browser. This setting can be overriden per user.');
   }
 
-  function execute()
+  function execute (): string
   {
     $languages = Language::getList(TRUE);
     asort($languages);
@@ -71,7 +71,7 @@ class setupStepLanguage extends setupStep
     return parent::execute();
   }
 
-  function save_object()
+  function save_object ()
   {
     parent::save_object();
     $this->is_completed   = TRUE;
@@ -83,5 +83,3 @@ class setupStepLanguage extends setupStep
     }
   }
 }
-
-?>
diff --git a/setup/class_setupStepLdap.inc b/setup/class_setupStepLdap.inc
index 98ae9ab9fae27af90f3e35b99f72d71b4a557558..95848affba21035ec28e2cb9e91316b26935c3be 100644
--- a/setup/class_setupStepLdap.inc
+++ b/setup/class_setupStepLdap.inc
@@ -26,7 +26,7 @@ class setupStepLdap extends setupStep
   var $connect_id = FALSE;
   var $bind_id    = FALSE;
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'connection' => array(
@@ -91,7 +91,7 @@ class setupStepLdap extends setupStep
     );
   }
 
-  function __construct($parent)
+  function __construct ($parent)
   {
     parent::__construct($parent);
     $this->update_strings();
@@ -102,14 +102,14 @@ class setupStepLdap extends setupStep
     $this->status = $this->get_connection_status();
   }
 
-  function update_strings()
+  function update_strings ()
   {
     $this->s_short_name   = _('LDAP setup');
     $this->s_title        = _('LDAP connection setup');
     $this->s_description  = _('This dialog performs the basic configuration of the LDAP connectivity for FusionDirectory.');
   }
 
-  function update_base_choices()
+  function update_base_choices ()
   {
     $attr = @LDAP::get_naming_contexts($this->connection);
     unset($attr['count']);
@@ -130,7 +130,7 @@ class setupStepLdap extends setupStep
     }
   }
 
-  function save_object()
+  function save_object ()
   {
     $base       = $this->base;
     $connection = $this->connection;
@@ -154,7 +154,7 @@ class setupStepLdap extends setupStep
     }
   }
 
-  function get_connection_status()
+  function get_connection_status ()
   {
     $this->connect_id = FALSE;
     $this->bind_id    = FALSE;
@@ -196,7 +196,7 @@ class setupStepLdap extends setupStep
     }
   }
 
-  function check()
+  function check (): array
   {
     $error = parent::check();
     if (!empty($error)) {
diff --git a/setup/class_setupStepMigrate.inc b/setup/class_setupStepMigrate.inc
index 48e52a003320bf8774d072e5cbaaaab361829b94..56b344a2c70e5cd469c11e30bb2e98cd1d782bac 100644
--- a/setup/class_setupStepMigrate.inc
+++ b/setup/class_setupStepMigrate.inc
@@ -48,7 +48,7 @@ class CheckFailedException extends FusionDirectoryException
 {
   private $error;
 
-  public function __construct($msg, $error)
+  public function __construct ($msg, $error)
   {
     parent::__construct($msg);
     $this->error = $error;
@@ -69,7 +69,7 @@ class StepMigrateDialog extends GenericDialog
   private $tplfile;
   private $check;
 
-  public function __construct(&$check, $tpl, $infos)
+  public function __construct (&$check, $tpl, $infos)
   {
     $this->attribute  = NULL;
     $this->dialog     = NULL;
@@ -116,7 +116,7 @@ class StepMigrateCheck
   public $fnc;
   private $step;
 
-  public function __construct($step, $name, $title)
+  public function __construct ($step, $name, $title)
   {
     $this->name   = $name;
     $this->title  = $title;
@@ -140,7 +140,7 @@ class StepMigrateCheck
     }
   }
 
-  public function save_object()
+  public function save_object ()
   {
     if (isset($_POST[$this->name.'_create'])) {
       $createFnc = $this->fnc.'_create';
@@ -198,7 +198,7 @@ class setupStepMigrate extends setupStep
   /* Defaults ACL roles */
   var $defaultRoles;
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'checks' => array(
@@ -212,13 +212,13 @@ class setupStepMigrate extends setupStep
     );
   }
 
-  function __construct($parent)
+  function __construct ($parent)
   {
     parent::__construct($parent);
     $this->fill_defaultRoles();
   }
 
-  function update_strings()
+  function update_strings ()
   {
     $this->s_short_name   = _('LDAP inspection');
     $this->s_title        = _('LDAP inspection');
@@ -292,7 +292,7 @@ class setupStepMigrate extends setupStep
     return preg_replace("/\n$/", '', $ret);
   }
 
-  function execute()
+  function execute (): string
   {
     if (empty($this->checks) || isset($_POST['reload'])) {
       $this->initialize_checks();
@@ -303,7 +303,7 @@ class setupStepMigrate extends setupStep
     return parent::execute();
   }
 
-  function save_object()
+  function save_object ()
   {
     $this->is_completed = TRUE;
     parent::save_object();
diff --git a/setup/class_setupStepWelcome.inc b/setup/class_setupStepWelcome.inc
index 0f5f0755fd3cdd0e1a795c3be894b46d9085779e..ca74c45408be1cbbbb1a4f848a6a063a727fce18 100644
--- a/setup/class_setupStepWelcome.inc
+++ b/setup/class_setupStepWelcome.inc
@@ -23,7 +23,7 @@ class setupStepWelcome extends setupStep
 {
   var $header_image = 'geticon.php?context=applications&icon=config-welcome&size=48';
 
-  static function getAttributesInfo()
+  static function getAttributesInfo (): array
   {
     return array(
       'welcome' => array(
@@ -35,7 +35,7 @@ class setupStepWelcome extends setupStep
     );
   }
 
-  function __construct($parent)
+  function __construct ($parent)
   {
     parent::__construct($parent);
 
@@ -45,14 +45,14 @@ class setupStepWelcome extends setupStep
   }
 
   /* We need to init them with a method to be able to use _() */
-  function update_strings()
+  function update_strings ()
   {
     $this->s_short_name   = _('Welcome');
     $this->s_title        = _('Welcome to FusionDirectory setup wizard');
     $this->s_description  = _('The welcome message');
   }
 
-  function execute()
+  function execute (): string
   {
     $smarty = get_smarty();
     $smarty->assign('auth_id', session_id());
@@ -61,7 +61,7 @@ class setupStepWelcome extends setupStep
     return parent::execute();
   }
 
-  function save_object()
+  function save_object ()
   {
     parent::save_object();
     $id = "";