]> git.agnieray.net Git - galette.git/commitdiff
Scrutinizer Auto-Fixes
authorScrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>
Thu, 11 Jun 2020 14:06:37 +0000 (14:06 +0000)
committerJohan Cwiklinski <trasher@x-tnd.be>
Thu, 11 Jun 2020 14:21:19 +0000 (16:21 +0200)
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com

17 files changed:
galette/config/galette_tcpdf_config.php
galette/includes/routes/ajax.routes.php
galette/includes/routes/management.routes.php
galette/includes/routes/plugins.routes.php
galette/includes/routes/public_pages.routes.php
galette/lib/Galette/Common/ClassLoader.php
galette/lib/Galette/Controllers/CsvController.php
galette/lib/Galette/Controllers/DynamicTranslationsController.php
galette/lib/Galette/Controllers/GaletteController.php
galette/lib/Galette/Core/Translator.php
galette/lib/Galette/Entity/Group.php
galette/lib/Galette/Entity/I18nTrait.php
galette/lib/Galette/Entity/PdfModel.php
galette/lib/Galette/Repository/Contributions.php
galette/lib/Galette/Repository/Repository.php
galette/lib/Galette/Repository/SavedSearches.php
galette/lib/Galette/Util/Telemetry.php

index 0b048d00e3fbd08450691a7326d21bb27d48b339..6f502a9c8a1cbf50b4b9ea9e68c187f5ac661911 100644 (file)
@@ -199,7 +199,7 @@ define('K_TITLE_MAGNIFICATION', 1.3);
 /**
  * Reduction factor for small font.
  */
