Completed
Pull Request — master (#3788)
by Craig
01:31
created
Zikula/Bundle/HookBundle/Dispatcher/Storage/Doctrine/DoctrineStorage.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
     public function getSubscriberByEventName($eventName)
136 136
     {
137 137
         return $this->em->createQueryBuilder()->select('t')
138
-                 ->from(Entity\HookSubscriberEntity::class, 't')
139
-                 ->where('t.eventname = ?1')
140
-                 ->getQuery()->setParameter(1, $eventName)
141
-                 ->getArrayResult();
138
+                    ->from(Entity\HookSubscriberEntity::class, 't')
139
+                    ->where('t.eventname = ?1')
140
+                    ->getQuery()->setParameter(1, $eventName)
141
+                    ->getArrayResult();
142 142
     }
143 143
 
144 144
     /**
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
     {
637 637
         // return $areaName?
638 638
         $hookArea = $this->em->getRepository(Entity\HookAreaEntity::class)
639
-                   ->findOneBy(['areaname' => $areaName]);
639
+                    ->findOneBy(['areaname' => $areaName]);
640 640
 
641 641
         if (!$hookArea) {
642 642
             return false;
Please login to merge, or discard this patch.
src/lib/i18n/ZGettext.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@
 block discarded – undo
221 221
         if (!$textDomain['reader']) {
222 222
             //$path = realpath($textDomain['path']."$locale/$categorypath/$domain.mo");
223 223
             // hard coding the LC type due to strange differences on various platforms
224
-            $path = realpath($textDomain['path']."$locale/LC_MESSAGES/$domain.mo");
224
+            $path = realpath($textDomain['path'] . "$locale/LC_MESSAGES/$domain.mo");
225 225
             $reader = new StreamReader_CachedFile($path);
226 226
             $textDomain['reader'] = new ZMO($reader, $cache);
227 227
             $codeset = (isset($textDomain['codeset'])) ? $textDomain['codeset'] : ((version_compare(\PHP_VERSION, '5.6.0', '<')) ? ini_get('mbstring.internal_encoding') : ini_get('default_charset'));
Please login to merge, or discard this patch.
src/lib/EventHandlers/SystemListeners.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
         if ($event['stage'] & Zikula_Core::STAGE_TABLES) {
133 133
             if (ServiceUtil::getManager()->getParameter('installed')) {
134 134
                 ServiceUtil::loadPersistentServices();
135
-                PluginUtil::loadPlugins(realpath(realpath('.').'/plugins'), "SystemPlugin");
135
+                PluginUtil::loadPlugins(realpath(realpath('.') . '/plugins'), "SystemPlugin");
136 136
                 EventUtil::loadPersistentEvents();
137 137
             }
138 138
         }
Please login to merge, or discard this patch.
src/lib/legacy/DoctrineExtensions/StandardFields/StandardFieldsListener.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,7 +73,8 @@  discard block
 block discarded – undo
73 73
 
74 74
                 if (isset($config['update'])) {
75 75
                     foreach ($config['update'] as $field) {
76
-                        if (!isset($changeSet[$field])) { // let manual values
76
+                        if (!isset($changeSet[$field])) {
77
+// let manual values
77 78
                             $needChanges = true;
78 79
                             $meta->getReflectionProperty($field)->setValue($object, $ea->getUserIdValue($meta, $field));
79 80
                         }
@@ -143,7 +144,8 @@  discard block
 block discarded – undo
143 144
         if ($config = $this->getConfiguration($om, $meta->name)) {
144 145
             if (isset($config['update'])) {
145 146
                 foreach ($config['update'] as $field) {
146
-                    if ($meta->getReflectionProperty($field)->getValue($object) === null) { // let manual values
147
+                    if ($meta->getReflectionProperty($field)->getValue($object) === null) {
148
+// let manual values
147 149
                         $meta->getReflectionProperty($field)->setValue($object, $ea->getUserIdValue($meta, $field));
148 150
                     }
149 151
                 }
@@ -151,7 +153,8 @@  discard block
 block discarded – undo
151 153
 
152 154
             if (isset($config['create'])) {
153 155
                 foreach ($config['create'] as $field) {
154
-                    if ($meta->getReflectionProperty($field)->getValue($object) === null) { // let manual values
156
+                    if ($meta->getReflectionProperty($field)->getValue($object) === null) {
157
+// let manual values
155 158
                         $meta->getReflectionProperty($field)->setValue($object, $ea->getUserIdValue($meta, $field));
156 159
                     }
157 160
                 }
Please login to merge, or discard this patch.
src/lib/legacy/Zikula/Doctrine/Template/Listener/Logging.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@
 block discarded – undo
42 42
             $diff = [];
43 43
             foreach ($oldValues as $column => $oldValue) {
44 44
                 if (empty($oldValue) && isset($data[$column]) && !empty($data[$column])) {
45
-                    $diff[$column] = 'I: '.$data[$column];
45
+                    $diff[$column] = 'I: ' . $data[$column];
46 46
                 } elseif (!empty($oldValue) && isset($data[$column]) && !empty($data[$column])) {
47
-                    $diff[$column] = 'U: '.$data[$column];
47
+                    $diff[$column] = 'U: ' . $data[$column];
48 48
                 } elseif (!empty($oldValue) && empty($data[$column])) {
49
-                    $diff[$column] = 'D: '.$oldValue;
49
+                    $diff[$column] = 'D: ' . $oldValue;
50 50
                 }
51 51
             }
52 52
 
Please login to merge, or discard this patch.
src/lib/legacy/Zikula/Doctrine/Template/Listener/Base.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         } elseif ($treatedRecord instanceof Doctrine_Table) {
37 37
             return $treatedRecord;
38 38
         } else {
39
-            throw new LogicException("Zikula_Doctrine_Template_Listener_Base::getTableFromEvent() unknown invoker: " + get_class($treatedRecord));
39
+            throw new LogicException("Zikula_Doctrine_Template_Listener_Base::getTableFromEvent() unknown invoker: " +get_class($treatedRecord));
40 40
         }
41 41
     }
42 42
 
Please login to merge, or discard this patch.
src/lib/legacy/Zikula/Doctrine/Template/Listener/Categorisable.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
         if (!$query->contains($dql)) {
38 38
             $query->leftJoin($dql)
39
-                  ->leftJoin($aliasCategories.'.Category '.$params['alias'].'Cat');
39
+                    ->leftJoin($aliasCategories.'.Category '.$params['alias'].'Cat');
40 40
         }
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@
 block discarded – undo
32 32
 
33 33
         // aliases must be specific to entities
34 34
         $aliasCategories = $params['alias'] . 'Catmapobj';
35
-        $dql = $params['alias'].'.Categories '.$aliasCategories.' INDEXBY '.$aliasCategories.'.reg_property';
35
+        $dql = $params['alias'] . '.Categories ' . $aliasCategories . ' INDEXBY ' . $aliasCategories . '.reg_property';
36 36
 
37 37
         if (!$query->contains($dql)) {
38 38
             $query->leftJoin($dql)
39
-                  ->leftJoin($aliasCategories.'.Category '.$params['alias'].'Cat');
39
+                  ->leftJoin($aliasCategories . '.Category ' . $params['alias'] . 'Cat');
40 40
         }
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
src/lib/legacy/Zikula/Doctrine/Template/Categorisable.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $record = $this->getInvoker();
30 30
 
31 31
         $recordClass  = get_class($record);
32
-        $subclassName = 'GeneratedDoctrineModel_'.  $recordClass.'_EntityCategory';
32
+        $subclassName = 'GeneratedDoctrineModel_' . $recordClass . '_EntityCategory';
33 33
         $module       = substr($recordClass, 0, strpos($recordClass, '_'));
34 34
 
35 35
         if (!class_exists($subclassName)) {
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             $idColumn = $idColumn[0];
45 45
         }
46 46
 
47
-        $this->hasMany($subclassName.' as Categories', [
47
+        $this->hasMany($subclassName . ' as Categories', [
48 48
             'local' => $idColumn,
49 49
             'foreign' => 'obj_id',
50 50
             'cascade' => ['delete']
@@ -69,12 +69,12 @@  discard block
 block discarded – undo
69 69
 
70 70
         $dir = 'doctrinemodels/GeneratedDoctrineModel/' . str_replace('_', DIRECTORY_SEPARATOR, $modelClass);
71 71
         if (CacheUtil::createLocalDir($dir, ServiceUtil::getManager()->getParameter('system.chmod_dir'))) {
72
-            $subclassName = 'GeneratedDoctrineModel_'.$modelClass.'_EntityCategory';
73
-            $fileContents = '<?php class '.$subclassName.' extends Zikula_Doctrine_Model_EntityCategory { }';
72
+            $subclassName = 'GeneratedDoctrineModel_' . $modelClass . '_EntityCategory';
73
+            $fileContents = '<?php class ' . $subclassName . ' extends Zikula_Doctrine_Model_EntityCategory { }';
74 74
             $fileName = 'EntityCategory.php';
75 75
 
76 76
             // save new model
77
-            file_put_contents(CacheUtil::getLocalDir().'/'.$dir.'/'.$fileName, $fileContents);
77
+            file_put_contents(CacheUtil::getLocalDir() . '/' . $dir . '/' . $fileName, $fileContents);
78 78
 
79 79
             // save required data for later use
80 80
             $modelsInfo = ModUtil::getVar('ZikulaCategoriesModule', 'EntityCategorySubclasses', []);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             ];
85 85
             ModUtil::setVar('ZikulaCategoriesModule', 'EntityCategorySubclasses', $modelsInfo);
86 86
         } else {
87
-            throw new Exception('Creation of the cache directory '.$dir.' failed');
87
+            throw new Exception('Creation of the cache directory ' . $dir . ' failed');
88 88
         }
89 89
     }
90 90
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                                                                                                         $prop);
127 127
         // throw an excption when $prop is not valid
128 128
         if (!$registry) {
129
-            throw new Exception('Property '.$prop.' not found');
129
+            throw new Exception('Property ' . $prop . ' not found');
130 130
         }
131 131
 
132 132
         // search for existring object
Please login to merge, or discard this patch.
src/lib/legacy/Zikula/Form/Plugin/CategoryCheckboxList.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@
 block discarded – undo
243 243
             if (!$collection) {
244 244
                 $collection = new \Doctrine\Common\Collections\ArrayCollection();
245 245
                 $entityManager->getClassMetadata($entityClass)
246
-                   ->setFieldValue($entity, $this->dataField, $collection);
246
+                    ->setFieldValue($entity, $this->dataField, $collection);
247 247
             }
248 248
 
249 249
             if (is_array($this->getSelectedValue())) {
Please login to merge, or discard this patch.