[icinga-checkins] icinga.org: icingaweb2-module-director/master: Just a couple of phpcs complaints fixed

git at icinga.org git at icinga.org
Tue Oct 25 04:39:55 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: 5b4e7509f442aa57e3ab7cbd9062eccceb66bc0d
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=5b4e7509f442aa57e3ab7cbd9062eccceb66bc0d

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri Oct 21 21:13:33 2016 +0000

Just a couple of phpcs complaints fixed

---

 application/forms/IcingaServiceForm.php                      |   10 +++++++---
 library/Director/Data/PropertiesFilter.php                   |    3 ++-
 .../Data/PropertiesFilter/ArrayCustomVariablesFilter.php     |    7 ++++---
 .../Director/Data/PropertiesFilter/CustomVariablesFilter.php |    3 ++-
 library/Director/Objects/IcingaHost.php                      |    7 +++++--
 5 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/application/forms/IcingaServiceForm.php b/application/forms/IcingaServiceForm.php
index 142228d..c2f7105 100644
--- a/application/forms/IcingaServiceForm.php
+++ b/application/forms/IcingaServiceForm.php
@@ -48,7 +48,7 @@ class IcingaServiceForm extends DirectorObjectForm
             if (!$this->isNew() && $this->host === null) {
                 $this->host = $this->object->getResolvedRelated('host');
             }
-        } catch(NestingError $nestingError) {
+        } catch (NestingError $nestingError) {
             // ignore for the form to load
         }
 
@@ -279,8 +279,12 @@ class IcingaServiceForm extends DirectorObjectForm
     protected function addApplyForElement()
     {
         if ($this->object->isApplyRule()) {
-            $hostProperties = IcingaHost::enumProperties($this->object->getConnection(), 'host.',
-                new ArrayCustomVariablesFilter());
+            $hostProperties = IcingaHost::enumProperties(
+                $this->object->getConnection(),
+                'host.',
+                new ArrayCustomVariablesFilter()
+            );
+
             $this->addElement('select', 'apply_for', array(
                 'label' => $this->translate('Apply For'),
                 'class' => 'assign-property autosubmit',
diff --git a/library/Director/Data/PropertiesFilter.php b/library/Director/Data/PropertiesFilter.php
index 5ebf2c6..8f103b1 100644
--- a/library/Director/Data/PropertiesFilter.php
+++ b/library/Director/Data/PropertiesFilter.php
@@ -17,7 +17,8 @@ class PropertiesFilter
         'accept_config',
     );
 
-    public function match($type, $name, $object=null) {
+    public function match($type, $name, $object = null)
+    {
         return ($type != self::$HOST_PROPERTY || !in_array($name, $this->blacklist));
     }
 }
diff --git a/library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php b/library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php
index 06e56a7..a6e481b 100644
--- a/library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php
+++ b/library/Director/Data/PropertiesFilter/ArrayCustomVariablesFilter.php
@@ -2,11 +2,12 @@
 
 namespace Icinga\Module\Director\Data\PropertiesFilter;
 
-class ArrayCustomVariablesFilter extends CustomVariablesFilter {
-    public function match($type, $name, $object=null) {
+class ArrayCustomVariablesFilter extends CustomVariablesFilter
+{
+    public function match($type, $name, $object = null)
+    {
         return parent::match($type, $name, $object)
         && $object !== null
         && preg_match('/DataTypeArray[\w]*$/', $object->datatype);
     }
 }
-
diff --git a/library/Director/Data/PropertiesFilter/CustomVariablesFilter.php b/library/Director/Data/PropertiesFilter/CustomVariablesFilter.php
index 7a8c7b6..91ef9cd 100644
--- a/library/Director/Data/PropertiesFilter/CustomVariablesFilter.php
+++ b/library/Director/Data/PropertiesFilter/CustomVariablesFilter.php
@@ -6,7 +6,8 @@ use Icinga\Module\Director\Data\PropertiesFilter;
 
 class CustomVariablesFilter extends PropertiesFilter
 {
-    public function match($type, $name, $object=null) {
+    public function match($type, $name, $object = null)
+    {
         return parent::match($type, $name, $object) && $type === self::$CUSTOM_PROPERTY;
     }
 }
diff --git a/library/Director/Objects/IcingaHost.php b/library/Director/Objects/IcingaHost.php
index 3e176fb..54f086d 100644
--- a/library/Director/Objects/IcingaHost.php
+++ b/library/Director/Objects/IcingaHost.php
@@ -82,8 +82,11 @@ class IcingaHost extends IcingaObject
 
     protected $supportsFields = true;
 
-    public static function enumProperties(DbConnection $connection = null, $prefix = '', $filter= null)
-    {
+    public static function enumProperties(
+        DbConnection $connection = null,
+        $prefix = '',
+        $filter = null
+    ) {
         $hostProperties = array();
         if ($filter === null) {
             $filter = new PropertiesFilter();



More information about the icinga-checkins mailing list