-define('K_SMALL_RATIO', 2/3);
+define('K_SMALL_RATIO', 2 / 3);
 
 /**
  * Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language.
index a0fb5da60d3f9fa1d7858b7229ecc91c25f1dd59..1340873fc293c4f4089f1c073be8751a50288222 100644 (file)
@@ -41,10 +41,10 @@ use Galette\Entity\ContributionsTypes;
 use Galette\Repository\Members;
 use Galette\Filters\MembersList;
 
-$app->group('/ajax', function() use ($authenticate) {
+$app->group('/ajax', function () use ($authenticate) {
     $this->get(
         '/messages',
-        function($request, $response) {
+        function ($request, $response) {
             $this->view->render(
                 $response,
                 'ajax_messages.tpl'
@@ -55,7 +55,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->post(
         'photo',
-        function($request, $response) {
+        function ($request, $response) {
             $post = $request->getParsedBody();
             $ret = ['result' => false];
 
@@ -116,7 +116,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->post(
         '/suggest/towns',
-        function($request, $response) {
+        function ($request, $response) {
             $post = $request->getParsedBody();
 
             $ret = [];
@@ -159,7 +159,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->post(
         '/suggest/countries',
-        function($request, $response) {
+        function ($request, $response) {
             $post = $request->getParsedBody();
 
             $ret = [];
@@ -193,7 +193,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->get(
         '/telemetry/infos',
-        function($request, $response) {
+        function ($request, $response) {
             $telemetry = new \Galette\Util\Telemetry(
                 $this->zdb,
                 $this->preferences,
@@ -207,7 +207,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->post(
         '/telemetry/send',
-        function($request, $response) {
+        function ($request, $response) {
             $telemetry = new \Galette\Util\Telemetry(
                 $this->zdb,
                 $this->preferences,
@@ -232,7 +232,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->get(
         '/telemetry/registered',
-        function($request, $response) {
+        function ($request, $response) {
             $this->preferences->pref_registration_date = date('Y-m-d H:i:s');
             $this->preferences->store();
             return $response->withJson(['message' => _T('Thank you for registering!')]);
@@ -241,7 +241,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->post(
         '/contribution/dates',
-        function($request, $response) {
+        function ($request, $response) {
             $post = $request->getParsedBody();
 
             $contrib = new Contribution(
@@ -263,7 +263,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->post(
         '/contribution/members[/{page:\d+}[/{search}]]',
-        function($request, $response, $args) {
+        function ($request, $response, $args) {
             $post = $request->getParsedBody();
             $filters = new MembersList();
             if (isset($post['page'])) {
@@ -308,7 +308,7 @@ $app->group('/ajax', function() use ($authenticate) {
 
     $this->post(
         '/password/strength',
-        function($request, $response) {
+        function ($request, $response) {
             //post params may be passed from security tab test password
             $post = $request->getParsedBody();
 
index 56282f7fde213ab13918607fa6ea4acb48d2d92b..f82bbffb9240df723afcb6b98b014680a5c4ba59 100644 (file)
@@ -246,7 +246,7 @@ $app->post(
 
 $app->get(
     '/texts[/{lang}/{ref}]',
-    function($request, $response, $args) {
+    function ($request, $response, $args) {
         if (!isset($args['lang'])) {
             $args['lang'] = $this->preferences->pref_lang;
         }
@@ -280,7 +280,7 @@ $app->get(
 
 $app->post(
     '/texts/change',
-    function($request, $response) {
+    function ($request, $response) {
         $post = $request->getParsedBody();
         return $response
             ->withStatus(301)
@@ -299,7 +299,7 @@ $app->post(
 
 $app->post(
     '/texts',
-    function($request, $response) {
+    function ($request, $response) {
         $post = $request->getParsedBody();
         $texts = new Texts($this->preferences, $this->router);
 
index e2a0cdc0f0d1d12a2a4b04c22b46ed43a6aaa905..0860ad8c234aa3d438544fb0c37614a28fddcba8 100644 (file)
 
 $app->group(
     '/plugins',
-    function() use ($authenticate, $app) {
+    function () use ($authenticate, $app) {
         $container = $this->getContainer();
         $modules = $container->plugins->getModules();
 
         //Global route to access plugin resources (CSS, JS, images, ...)
         $this->get(
             '/{plugin}/res/{path:.*}',
-            function($request, $response, $args) {
+            function ($request, $response, $args) {
                 $plugin = $args['plugin'];
                 $path = $args['path'];
                 $ext = pathinfo($args['path'])['extension'];
@@ -78,17 +78,17 @@ $app->group(
 
         //Declare configured routes for each plugin
         foreach ($modules as $module_id => $module) {
-            $container['Plugin ' . $module['name']] = function($c) use ($module_id) {
+            $container['Plugin ' . $module['name']] = function ($c) use ($module_id) {
                 return $module_id;
             };
 
             $this->group(
                 '/' . $module['route'],
-                function() use ($module, $module_id, $authenticate) {
+                function () use ($module, $module_id, $authenticate) {
                     //Plugin home: give information
                     $this->get(
                         '',
-                        function($request, $response) use ($module) {
+                        function ($request, $response) use ($module) {
                             $params = [
                                 'page_title'    => $module['name'],
                                 'name'          => $module['name'],
index 786e1c5b8ee199d1775d56ea2d71f93475bd9cd9..3a015d53f084e9928e50d3e6fdaba012a888b1fb 100644 (file)
@@ -40,7 +40,7 @@ use Galette\Controllers\Crud;
 use Galette\Repository\Members;
 use Galette\Filters\MembersList;
 
-$showPublicPages = function($request, $response, $next) use ($container) {
+$showPublicPages = function ($request, $response, $next) use ($container) {
     $login = $container->login;
     $preferences = $container->preferences;
 
@@ -58,7 +58,7 @@ $showPublicPages = function($request, $response, $next) use ($container) {
     return $next($request, $response);
 };
 
-$app->group('/public', function() {
+$app->group('/public', function () {
     //public members list
     $this->get(
         '/{type:list|trombi}[/{option:page|order}/{value:\d+}]',
@@ -73,7 +73,7 @@ $app->group('/public', function() {
 
     $this->get(
         '/members[/{option:page|order}/{value:\d+}]',
-        function($request, $response, $args = []) {
+        function ($request, $response, $args = []) {
             $args['type'] = 'list';
             return $response
                 ->withStatus(301)
@@ -83,7 +83,7 @@ $app->group('/public', function() {
 
     $this->get(
         '/trombinoscope',
-        function($request, $response, $args = []) {
+        function ($request, $response, $args = []) {
             $args['type'] = 'trombi';
             return $response
                 ->withStatus(301)
index 9632fb7a8669f956b3bed2844a84e89b3f2f9740..86725284c9131e28df3a599a7f040aafb1d22a35 100644 (file)
@@ -195,8 +195,8 @@ class ClassLoader
         }
 
         $path = ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
-               . $className
-               . $this->fileExtension;
+                . $className
+                . $this->fileExtension;
 
         if (file_exists($path)) {
             require $path;
index 3b614beb8213c797f2f4f65b4fe4d68d69c67287..0ecd1dfbae4bbab2e52f8bd6cbd0fb2fe47468bd 100644 (file)
@@ -552,8 +552,8 @@ class CsvController extends AbstractController
         $csv = new CsvIn($this->zdb);
 
         /** FIXME:
-        * - set fields that should not be part of import
-        */
+         * - set fields that should not be part of import
+         */
         $fields = $model->getFields();
         $defaults = $csv->getDefaultFields();
         $defaults_loaded = false;
index 78f7021f8936fcd790939049d2550dbd8771c450..3603405150fe7c7c26af450ed6c3c77b07848833 100644 (file)
@@ -126,9 +126,9 @@ class DynamicTranslationsController extends AbstractController
 
                 $trans = array();
                 /**
-                * FIXME : it would be faster to get all translations at once
-                * for a specific string
-                */
+                 * FIXME : it would be faster to get all translations at once
+                 * for a specific string
+                 */
                 foreach ($this->i18n->getList() as $l) {
                     $text_trans = \getDynamicTranslation($text_orig, $l->getLongID());
                     $lang_name = $l->getName();
index d5e56fd564f0866214bbbc5073084176463ec059..7528a2756d3951041d92d1cb2b507d4d0f413cd3 100644 (file)
@@ -284,7 +284,7 @@ class GaletteController extends AbstractController
                 $warning_detected = array_merge($warning_detected, $this->preferences->checkCardsSizes());
 
                 // picture upload
-                if (GALETTE_MODE !== 'DEMO' &&  isset($_FILES['logo'])) {
+                if (GALETTE_MODE !== 'DEMO' && isset($_FILES['logo'])) {
                     if ($_FILES['logo']['error'] === UPLOAD_ERR_OK) {
                         if ($_FILES['logo']['tmp_name'] != '') {
                             if (is_uploaded_file($_FILES['logo']['tmp_name'])) {
@@ -880,14 +880,12 @@ class GaletteController extends AbstractController
         $filters->filter_account = Members::ACTIVE_ACCOUNT;
 
         $membership = ($args['membership'] === 'nearly' ?
-            Members::MEMBERSHIP_NEARLY :
-            Members::MEMBERSHIP_LATE);
+            Members::MEMBERSHIP_NEARLY : Members::MEMBERSHIP_LATE);
         $filters->membership_filter = $membership;
 
         //TODO: filter on reminder may take care of parent email as well
         $mail = ($args['mail'] === 'withmail' ?
-            Members::FILTER_W_EMAIL :
-            Members::FILTER_WO_EMAIL);
+            Members::FILTER_W_EMAIL : Members::FILTER_WO_EMAIL);
         $filters->email_filter = $mail;
 
         $this->session->filter_members = $filters;
index 96c69965c16ae35ad5be12dab2438a3761c829a2..c33b4ecd02c6f10855d231462f3a9596c812d9fd 100644 (file)
@@ -67,7 +67,7 @@ class Translator extends ZTranslator
     {
         $locale = ($locale ?: $this->getLocale());
 
-        if (! isset($this->messages[$textDomain][$locale])) {
+        if (!isset($this->messages[$textDomain][$locale])) {
             $this->loadMessages($textDomain, $locale);
         }
 
index ba47cf090c3d6c23be2338a2294d6eac3bb5fd80..0d4157682f443e72ca91dfd578eebadb580148d9 100644 (file)
@@ -337,7 +337,7 @@ class Group
             } else {
                 Analog::log(
                     'Unable to delete group ' . $this->group_name .
-                    ' (' . $this->id  . ') |' . $e->getMessage(),
+                    ' (' . $this->id . ') |' . $e->getMessage(),
                     Analog::ERROR
                 );
             }
@@ -772,7 +772,7 @@ class Group
                         Analog::log(
                             'An error occurred trying to attach member `' .
                             $m->sname . '` to group `' . $this->group_name .
-                            '` ('  . $this->id . ').',
+                            '` (' . $this->id . ').',
                             Analog::ERROR
                         );
                         throw new \Exception(
@@ -862,7 +862,7 @@ class Group
                         Analog::log(
                             'An error occurred trying to attach manager `' .
                             $m->sname . '` to group `' . $this->group_name .
-                            '` ('  . $this->id . ').',
+                            '` (' . $this->id . ').',
                             Analog::ERROR
                         );
                         throw new \Exception(
index 230d2f81fe1e3fcee5474187d11e16fe5ef35e54..8f4e9ec6a244d97b7a1b3e615d8fa09b7b39f220 100644 (file)
@@ -207,12 +207,12 @@ trait I18nTrait
     }
 
     /**
-    * Delete a translation stored in the database
-    *
-    * @param string $text_orig Text to translate
-    *
-    * @return boolean
-    */
+     * Delete a translation stored in the database
+     *
+     * @param string $text_orig Text to translate
+     *
+     * @return boolean
+     */
     protected function deleteTranslation($text_orig)
     {
         try {
index be33316f106b90cdd71ed023996a9b845b36c8c0..b2456b1231cb4aacbf857f282702b3c5f0fb19d2 100644 (file)
@@ -131,8 +131,8 @@ abstract class PdfModel
 
         $logo = new Core\Logo();
         $logo_elt = '<img' .
-            ' src="'    . $preferences->getURL() . $router->pathFor('logo')  . '"' .
-            ' width="'  . $logo->getOptimalWidth()  . '"' .
+            ' src="' . $preferences->getURL() . $router->pathFor('logo') . '"' .
+            ' width="' . $logo->getOptimalWidth() . '"' .
             ' height="' . $logo->getOptimalHeight() . '"' .
             '/>';
 
index 4ef8d8081a47b911d41dbf7c091cb03f2f78d24e..c63495eeec4a8458a4d6b0ab3ecebee984926b41 100644 (file)
@@ -69,7 +69,7 @@ class Contributions
 
     private $sum;
 
-   /**
+    /**
      * Default constructor
      *
      * @param Db                $zdb     Database
index 5ac1f7ab8ed86b328a0e49abe6a3798605951820..e82198a8a2c55ec6e0e6ea07b21fea23c278a0e8 100644 (file)
@@ -208,7 +208,7 @@ abstract class Repository
             return true;
         } else {
             Analog::log(
-                'Trying to order by ' . $field_name  . ' while it is not in ' .
+                'Trying to order by ' . $field_name . ' while it is not in ' .
                 'selected fields.',
                 Analog::WARNING
             );
index bf05e93a451d5cabb34dbc96889460776e534a7f..d949dd287953ec4b7d13e22b5344068e471165e7 100644 (file)
@@ -64,7 +64,7 @@ class SavedSearches
 
     private $count = null;
 
-   /**
+    /**
      * Default constructor
      *
      * @param Db                $zdb     Database
index ecd456b8c42d69e9f1ac5a8ff5f64e31f547cfcd..1dd5f5c63187956aa9dff638ef1894a9df9e3e43 100644 (file)
@@ -77,11 +77,11 @@ class Telemetry
         $this->plugins = $plugins;
     }
 
-   /**
-    * Grab telemetry information
-    *
-    * @return array
-    */
+    /**
+     * Grab telemetry information
+     *
+     * @return array
+     */
     public function getTelemetryInfos()
     {
         $data = [
@@ -96,11 +96,11 @@ class Telemetry
         return $data;
     }
 
-   /**
-    * Grab Galette part information
-    *
-    * @return array
-    */
+    /**
+     * Grab Galette part information
+     *
+     * @return array
+     */
     public function grabGaletteInfos()
     {
         $galette = [
@@ -263,7 +263,7 @@ class Telemetry
         return '5000+';
     }
 
-   /**
+    /**
      * Send telemetry information
      *
      * @return boolean
@@ -348,7 +348,7 @@ class Telemetry
         return $this->getUuid('instance');
     }
 
-   /**
+    /**
      * Get registration UUID
      *
      * @return string
@@ -435,15 +435,15 @@ class Telemetry
         return $this->getRegistrationDate() != false;
     }
 
-   /**
-    * Get a random string
-    *
-    * @param integer $length of the random string
-    *
-    * @return string
-    *
-    * @see https://stackoverflow.com/questions/4356289/php-random-string-generator/31107425#31107425
-    */
+    /**
+     * Get a random string
+     *
+     * @param integer $length of the random string
+     *
+     * @return string
+     *
+     * @see https://stackoverflow.com/questions/4356289/php-random-string-generator/31107425#31107425
+     */
     private function getRandomString($length)
     {
         $keyspace = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';