]> git.agnieray.net Git - galette.git/commitdiff
Scrutinizer Auto-Fixes (#59)
authorScrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>
Wed, 10 Jun 2020 21:27:52 +0000 (23:27 +0200)
committerGitHub <noreply@github.com>
Wed, 10 Jun 2020 21:27:52 +0000 (23:27 +0200)
* Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com

* CS from phpcbf

Co-authored-by: Johan Cwiklinski <johan@x-tnd.be>
92 files changed:
galette/config/galette_tcpdf_config.php
galette/includes/dependencies.php
galette/includes/fields_defs/members_fields.php
galette/includes/galette.inc.php
galette/includes/routes/ajax.routes.php
galette/includes/routes/contributions.routes.php
galette/includes/routes/main.routes.php
galette/includes/routes/management.routes.php
galette/includes/routes/plugins.routes.php
galette/includes/routes/public_pages.routes.php
galette/install/scripts/upgrade-to-0.8.php
galette/install/steps/admin.php
galette/install/steps/check.php
galette/install/steps/db.php
galette/install/steps/db_install.php
galette/install/steps/end.php
galette/install/steps/galette.php
galette/install/steps/type.php
galette/lib/Galette/Common/ClassLoader.php
galette/lib/Galette/Common/XHProf.php
galette/lib/Galette/Controllers/Crud/ContributionsController.php
galette/lib/Galette/Controllers/Crud/EntitledsController.php
galette/lib/Galette/Controllers/Crud/MailingsController.php
galette/lib/Galette/Controllers/Crud/MembersController.php
galette/lib/Galette/Controllers/Crud/SavedSearchesController.php
galette/lib/Galette/Controllers/CsvController.php
galette/lib/Galette/Controllers/HistoryController.php
galette/lib/Galette/Controllers/PdfController.php
galette/lib/Galette/Controllers/PluginsController.php
galette/lib/Galette/Core/AbstractPassword.php
galette/lib/Galette/Core/Authentication.php
galette/lib/Galette/Core/CheckModules.php
galette/lib/Galette/Core/Db.php
galette/lib/Galette/Core/Galette.php
galette/lib/Galette/Core/GaletteMail.php
galette/lib/Galette/Core/History.php
galette/lib/Galette/Core/Install.php
galette/lib/Galette/Core/Links.php
galette/lib/Galette/Core/Login.php
galette/lib/Galette/Core/Mailing.php
galette/lib/Galette/Core/MailingHistory.php
galette/lib/Galette/Core/Pagination.php
galette/lib/Galette/Core/PasswordImage.php
galette/lib/Galette/Core/Picture.php
galette/lib/Galette/Core/PluginInstall.php
galette/lib/Galette/Core/Plugins.php
galette/lib/Galette/Core/Preferences.php
galette/lib/Galette/Core/SysInfos.php
galette/lib/Galette/DynamicFields/DynamicField.php
galette/lib/Galette/Entity/Adherent.php
galette/lib/Galette/Entity/Contribution.php
galette/lib/Galette/Entity/DynamicFieldsHandle.php
galette/lib/Galette/Entity/DynamicsTrait.php
galette/lib/Galette/Entity/Entitled.php
galette/lib/Galette/Entity/FieldsConfig.php
galette/lib/Galette/Entity/ImportModel.php
galette/lib/Galette/Entity/Reminder.php
galette/lib/Galette/Entity/SavedSearch.php
galette/lib/Galette/Entity/Texts.php
galette/lib/Galette/Entity/Title.php
galette/lib/Galette/Entity/Transaction.php
galette/lib/Galette/Filters/AdvancedMembersList.php
galette/lib/Galette/Filters/ContributionsList.php
galette/lib/Galette/Filters/HistoryList.php
galette/lib/Galette/Filters/MailingsList.php
galette/lib/Galette/Filters/MembersList.php
galette/lib/Galette/Filters/TransactionsList.php
galette/lib/Galette/Handlers/GaletteError.php
galette/lib/Galette/IO/Csv.php
galette/lib/Galette/IO/CsvIn.php
galette/lib/Galette/IO/CsvOut.php
galette/lib/Galette/IO/ExternalScript.php
galette/lib/Galette/IO/FileTrait.php
galette/lib/Galette/IO/MembersCsv.php
galette/lib/Galette/IO/News.php
galette/lib/Galette/IO/Pdf.php
galette/lib/Galette/IO/PdfAdhesionForm.php
galette/lib/Galette/IO/PdfAttendanceSheet.php
galette/lib/Galette/IO/PdfContribution.php
galette/lib/Galette/IO/PdfMembersCards.php
galette/lib/Galette/IO/PdfMembersLabels.php
galette/lib/Galette/Middleware/MembersNavigate.php
galette/lib/Galette/Repository/Contributions.php
galette/lib/Galette/Repository/DynamicFieldsSet.php
galette/lib/Galette/Repository/Groups.php
galette/lib/Galette/Repository/Members.php
galette/lib/Galette/Repository/PaymentTypes.php
galette/lib/Galette/Repository/SavedSearches.php
galette/lib/Galette/Repository/Transactions.php
galette/lib/Galette/Util/FakeData.php
galette/post_contribution_test.php
galette/webroot/installer.php

index af31ecf33d5f24651bfffc2151dd104143392949..0b048d00e3fbd08450691a7326d21bb27d48b339 100644 (file)
 /**
  * Define the following constant to ignore the default configuration file.
  */
-define ('K_TCPDF_EXTERNAL_CONFIG', true);
+define('K_TCPDF_EXTERNAL_CONFIG', true);
 
 /**
  * Installation path (/var/www/tcpdf/).
  * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
  */
-define ('K_PATH_MAIN', GALETTE_TCPDF_PATH);
+define('K_PATH_MAIN', GALETTE_TCPDF_PATH);
 
 /**
  * URL path to tcpdf installation folder (http://localhost/tcpdf/).
@@ -57,13 +57,13 @@ define ('K_PATH_MAIN', GALETTE_TCPDF_PATH);
  * Path for PDF fonts.
  * By default it is automatically set but you can also set it as a fixed string to improve performances.
  */
-define ('K_PATH_FONTS', GALETTE_TCPDF_PATH.'/fonts/');
+define('K_PATH_FONTS', GALETTE_TCPDF_PATH . '/fonts/');
 
 /**
  * Default images directory.
  * By default it is automatically set but you can also set it as a fixed string to improve performances.
  */
-define ('K_PATH_IMAGES', GALETTE_PHOTOS_PATH);
+define('K_PATH_IMAGES', GALETTE_PHOTOS_PATH);
 
 /**
  * Deafult image logo used be the default Header() method.
@@ -79,107 +79,107 @@ define ('K_PATH_IMAGES', GALETTE_PHOTOS_PATH);
 /**
  * Cache directory for temporary files (full path).
  */
-define ('K_PATH_CACHE', GALETTE_CACHE_DIR);
+define('K_PATH_CACHE', GALETTE_CACHE_DIR);
 
 /**
  * Generic name for a blank image.
  */
-define ('K_BLANK_IMAGE', '_blank.png');
+define('K_BLANK_IMAGE', '_blank.png');
 
 /**
  * Page format.
  */
-define ('PDF_PAGE_FORMAT', 'A4');
+define('PDF_PAGE_FORMAT', 'A4');
 
 /**
  * Page orientation (P=portrait, L=landscape).
  */
-define ('PDF_PAGE_ORIENTATION', 'P');
+define('PDF_PAGE_ORIENTATION', 'P');
 
 /**
  * Document creator.
  */
-define ('PDF_CREATOR', 'TCPDF');
+define('PDF_CREATOR', 'TCPDF');
 
 /**
  * Document author.
  */
-define ('PDF_AUTHOR', 'TCPDF');
+define('PDF_AUTHOR', 'TCPDF');
 
 /**
  * Header title.
  */
-define ('PDF_HEADER_TITLE', 'TCPDF Example');
+define('PDF_HEADER_TITLE', 'TCPDF Example');
 
 /**
  * Header description string.
  */
-define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
+define('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
 
 /**
  * Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
  */
-define ('PDF_UNIT', 'mm');
+define('PDF_UNIT', 'mm');
 
 /**
  * Header margin.
  */
-define ('PDF_MARGIN_HEADER', 5);
+define('PDF_MARGIN_HEADER', 5);
 
 /**
  * Footer margin.
  */
-define ('PDF_MARGIN_FOOTER', 10);
+define('PDF_MARGIN_FOOTER', 10);
 
 /**
  * Top margin.
  */
-define ('PDF_MARGIN_TOP', 27);
+define('PDF_MARGIN_TOP', 27);
 
 /**
  * Bottom margin.
  */
-define ('PDF_MARGIN_BOTTOM', 25);
+define('PDF_MARGIN_BOTTOM', 25);
 
 /**
  * Left margin.
  */
-define ('PDF_MARGIN_LEFT', 15);
+define('PDF_MARGIN_LEFT', 15);
 
 /**
  * Right margin.
  */
-define ('PDF_MARGIN_RIGHT', 15);
+define('PDF_MARGIN_RIGHT', 15);
 
 /**
  * Default main font name.
  */
-define ('PDF_FONT_NAME_MAIN', 'DejaVuSans');
+define('PDF_FONT_NAME_MAIN', 'DejaVuSans');
 
 /**
  * Default main font size.
  */
-define ('PDF_FONT_SIZE_MAIN', 10);
+define('PDF_FONT_SIZE_MAIN', 10);
 
 /**
  * Default data font name.
  */
-define ('PDF_FONT_NAME_DATA', 'DejaVuSans');
+define('PDF_FONT_NAME_DATA', 'DejaVuSans');
 
 /**
  * Default data font size.
  */
-define ('PDF_FONT_SIZE_DATA', 8);
+define('PDF_FONT_SIZE_DATA', 8);
 
 /**
  * Default monospaced font name.
  */
-define ('PDF_FONT_MONOSPACED', 'courier');
+define('PDF_FONT_MONOSPACED', 'courier');
 
 /**
  * Ratio used to adjust the conversion of pixels to user units.
  */
-define ('PDF_IMAGE_SCALE_RATIO', 1.25);
+define('PDF_IMAGE_SCALE_RATIO', 1.25);
 
 /**
  * Magnification factor for titles.
index 696c794eccd981a94c9203e3962cb946f639eefa..cf900547ae5b2f788dc2c3e542187bbc31ad8c32 100644 (file)
@@ -144,7 +144,7 @@ $container['view'] = function ($c) {
     if ($c->get('login')->isAdmin() && $c->get('preferences')->pref_telemetry_date) {
         $now = new \DateTime();
         $sent = new \DateTime($c->get('preferences')->pref_telemetry_date);
-        $sent->add(new \DateInterval('P1Y'));// ask to resend telemetry after one year
+        $sent->add(new \DateInterval('P1Y')); // ask to resend telemetry after one year
         if ($now > $sent && !$_COOKIE['renew_telemetry']) {
             $smarty->assign('renew_telemetry', true);
         }
@@ -231,7 +231,7 @@ $container['acls'] = function ($c) {
     $acls = $acls + $c->get('plugins')->getAcls();
 
     //load user defined ACLs
-    if (file_exists(GALETTE_CONFIG_PATH  . 'local_acls.inc.php')) {
+    if (file_exists(GALETTE_CONFIG_PATH . 'local_acls.inc.php')) {
         //use array_merge here, we want $local_acls to override core ones.
         $acls = array_merge($acls, $local_acls);
     }
@@ -562,7 +562,7 @@ $container['lists_config'] = function ($c) {
 };
 
 $container['cache'] = function ($c) {
-    $adapter  = null;
+    $adapter = null;
     if (function_exists('wincache_ucache_add')) {
         //since APCu is not known to work on windows
         $adapter = 'wincache';
index 96e6bb6428358949cb028d30f74eb88911830b39..e72196cc76f0f4960d25f2a2237004e2829eb101 100644 (file)
@@ -62,7 +62,7 @@ $members_fields = array(
     'nom_adh' => array(
         'label'    => _T("Name:"),
         'propname' => 'name',
-        'required' => true ,
+        'required' => true,
         'visible'  => FieldsConfig::USER_WRITE,
         'position' => 3,
         'category' => FieldsCategories::ADH_CATEGORY_IDENTITY
@@ -78,7 +78,7 @@ $members_fields = array(
     'societe_adh' => array(
         'label'    => _T("Company:"),
         'propname' => 'company_name',
-        'required' => false ,
+        'required' => false,
         'visible'  => FieldsConfig::USER_WRITE,
         'position' => 5,
         'category' => FieldsCategories::ADH_CATEGORY_IDENTITY
index 005fbd4fe285716e79b3d66774652c3e1fb38229..1841ec3e7e004b68434332a9e59b1b7c5e066e29 100644 (file)
@@ -46,7 +46,7 @@ require_once GALETTE_ROOT . 'config/paths.inc.php';
 // check required PHP version...
 if (version_compare(PHP_VERSION, GALETTE_PHP_MIN, '<')) {
     echo 'Galette is NOT compliant with your current PHP version. ' .
-        'Galette requires PHP ' . GALETTE_PHP_MIN  .
+        'Galette requires PHP ' . GALETTE_PHP_MIN .
         ' minimum and current version is ' . phpversion();
     die(1);
 }
@@ -124,7 +124,7 @@ if (!isset($_COOKIE['show_galette_dashboard'])) {
     setcookie(
         'show_galette_dashboard',
         true,
-        time()+31536000 //valid for a year
+        time() + 31536000 //valid for a year
     );
 }
 
@@ -171,7 +171,7 @@ if (defined('GALETTE_TESTS')) {
         if (GALETTE_LOG_LVL >= Analog::INFO) {
             $now = new \DateTime();
             $dbg_log_path = GALETTE_LOGS_PATH . 'galette_debug_' .
-                $now->format('Y-m-d')  . '.log';
+                $now->format('Y-m-d') . '.log';
             $galette_debug_log = LevelName::init(Handler\File::init($dbg_log_path));
         } else {
             $galette_debug_log = Handler\Ignore::init();
@@ -202,7 +202,7 @@ if (defined('GALETTE_TESTS')) {
 
 Analog::handler(
     Handler\Multi::init(
-        array (
+        array(
             Analog::NOTICE  => Handler\Threshold::init(
                 $galette_run_log,
                 GALETTE_LOG_LVL
index b54b64c06cd3511b12d3257469cb284f93a4d5f3..a0fb5da60d3f9fa1d7858b7229ecc91c25f1dd59 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,21 +193,21 @@ $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,
                 $this->plugins
             );
             $body = $response->getBody();
-            $body->write('<pre>' . json_encode($telemetry->getTelemetryInfos(), JSON_PRETTY_PRINT)  . '</pre>');
+            $body->write('<pre>' . json_encode($telemetry->getTelemetryInfos(), JSON_PRETTY_PRINT) . '</pre>');
             return $response;
         }
     )->setName('telemetryInfos')->add($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 3ff8bb9c3d33896ec4bf726595b1eb9b9d1a6c5c..e619441f4beb379597e858884e9415d7d0db2e92 100644 (file)
@@ -104,7 +104,7 @@ $app->post(
 )->setName('doEditTransaction')->add($authenticate);
 
 $app->get(
-    '/{type:contributions|transactions}/remove' .'/{id:\d+}',
+    '/{type:contributions|transactions}/remove' . '/{id:\d+}',
     Crud\ContributionsController::class . ':confirmDelete'
 )->setName('removeContribution')->add($authenticate);
 
index 24fca476ef74784d570fef22c83987669b48c49a..3a03b51c1139420df9819531609fbe770d58531e 100644 (file)
@@ -65,7 +65,7 @@ $app->get(
 //system information - keep old route with typo ('s' on 'information') for now (0.9.4)
 $app->get(
     '/system-informations',
-    function ($request, $response, $args) {
+    function($request, $response, $args) {
         return $response
             ->withStatus(302)
             ->withHeader('Location', $this->router->pathFor('sysinfos'));
index f82bbffb9240df723afcb6b98b014680a5c4ba59..56282f7fde213ab13918607fa6ea4acb48d2d92b 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 0860ad8c234aa3d438544fb0c37614a28fddcba8..e2a0cdc0f0d1d12a2a4b04c22b46ed43a6aaa905 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 3a015d53f084e9928e50d3e6fdaba012a888b1fb..786e1c5b8ee199d1775d56ea2d71f93475bd9cd9 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 8e2b4d32efa5fe0335686e16b9f735296b9955e4..1900e6babb6239cf86594760eea24d2d2ad4a14e 100644 (file)
@@ -84,9 +84,9 @@ class UpgradeTo08 extends AbstractUpdater
             'files'
         );
 
-        if ( !file_exists(GALETTE_ROOT . 'data') ) {
+        if (!file_exists(GALETTE_ROOT . 'data')) {
             $created = @mkdir(GALETTE_ROOT . 'data');
-            if ( !$created ) {
+            if (!$created) {
                 $this->addError(
                     str_replace(
                         '%path',
@@ -98,11 +98,11 @@ class UpgradeTo08 extends AbstractUpdater
             }
         }
 
-        foreach ( $dirs as $dir ) {
+        foreach ($dirs as $dir) {
             $path = GALETTE_ROOT . 'data/' . $dir;
-            if ( !file_exists($path) ) {
+            if (!file_exists($path)) {
                 $created = @mkdir($path);
-                if ( !$created ) {
+                if (!$created) {
                     $this->addError(
                         str_replace(
                             '%dir',
@@ -141,38 +141,38 @@ class UpgradeTo08 extends AbstractUpdater
             $go = false;
             //move directory contents
             switch ( $dirname ) {
-            case 'logs':
-                if ( GALETTE_LOGS_PATH === $destdir && file_exists($origdir) ) {
-                    $go = true;
-                }
-                break;
-            case 'exports':
-                if ( GALETTE_EXPORTS_PATH === $destdir && file_exists($origdir) ) {
-                    $go = true;
-                }
-                break;
-            case 'imports':
-                if ( GALETTE_IMPORTS_PATH === $destdir && file_exists($origdir) ) {
-                    $go = true;
-                }
-                break;
-            case 'photos':
-                if ( GALETTE_PHOTOS_PATH === $destdir && file_exists($origdir) ) {
-                    $go = true;
-                }
-                break;
-            case 'attachments':
-                if ( GALETTE_ATTACHMENTS_PATH === $destdir
-                    && file_exists($origdir)
-                ) {
-                    $go = true;
-                }
-                break;
-            case 'files':
-                if ( GALETTE_FILES_PATH === $destdir && file_exists($origdir) ) {
-                    $go = true;
-                }
-                break;
+                case 'logs':
+                    if ( GALETTE_LOGS_PATH === $destdir && file_exists($origdir) ) {
+                        $go = true;
+                    }
+                    break;
+                case 'exports':
+                    if ( GALETTE_EXPORTS_PATH === $destdir && file_exists($origdir) ) {
+                        $go = true;
+                    }
+                    break;
+                case 'imports':
+                    if ( GALETTE_IMPORTS_PATH === $destdir && file_exists($origdir) ) {
+                        $go = true;
+                    }
+                    break;
+                case 'photos':
+                    if ( GALETTE_PHOTOS_PATH === $destdir && file_exists($origdir) ) {
+                        $go = true;
+                    }
+                    break;
+                case 'attachments':
+                    if ( GALETTE_ATTACHMENTS_PATH === $destdir
+                        && file_exists($origdir)
+                    ) {
+                        $go = true;
+                    }
+                    break;
+                case 'files':
+                    if ( GALETTE_FILES_PATH === $destdir && file_exists($origdir) ) {
+                        $go = true;
+                    }
+                    break;
             }
 
             if ( $go ) {
@@ -195,7 +195,7 @@ class UpgradeTo08 extends AbstractUpdater
                 }
                 $d->close();
 
-                if ( $moved ) {
+                if ($moved) {
                     $this->addReportEntry(
                         str_replace(
                             '%dir',
index 7a12299e7b3a2cfbfe57ad65e2a8ab2ee172fbea..473e3630b80ab4fa7776a736ecbfc9740a2b814e 100644 (file)
@@ -44,7 +44,7 @@ use Galette\Core\Db as GaletteDb;
                         <legend class="ui-state-active ui-corner-top"><?php echo _T("Please chose the parameters of the admin account on Galette"); ?></legend>
                         <p>
                             <label for="install_adminlogin" class="bline"><?php echo _T("Username:"); ?></label>
-                            <input type="text" name="install_adminlogin" id="install_adminlogin" value="<?php if(isset($_POST['install_adminlogin'])) echo $_POST['install_adminlogin']; ?>" required autofocus/>
+                            <input type="text" name="install_adminlogin" id="install_adminlogin" value="<?php if (isset($_POST['install_adminlogin'])) echo $_POST['install_adminlogin']; ?>" required autofocus/>
                         </p>
                         <p>
                             <label for="install_adminpass" class="bline"><?php echo _T("Password:"); ?></label>
index 590723ce09205334473aeb65648d00235198d3ba..63a52de83a85b7b2dec6d1b697aeb1b4697d8524 100644 (file)
@@ -43,17 +43,17 @@ $php_modules_class = '';
 $files_perms_class = '';
 
 // check required PHP version...
-if ( version_compare(PHP_VERSION, GALETTE_PHP_MIN, '<') ) {
+if (version_compare(PHP_VERSION, GALETTE_PHP_MIN, '<')) {
     $php_ok = false;
 }
 
 // check date settings
 $date_ok = false;
-if ( !version_compare(PHP_VERSION, '5.2.0', '<') ) {
+if (!version_compare(PHP_VERSION, '5.2.0', '<')) {
     try {
         $test_date = new DateTime();
         $date_ok = true;
-    } catch ( Exception $e ) {
+    } catch (Exception $e) {
         //do nothing
     }
 }
@@ -64,7 +64,7 @@ $modules_ok = $cm->isValid();
 
 // check file permissions
 $perms_ok = true;
-$files_need_rw = array (
+$files_need_rw = array(
     _T("Compilation")       => GALETTE_COMPILE_DIR,
     _T("Photos")            => GALETTE_PHOTOS_PATH,
     _T("Cache")             => GALETTE_CACHE_DIR,
@@ -81,16 +81,16 @@ $files_perms_class = $class . 'ok';
 
 foreach ($files_need_rw as $label=>$file) {
     $writable = is_writable($file);
-    if ( !$writable ) {
+    if (!$writable) {
         $perms_ok = false;
     }
 }
 
-if ( $perms_ok && $modules_ok && $php_ok && $date_ok ) {
+if ($perms_ok && $modules_ok && $php_ok && $date_ok) {
     echo '<p id="infobox">' . _T("Galette requirements are met :)") . '</p>';
 }
 
-if ( !$date_ok ) {
+if (!$date_ok) {
     echo '<p class="error">' . _T("Your PHP date settings are not correct. Maybe you've missed the timezone settings that is mandatory since PHP 5.3?") . '</p>';
 }
 ?>
@@ -107,8 +107,8 @@ if ( !$date_ok ) {
 
                 <h3><?php echo _T("PHP Modules"); ?></h3>
 <?php
-if ( !$modules_ok ) {
-    echo '<p class="error">' . _T("Some PHP modules are missing. Please install them or contact your support.<br/>More information on required modules may be found in the documentation.")  . '</p>';
+if (!$modules_ok) {
+    echo '<p class="error">' . _T("Some PHP modules are missing. Please install them or contact your support.<br/>More information on required modules may be found in the documentation.") . '</p>';
 }
 ?>
                 <ul class="leaders">
@@ -130,15 +130,15 @@ foreach ($files_need_rw as $label=>$file) {
 ?>
                 </ul>
 <?php
-if ( !$perms_ok ) {
+if (!$perms_ok) {
     ?>
         <article id="files_perms" class="<?php echo $files_perms_class; ?>">
             <div>
         <h4 class="error"><?php echo _T("Files permissions are not OK!"); ?></h4>
         <p><?php
-    if ( $install->isInstall() ) {
+    if ($install->isInstall()) {
         echo _T("To work as excpected, Galette needs write permission on files listed above.");
-    } else if ( $install->isUpgrade() ) {
+    } else if ($install->isUpgrade()) {
         echo _T("In order to be updated, Galette needs write permission on files listed above.");
     }
         ?></p>
@@ -151,7 +151,7 @@ if ( !$perms_ok ) {
     <?php
 }
 
-if ( !$perms_ok || !$modules_ok || !$php_ok || !$date_ok ) {
+if (!$perms_ok || !$modules_ok || !$php_ok || !$date_ok) {
     ?>
                 <form action="installer.php" method="post">
                     <p id="btn_box">
index 9d730f9e9b2c887572acfd177aaac622c5328090..a938cb99d10b647a0fa89fb21560e789327eba15 100644 (file)
@@ -68,18 +68,18 @@ if (!isset($_POST['install_dbtype']) || $_POST['install_dbtype'] == 'mysql') {
                     <p>
                         <label class="bline" for="install_dbtype"><?php echo _T("Database type:"); ?></label>
                         <select name="install_dbtype" id="install_dbtype">
-                            <option value="mysql"<?php if ( $install->getDbType() === GaletteDb::MYSQL ) {echo ' selected="selected"';} ?>>Mysql</option>
-                            <option value="pgsql"<?php if ( $install->getDbType() === GaletteDb::PGSQL ) {echo ' selected="selected"';} ?>>Postgresql</option>
+                            <option value="mysql"<?php if ($install->getDbType() === GaletteDb::MYSQL) {echo ' selected="selected"'; } ?>>Mysql</option>
+                            <option value="pgsql"<?php if ($install->getDbType() === GaletteDb::PGSQL) {echo ' selected="selected"'; } ?>>Postgresql</option>
                         </select>
                     </p>
                     <div id="install_dbconfig">
                         <p>
                             <label class="bline" for="install_dbhost"><?php echo _T("Host:"); ?></label>
-                            <input type="text" name="install_dbhost" id="install_dbhost" value="<?php echo ($install->getDbHost() !== null)?$install->getDbHost():'localhost'; ?>" required/>
+                            <input type="text" name="install_dbhost" id="install_dbhost" value="<?php echo ($install->getDbHost() !== null) ? $install->getDbHost() : 'localhost'; ?>" required/>
                         </p>
                         <p>
                             <label class="bline" for="install_dbport"><?php echo _T("Port:"); ?></label>
-                            <input type="text" name="install_dbport" id="install_dbport" value="<?php echo ($install->getDbPort() !== null)?$install->getDbPort():$default_dbport; ?>" required/>
+                            <input type="text" name="install_dbport" id="install_dbport" value="<?php echo ($install->getDbPort() !== null) ? $install->getDbPort() : $default_dbport; ?>" required/>
                         </p>
                         <p>
                             <label class="bline" for="install_dbuser"><?php echo _T("User:"); ?></label>
@@ -95,7 +95,7 @@ if (!isset($_POST['install_dbtype']) || $_POST['install_dbtype'] == 'mysql') {
                         </p>
                         <p>
                             <label class="bline" for="install_dbprefix"><?php echo _T("Table prefix:"); ?></label>
-                            <input type="text" name="install_dbprefix" id="install_dbprefix" value="<?php echo ($install->getTablesPrefix() !== null)?$install->getTablesPrefix():'galette_'; ?>" required/>
+                            <input type="text" name="install_dbprefix" id="install_dbprefix" value="<?php echo ($install->getTablesPrefix() !== null) ? $install->getTablesPrefix() : 'galette_'; ?>" required/>
                         </p>
 <?php
 if ($install->isUpgrade()) {
index b5c96693dbc51642a5fbd4be54c0bce20c20cea9..35d136a8ade1092630277c9266f35ba55531bc31 100644 (file)
@@ -43,15 +43,15 @@ $db_installed = $install->executeScripts($zdb);
 ?>
                 <h2><?php echo $install->getStepTitle(); ?></h2>
 <?php
-if ( $db_installed === false ) {
+if ($db_installed === false) {
     $msg = _T("Database has not been installed!");
-    if ( $install->isUpgrade() ) {
+    if ($install->isUpgrade()) {
         $msg = _T("Database has not been upgraded!");
     }
     echo '<p id="errorbox">' . $msg . '</p>';
 } else {
     $msg = _T("Database has been installed :)");
-    if ( $install->isUpgrade() ) {
+    if ($install->isUpgrade()) {
         $msg = _T("Database has been upgraded :)");
     }
     echo '<p id="infobox">' . $msg . '</p>';
@@ -59,7 +59,7 @@ if ( $db_installed === false ) {
 ?>
                 <ul class="leaders">
 <?php
-foreach ( $install->getDbInstallReport() as $r  ) {
+foreach ($install->getDbInstallReport() as $r) {
     ?>
                     <li>
                         <span><?php echo $r['message']; ?></span>
@@ -73,22 +73,22 @@ foreach ( $install->getDbInstallReport() as $r  ) {
                 <form action="installer.php" method="POST">
                     <p id="btn_box">
 <?php
-if ( !$db_installed ) {
+if (!$db_installed) {
     ?>
                         <input type="submit" id="retry_btn" value="<?php echo _T("Retry"); ?>"/>
     <?php
 }
 ?>
 
-                        <input id="next_btn" type="submit" value="<?php echo _T("Next step"); ?>"<?php if ( !$db_installed ) { echo ' disabled="disabled"'; } ?>/>
+                        <input id="next_btn" type="submit" value="<?php echo _T("Next step"); ?>"<?php if (!$db_installed) { echo ' disabled="disabled"'; } ?>/>
 <?php
-if ( $db_installed ) {
+if ($db_installed) {
     ?>
                         <input type="hidden" name="install_dbwrite_ok" value="1"/>
     <?php
 }
 
-if ( !$db_installed ) {
+if (!$db_installed) {
     //once DB is installed, that does not make sense to go back
     ?>
                         <input type="submit" id="btnback" name="stepback_btn" value="<?php echo _T("Back"); ?>"/>
index ecdc827972a7db6318c3d3994a602967a5190678..65d5b8603faa8527e20429bf4a7b5807792cd521 100644 (file)
@@ -42,10 +42,10 @@ unset($session[md5(GALETTE_ROOT)]);
 ?>
                 <h2><?php echo $install->getStepTitle(); ?></h2>
                 <p><?php
-if ( $install->isInstall() ) {
+if ($install->isInstall()) {
     echo _T("Galette has been successfully installed!");
 }
-if ( $install->isUpgrade() ) {
+if ($install->isUpgrade()) {
     echo _T("Galette has been successfully updated!");
 }
 ?></p>
index 6fe8bd83d0e8ccac5fa32b632546abfc2c271258..a288f95e2645480227128a6627639f7f0152e15b 100644 (file)
@@ -50,7 +50,7 @@ $objects_ok = $install->initObjects($i18n, $zdb, new Login($zdb, $i18n, new RKA\
                 <h2><?php echo $install->getStepTitle(); ?></h2>
 <?php
 
-if ( $config_file_ok === true && $objects_ok === true ) {
+if ($config_file_ok === true && $objects_ok === true) {
     echo '<p id="infobox">' . _T("Configuration file created!") .
         '<br/>' . _T("Data initialized.") . '</p>';
 } else {
@@ -59,7 +59,7 @@ if ( $config_file_ok === true && $objects_ok === true ) {
 ?>
                 <ul class="leaders">
 <?php
-foreach ( $install->getInitializationReport() as $r ) {
+foreach ($install->getInitializationReport() as $r) {
     ?>
                     <li>
                         <span><?php echo $r['message']; ?></span>
@@ -72,22 +72,22 @@ foreach ( $install->getInitializationReport() as $r ) {
                 <form action="installer.php" method="POST">
                     <p id="btn_box">
 <?php
-if ( !$config_file_ok || !$objects_ok ) {
+if (!$config_file_ok || !$objects_ok) {
     ?>
                         <input type="submit" id="retry_btn" value="<?php echo _T("Retry"); ?>"/>
     <?php
 }
 ?>
 
-                        <input id="next_btn" type="submit" value="<?php echo _T("Next step"); ?>"<?php if ( !$config_file_ok || !$objects_ok ) { echo ' disabled="disabled"'; } ?>/>
+                        <input id="next_btn" type="submit" value="<?php echo _T("Next step"); ?>"<?php if (!$config_file_ok || !$objects_ok) { echo ' disabled="disabled"'; } ?>/>
 <?php
-if ( $config_file_ok && $objects_ok ) {
+if ($config_file_ok && $objects_ok) {
     ?>
                         <input type="hidden" name="install_prefs_ok" value="1"/>
     <?php
 }
 
-if ( !$config_file_ok || !$objects_ok ) {
+if (!$config_file_ok || !$objects_ok) {
     //once DB is installed, that does not make sense to go back
     ?>
                         <input type="submit" id="btnback" name="stepback_btn" value="<?php echo _T("Back"); ?>"/>
index 2ee7daad3afb05e2c219473dd98cf237713bdc59..f0dfee4fb7d2114b05bac84d7bd22ed11fbec360 100644 (file)
@@ -42,7 +42,7 @@ use Galette\Core\Install as GaletteInstall;
                     <div id="installation_mode">
                         <article id="mode_new" class="installation_mode">
                             <h3>
-                                <input type="radio" name="install_type" value="<?php echo GaletteInstall::INSTALL; ?>"<?php if ( $install->isInstall() || !$install->isUpgrade() ) { echo ' checked="checked"'; } ?> id="install"/>
+                                <input type="radio" name="install_type" value="<?php echo GaletteInstall::INSTALL; ?>"<?php if ($install->isInstall() || !$install->isUpgrade()) { echo ' checked="checked"'; } ?> id="install"/>
                                 <label for="install"><?php echo _T("New installation"); ?></label>
                             </h3>
                             <ul>
@@ -52,7 +52,7 @@ use Galette\Core\Install as GaletteInstall;
                         </article>
                         <article id="mode_update" class="installation_mode">
                             <h3>
-                                <input type="radio" name="install_type" value="<?php echo GaletteInstall::UPDATE; ?>"<?php if ( $install->isUpgrade() ) { echo ' checked="checked"'; } ?> id="update"/>
+                                <input type="radio" name="install_type" value="<?php echo GaletteInstall::UPDATE; ?>"<?php if ($install->isUpgrade()) { echo ' checked="checked"'; } ?> id="update"/>
                                 <label for="update"><?php echo _T("Update"); ?></label>
                             </h3>
                             <ul>
index 4f9368c080a36ec9422e8e8ee3ea2405b04eef1e..598ea9509bcf0533de23892fd8b9f475942a1f66 100644 (file)
@@ -79,7 +79,7 @@ class ClassLoader
     public function __construct($ns = null, $includePath = null)
     {
         if (!file_exists($includePath)) {
-            throw new \RuntimeException('Include path "'.$includePath.'" doesn\'t exists');
+            throw new \RuntimeException('Include path "' . $includePath . '" doesn\'t exists');
         }
 
         $this->namespace = $ns;
@@ -181,7 +181,7 @@ class ClassLoader
      */
     public function loadClass($className)
     {
-        if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
+        if ($this->namespace !== null && strpos($className, $this->namespace . $this->namespaceSeparator) !== 0) {
             return false;
         }
 
@@ -214,7 +214,7 @@ class ClassLoader
      */
     public function canLoadClass($className)
     {
-        if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
+        if ($this->namespace !== null && strpos($className, $this->namespace . $this->namespaceSeparator) !== 0) {
             return false;
         }
 
index 1581f2fa9cd81b3bec27236ba70abcaf48af984c..21189b1f2646daed59337f3c43507e64a8620aef 100644 (file)
@@ -135,15 +135,15 @@ class XHProf
             $data = xhprof_disable();
 
             $incl = (defined('XHPROF_PATH') ? XHPROF_PATH : self::XHPROF_PATH);
-            include_once $incl.'/utils/xhprof_lib.php';
-            include_once $incl.'/utils/xhprof_runs.php';
+            include_once $incl . '/utils/xhprof_lib.php';
+            include_once $incl . '/utils/xhprof_runs.php';
 
             $runs = new \XHProfRuns_Default();
             $id   = $runs->save_run($data, 'galette-' . GALETTE_VERSION);
 
             $url  = (defined('XHPROF_URL') ? XHPROF_URL : self::XHPROF_URL);
             $host = (defined('XHPROF_HOST') ? XHPROF_HOST : $_SERVER['HTTP_HOST']);
-            $link = 'http://' . $host .$url . '/index.php?run=' .
+            $link = 'http://' . $host . $url . '/index.php?run=' .
                 $id . '&source=galette-' . GALETTE_VERSION;
             Analog::log(
                 'Stop profiling with XHProf, result URL: ' . $link,
index 9acaddb944421b8426ade27dba1c46eb92e6dbc9..910d5d3ac2e711657c3bd02a6120f56568d37615 100644 (file)
@@ -343,8 +343,7 @@ class ContributionsController extends CrudController
 
         $tpl_vars = [
             'page_title'        => $raw_type === 'contributions' ?
-                                    _T("Contributions management") :
-                                    _T("Transactions management"),
+                                    _T("Contributions management") : _T("Transactions management"),
             'contribs'          => $contrib,
             'list'              => $contribs_list,
             'nb'                => $contrib->getCount(),
@@ -694,7 +693,7 @@ class ContributionsController extends CrudController
                             //member card link is present in mail model, let's add it
                             $links = new Links($this->zdb);
                             if ($hash = $links->generateNewLink(Links::TARGET_MEMBERCARD, $contrib->member)) {
-                                $link_card =  $this->preferences->getURL() .
+                                $link_card = $this->preferences->getURL() .
                                     $this->router->pathFor('directlink', ['hash' => $hash]);
                             }
                         }
@@ -705,7 +704,7 @@ class ContributionsController extends CrudController
                             $links = new Links($this->zdb);
                             $ltype = $contrib->type->isExtension() ? Links::TARGET_INVOICE : Links::TARGET_RECEIPT;
                             if ($hash = $links->generateNewLink($ltype, $contrib->id)) {
-                                $link_pdf =  $this->preferences->getURL() .
+                                $link_pdf = $this->preferences->getURL() .
                                     $this->router->pathFor('directlink', ['hash' => $hash]);
                             }
                         }
index e475784195e9dffca6d516b80913e00a5fec60b6..0dda12622a951360b18614a50dd2545928425959 100644 (file)
@@ -260,13 +260,11 @@ class EntitledsController extends CrudController
         if ($ret !== true) {
             $msg_type = 'error_detected';
             $msg = $args['action'] === 'add' ?
-                _T("%type has not been added :(") :
-                _T("%type #%id has not been updated");
+                _T("%type has not been added :(") : _T("%type #%id has not been updated");
         } else {
             $msg_type = 'success_detected';
             $msg = $args['action'] === 'add' ?
-                _T("%type has been successfully added!") :
-                _T("%type #%id has been successfully updated!");
+                _T("%type has been successfully added!") : _T("%type #%id has been successfully updated!");
         }
 
         $this->flash->addMessage(
index 0764a1c4dd5b91daa3bc191209f298169088dcb0..a2ae6962e5f691e0baef6626e2a67186add1f8bb 100644 (file)
@@ -111,7 +111,7 @@ class MailingsController extends CrudController
             if (isset($this->session->filter_mailing)) {
                 $filters = $this->session->filter_mailing;
             } elseif (isset($this->session->filter_members)) {
-                $filters =  $this->session->filter_members;
+                $filters = $this->session->filter_members;
             } else {
                 $filters = new MembersList();
             }
@@ -152,8 +152,7 @@ class MailingsController extends CrudController
                     }
 
                     $redirect_url = ($this->session->redirect_mailing !== null) ?
-                        $this->session->redirect_mailing :
-                        $this->router->pathFor('members');
+                        $this->session->redirect_mailing : $this->router->pathFor('members');
 
                     return $response
                         ->withStatus(301)
@@ -225,8 +224,7 @@ class MailingsController extends CrudController
 
         $goto = $this->router->pathFor('mailings');
         $redirect_url = ($this->session->redirect_mailing !== null) ?
-            $this->session->redirect_mailing :
-            $this->router->pathFor('members');
+            $this->session->redirect_mailing : $this->router->pathFor('members');
 
         //We're done :-)
         if (isset($post['mailing_done'])
@@ -261,7 +259,7 @@ class MailingsController extends CrudController
             $goto = $this->router->pathFor('slash');
         } else {
             if (isset($this->session->filter_members)) {
-                $filters =  $this->session->filter_members;
+                $filters = $this->session->filter_members;
             } else {
                 $filters = new MembersList();
             }
@@ -765,7 +763,7 @@ class MailingsController extends CrudController
         MailingHistory::loadFrom($this->zdb, (int)$args['id'], $mailing, false);
         $attachments = $mailing->attachments;
         $attachment = $attachments[$args['pos']];
-        $filepath = $attachment->getDestDir() .  $attachment->getFileName();
+        $filepath = $attachment->getDestDir() . $attachment->getFileName();
 
         $ext = pathinfo($attachment->getFileName())['extension'];
         $response = $response->withHeader('Content-type', $attachment->getMimeType($filepath));
index 02f2d3a7af808324aa1d4f0fbba509e859310a86..8ae1bba2a8dde6599554c5dbb4a26f5c9c1ee472 100644 (file)
@@ -483,7 +483,7 @@ class MembersController extends CrudController
         } else {
             Analog::log(
                 'A request has been made to get an exported file named `' .
-                $filename .'` that does not exists.',
+                $filename . '` that does not exists.',
                 Analog::WARNING
             );
 
@@ -774,7 +774,7 @@ class MembersController extends CrudController
         if ($pos = array_search(Status::PK, array_keys($fields))) {
             $fields = array_slice($fields, 0, $pos, true) +
                 ['status_label'  => ['label' => _T('Status label')]] +
-                array_slice($fields, $pos, count($fields) -1, true);
+                array_slice($fields, $pos, count($fields) - 1, true);
         }
 
         //dynamic fields
@@ -1223,7 +1223,7 @@ class MembersController extends CrudController
      */
     public function massChange(Request $request, Response $response, array $args = []) :Response
     {
-        $filters =  $this->session->filter_members;
+        $filters = $this->session->filter_members;
 
         $data = [
             'id'            => $filters->selected,
@@ -1307,7 +1307,7 @@ class MembersController extends CrudController
             }
         }
 
-        $filters =  $this->session->filter_members;
+        $filters = $this->session->filter_members;
         $data = [
             'id'            => $filters->selected,
             'redirect_uri'  => $this->router->pathFor('members')
@@ -1750,8 +1750,7 @@ class MembersController extends CrudController
                                         '%s',
                                         $member->sname . ' (' . $member->getEmail() . ')',
                                         ($new) ?
-                                        _T("New account email sent to '%s'.") :
-                                        _T("Account modification email sent to '%s'.")
+                                        _T("New account email sent to '%s'.") : _T("Account modification email sent to '%s'.")
                                     );
                                     $this->history->add($msg);
                                     $success_detected[] = $msg;
@@ -1880,7 +1879,7 @@ class MembersController extends CrudController
                 if (isset($post['del_photo'])) {
                     if (!$member->picture->delete($member->id)) {
                         $error_detected[] = _T("Delete failed");
-                        $str_adh = $member->id . ' (' . $member->sname  . ' ' . ')';
+                        $str_adh = $member->id . ' (' . $member->sname . ' ' . ')';
                         Analog::log(
                             'Unable to delete picture for member ' . $str_adh,
                             Analog::ERROR
@@ -2032,7 +2031,7 @@ class MembersController extends CrudController
         if (isset($args['id'])) {
             return $args['id'];
         } else {
-            $filters =  $this->session->filter_members;
+            $filters = $this->session->filter_members;
             return $filters->selected;
         }
     }
@@ -2055,7 +2054,7 @@ class MembersController extends CrudController
             );
         } else {
             //batch members removal
-            $filters =  $this->session->filter_members;
+            $filters = $this->session->filter_members;
             return str_replace(
                 '%count',
                 count($filters->selected),
@@ -2075,7 +2074,7 @@ class MembersController extends CrudController
     protected function doDelete(array $args, array $post)
     {
         if (isset($this->session->filter_members)) {
-            $filters =  $this->session->filter_members;
+            $filters = $this->session->filter_members;
         } else {
             $filters = new MembersList();
         }
index 5c56fe806bcd959605448681661f224fa06718d8..7822fc0d2892feca1ae6d5bc7b39f4cb214a2227 100644 (file)
@@ -307,7 +307,7 @@ class SavedSearchesController extends CrudController
             return _T('Remove saved search');
         } else {
             //batch saved search removal
-            $filters =  $this->session->filter_savedsearch;
+            $filters = $this->session->filter_savedsearch;
             return str_replace(
                 '%count',
                 count($filters->selected),
@@ -327,7 +327,7 @@ class SavedSearchesController extends CrudController
     protected function doDelete(array $args, array $post)
     {
         if (isset($this->session->filter_savedsearch)) {
-            $filters =  $this->session->filter_savedsearch;
+            $filters = $this->session->filter_savedsearch;
         } else {
             $filters = new SavedSearchesList();
         }
index 31daeb1ec22cabfa9da3528764f4189dd58036e9..dcb08ff904ea0bd5a3fc86799cebb1c169537ae9 100644 (file)
@@ -92,7 +92,7 @@ class CsvController extends AbstractController
         } else {
             Analog::log(
                 'A request has been made to get a CSV file named `' .
-                $filename .'` that does not exists (' . $filepath . ').',
+                $filename . '` that does not exists (' . $filepath . ').',
                 Analog::WARNING
             );
             $notFound = $this->notFoundHandler;
@@ -347,7 +347,7 @@ class CsvController extends AbstractController
         $csv = new CsvIn($this->zdb);
         if (isset($_FILES['new_file'])) {
             if ($_FILES['new_file']['error'] === UPLOAD_ERR_OK) {
-                if ($_FILES['new_file']['tmp_name'] !='') {
+                if ($_FILES['new_file']['tmp_name'] != '') {
                     if (is_uploaded_file($_FILES['new_file']['tmp_name'])) {
                         $res = $csv->store($_FILES['new_file']);
                         if ($res < 0) {
@@ -409,8 +409,7 @@ class CsvController extends AbstractController
         //admins or staff members
         if ($this->login->isAdmin() || $this->login->isStaff()) {
             $filepath = $args['type'] === 'export' ?
-                CsvOut::DEFAULT_DIRECTORY :
-                CsvIn::DEFAULT_DIRECTORY;
+                CsvOut::DEFAULT_DIRECTORY : CsvIn::DEFAULT_DIRECTORY;
             $filepath .= $filename;
             return $this->sendResponse($response, $filepath, $filename);
         } else {
@@ -484,8 +483,7 @@ class CsvController extends AbstractController
         $success = false;
 
         $uri = isset($post['redirect_uri']) ?
-            $post['redirect_uri'] :
-            $this->router->pathFor('slash');
+            $post['redirect_uri'] : $this->router->pathFor('slash');
 
         if (!isset($post['confirm'])) {
             $this->flash->addMessage(
@@ -494,8 +492,7 @@ class CsvController extends AbstractController
             );
         } else {
             $csv = $args['type'] === 'export' ?
-                new CsvOut() :
-                new CsvIn($this->zdb);
+                new CsvOut() : new CsvIn($this->zdb);
             $res = $csv->remove($args['file']);
             if ($res === true) {
                 $success = true;
index cd8f314f112cb4769964df7b671418bc9d08bb32..e3731d82534a9cace17dc1a7ea01f7bd1846a3c6 100644 (file)
@@ -203,8 +203,7 @@ class HistoryController extends AbstractController
         $success = false;
 
         $uri = isset($post['redirect_uri']) ?
-            $post['redirect_uri'] :
-            $this->router->pathFor('slash');
+            $post['redirect_uri'] : $this->router->pathFor('slash');
 
         if (!isset($post['confirm'])) {
             $this->flash->addMessage(
index e232f3af86055728a7adcf381b40350bb71a709b..fa464b1c4d792dc93d90da022b1c6a807bc7fb47 100644 (file)
@@ -99,7 +99,7 @@ class PdfController extends AbstractController
     public function membersCards(Request $request, Response $response, array $args = []) :Response
     {
         if ($this->session->filter_members) {
-            $filters =  $this->session->filter_members;
+            $filters = $this->session->filter_members;
         } else {
             $filters = new MembersList();
         }
@@ -333,7 +333,7 @@ class PdfController extends AbstractController
             $ajax = true;
 
             //retrieve selected members
-            $selection = (isset($post['selection']) ) ? $post['selection'] : array();
+            $selection = (isset($post['selection'])) ? $post['selection'] : array();
 
             $filters->selected = $selection;
             $this->session->filter_members = $filters;
@@ -373,7 +373,7 @@ class PdfController extends AbstractController
         }
 
         //retrieve selected members
-        $selection = (isset($post['selection']) ) ? $post['selection'] : array();
+        $selection = (isset($post['selection'])) ? $post['selection'] : array();
 
         $filters->selected = $selection;
         $this->session->filter_members = $filters;
index eed20478564ba6e60ba20591aec7eba802912d89..e34cb197fd54b8119d16244248e7b04175e11771 100644 (file)
@@ -330,11 +330,11 @@ class PluginsController extends AbstractController
                                 && (strcasecmp(trim($w1), 'rename') != 0)
                             ) {
                                 $error_detected[] = $w1 . ' ' . $w2 . ' ' . $w3 . ' ' . $extra;
-                                $error_detected[] = $e->getMessage() . '<br/>(' . $query  . ')';
+                                $error_detected[] = $e->getMessage() . '<br/>(' . $query . ')';
                             } else {
                                 //if error are on drop, DROP, rename or RENAME we can continue
                                 $warning_detected[] = $w1 . ' ' . $w2 . ' ' . $w3 . ' ' . $extra;
-                                $warning_detected[] = $e->getMessage() . '<br/>(' . $query  . ')';
+                                $warning_detected[] = $e->getMessage() . '<br/>(' . $query . ')';
                             }
                         }
                     }
index b75bc6c5dbcab8e1dfb6f2689be790a171cff487..98defcb029ddc9f2a6a40d8cd9aea1cfee946520 100644 (file)
@@ -85,8 +85,8 @@ abstract class AbstractPassword
         }
         $pass = '';
         $i = 0;
-        while ($i <= $size-1) {
-            $num = mt_rand(0, 32) % 33;
+        while ($i <= $size - 1) {
+            $num = mt_rand(0, 32)%33;
             $pass .= substr($this->chars, $num, 1);
             $i++;
         }
index e8eb211e50a55cdfb435b1b2fa9f7e72453bc293..1cfd046a84e8fd5c2f317970cf92a5ac7687308e 100644 (file)
@@ -73,33 +73,33 @@ abstract class Authentication
     private $cron = false;
 
     /**
-    * Logs in user.
-    *
-    * @param string $user  user's login
-    * @param string $passe user's password
-    *
-    * @return boolean
-    */
+     * Logs in user.
+     *
+     * @param string $user  user's login
+     * @param string $passe user's password
+     *
+     * @return boolean
+     */
     abstract public function logIn($user, $passe);
 
     /**
-    * Does this login already exists ?
-    * These function should be used for setting admin login into Preferences
-    *
-    * @param string $user the username
-    *
-    * @return true if the username already exists, false otherwise
-    */
+     * Does this login already exists ?
+     * These function should be used for setting admin login into Preferences
+     *
+     * @param string $user the username
+     *
+     * @return true if the username already exists, false otherwise
+     */
     abstract public function loginExists($user);
 
     /**
-    * Login for the superuser
-    *
-    * @param string      $login       name
-    * @param Preferences $preferences Preferences instance
-    *
-    * @return void
-    */
+     * Login for the superuser
+     *
+     * @param string      $login       name
+     * @param Preferences $preferences Preferences instance
+     *
+     * @return void
+     */
     public function logAdmin($login, Preferences $preferences)
     {
         $this->logged = true;
@@ -137,10 +137,10 @@ abstract class Authentication
     }
 
     /**
-    * Log out user and unset variables
-    *
-    * @return void
-    */
+     * Log out user and unset variables
+     *
+     * @return void
+     */
     public function logOut()
     {
         $this->id = null;
@@ -155,40 +155,40 @@ abstract class Authentication
     }
 
     /**
-    * Is user logged-in?
-    *
-    * @return bool
-    */
+     * Is user logged-in?
+     *
+     * @return bool
+     */
     public function isLogged()
     {
         return $this->logged;
     }
 
     /**
-    * Is user admin?
-    *
-    * @return bool
-    */
+     * Is user admin?
+     *
+     * @return bool
+     */
     public function isAdmin()
     {
         return $this->admin;
     }
 
     /**
-    * Is user super admin?
-    *
-    * @return bool
-    */
+     * Is user super admin?
+     *
+     * @return bool
+     */
     public function isSuperAdmin()
     {
         return $this->superadmin;
     }
 
     /**
-    * Is user active?
-    *
-    * @return bool
-    */
+     * Is user active?
+     *
+     * @return bool
+     */
     public function isActive()
     {
         return $this->active;
@@ -279,12 +279,12 @@ abstract class Authentication
     }
 
     /**
-    * Global getter method
-    *
-    * @param string $name name of the property we want to retrieve
-    *
-    * @return false|object the called property
-    */
+     * Global getter method
+     *
+     * @param string $name name of the property we want to retrieve
+     *
+     * @return false|object the called property
+     */
     public function __get($name)
     {
         $forbidden = array('logged', 'admin', 'active');
@@ -296,13 +296,13 @@ abstract class Authentication
     }
 
     /**
-    * Global setter method
-    *
-    * @param string $name  name of the property we want to assign a value to
-    * @param object $value a relevant value for the property
-    *
-    * @return void
-    */
+     * Global setter method
+     *
+     * @param string $name  name of the property we want to assign a value to
+     * @param object $value a relevant value for the property
+     *
+     * @return void
+     */
     public function __set($name, $value)
     {
         $this->$name = $value;
index e30ea0ce49224ae15b3a74b21b0c2a7408330c33..23f8d0e986e1933fc0dce1a0099b3aab4b70a3e5 100644 (file)
@@ -145,8 +145,8 @@ class CheckModules
         if (count($this->missing) > 0) {
             $ko = ($translated ? _T('Ko') : 'Ko');
             foreach ($this->missing as $m) {
-                $html .= '<li><span>' . $m  . '</span><span><img src="' .
-                    $img_dir  . 'icon-invalid.png" alt="' .
+                $html .= '<li><span>' . $m . '</span><span><img src="' .
+                    $img_dir . 'icon-invalid.png" alt="' .
                     $ko . '"/></span></li>';
             }
         }
@@ -154,16 +154,16 @@ class CheckModules
         if (count($this->good) > 0) {
             $ok = ($translated ? _T('Ok') : 'Ok');
             foreach ($this->good as $m) {
-                $html .= '<li><span>' . $m  . '</span><span><img src="' .
-                    $img_dir  . 'icon-valid.png" alt="' .
+                $html .= '<li><span>' . $m . '</span><span><img src="' .
+                    $img_dir . 'icon-valid.png" alt="' .
                     $ok . '"/></span></li>';
             }
         }
 
         if (count($this->should) > 0) {
             foreach ($this->should as $m) {
-                $html .= '<li><span>' . $m  . '</span><span><img src="' .
-                    $img_dir  . 'icon-warning.png" alt=""' .
+                $html .= '<li><span>' . $m . '</span><span><img src="' .
+                    $img_dir . 'icon-warning.png" alt=""' .
                     '/></span></li>';
             }
         }
index 8d9c3a228d16a8258a21983023c45a52540439c5..405465ac47190ae37b1d6f5fcef3297255c38724 100644 (file)
@@ -402,7 +402,7 @@ class Db
                 }
             } catch (\Exception $e) {
                 Analog::log(
-                    'Cannot INSERT records | ' .$e->getMessage(),
+                    'Cannot INSERT records | ' . $e->getMessage(),
                     Analog::WARNING
                 );
                 //if we cannot insert records, some others tests cannot be done
@@ -429,7 +429,7 @@ class Db
                     }
                 } catch (\Exception $e) {
                     Analog::log(
-                        'Cannot UPDATE records | ' .$e->getMessage(),
+                        'Cannot UPDATE records | ' . $e->getMessage(),
                         Analog::WARNING
                     );
                     $results['update'] = $e;
@@ -464,7 +464,7 @@ class Db
                     $results['delete'] = true;
                 } catch (\Exception $e) {
                     Analog::log(
-                        'Cannot DELETE records | ' .$e->getMessage(),
+                        'Cannot DELETE records | ' . $e->getMessage(),
                         Analog::WARNING
                     );
                     $results['delete'] = $e;
@@ -568,7 +568,7 @@ class Db
                     );
 
                     Analog::log(
-                        'Charset successfully changed for table `' . $table .'`',
+                        'Charset successfully changed for table `' . $table . '`',
                         Analog::DEBUG
                     );
                 }
@@ -663,7 +663,7 @@ class Db
 
                 //build where
                 foreach ($pkeys as $k) {
-                    $where[] = $k . ' = "' . $row->$k .'"';
+                    $where[] = $k . ' = "' . $row->$k . '"';
                 }
 
                 //build data
@@ -855,7 +855,7 @@ class Db
             $sql = 'SELECT pg_database_size(\'' . NAME_DB . '\')';
             $result = $this->db->query($sql, Adapter::QUERY_MODE_EXECUTE)
                 ->current();
-            $infos['size']          = (string)round($result['pg_database_size'] / 1024 / 1024);
+            $infos['size'] = (string)round($result['pg_database_size']/1024/1024);
         } else {
             $sql = 'SELECT @@sql_mode as mode, @@version AS version, @@version_comment AS version_comment';
             $result = $this->db->query($sql, Adapter::QUERY_MODE_EXECUTE)
@@ -866,11 +866,11 @@ class Db
             $infos['sql_mode']  = $result['mode'];
 
             $size_sql = 'SELECT ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS dbsize' .
-                ' FROM information_schema.tables WHERE table_schema="' . NAME_DB .'"';
+                ' FROM information_schema.tables WHERE table_schema="' . NAME_DB . '"';
             $result = $this->db->query($size_sql, Adapter::QUERY_MODE_EXECUTE)
                 ->current();
 
-            $infos['size']      = $result['dbsize'];
+            $infos['size'] = $result['dbsize'];
         }
 
         return $infos;
index 4674f20e428f0de7dc2983c2d038176f69ae1bdd..522d913a7bc4a9a975beef0e18ccdb912dabc8da 100644 (file)
@@ -67,7 +67,7 @@ class Galette
             $version .= '-git';
         }
 
-        if (is_dir(GALETTE_ROOT.'../.git')) {
+        if (is_dir(GALETTE_ROOT . '../.git')) {
             $commitHash = trim(exec('git log --pretty="%h" -n1 HEAD'));
 
             $commitDate = new \DateTime(trim(exec('git log -n1 --pretty=%ci HEAD')));
index 3e4e95bdf8a6550e15dd5c2475ccc2c06f89a14a..7eb03bb41433740cd500380da33a1cdb575b4fb6 100644 (file)
@@ -320,7 +320,7 @@ class GaletteMail
                 $this->mail->AltBody .= $tsign;
                 //then apply email sign to html version
                 $sign_style = 'color:grey;border-top:1px solid #ccc;margin-top:2em';
-                $hsign = '<div style="' . $sign_style. '">' .
+                $hsign = '<div style="' . $sign_style . '">' .
                     nl2br($sign) . '</div>';
                 $this->mail->Body .= $hsign;
             } else {
index 10c9968c7863ad43198c68ed99316b20ef2b74b2..342dcc45670ccde2867d39f8074f364253d05eba 100644 (file)
@@ -428,7 +428,7 @@ class History
             }
         } else {
             Analog::log(
-                '[History] Unable to get proprety `' .$name . '`',
+                '[History] Unable to get proprety `' . $name . '`',
                 Analog::WARNING
             );
         }
@@ -458,7 +458,7 @@ class History
             }
         } else {
             Analog::log(
-                '[History] Unable to set proprety `' .$name . '`',
+                '[History] Unable to set proprety `' . $name . '`',
                 Analog::WARNING
             );
         }
index 0cfb80fd3131255e819a33804bcbd49a76f95f77..60e7c64fd8a6860a91a0ae38339b49f0c4dc50a2 100644 (file)
@@ -164,7 +164,7 @@ class Install
         $img_name = ($arg === true) ? 'valid' : 'invalid';
         $src = GALETTE_THEME_DIR . 'images/icon-' . $img_name . '.png';
         $alt = ($arg === true) ? _T("Ok") : _T("Ko");
-        $img = '<img src="' . $src  . '" alt="' . $alt  . '"/>';
+        $img = '<img src="' . $src . '" alt="' . $alt . '"/>';
         return $img;
     }
 
@@ -222,7 +222,7 @@ class Install
     public function atPreviousStep()
     {
         if ($this->_step > 0) {
-            if ($this->_step -1 !== self::STEP_DB_INSTALL
+            if ($this->_step - 1 !== self::STEP_DB_INSTALL
                 && $this->_step !== self::STEP_END
             ) {
                 if ($this->_step === self::STEP_DB_INSTALL) {
@@ -231,7 +231,7 @@ class Install
                     if ($this->_step === self::STEP_DB_UPGRADE) {
                         $this->setInstalledVersion(null);
                     }
-                    $this->_step = $this->_step -1;
+                    $this->_step = $this->_step - 1;
                 }
             } else {
                 $msg = null;
@@ -1030,11 +1030,11 @@ class Install
             && isset($existing['db_user'])
             && $existing['db_user'] == $this->_db_user
             && isset($existing['pwd_db'])
-            && $existing['pwd_db']  == $this->_db_pass
+            && $existing['pwd_db'] == $this->_db_pass
             && isset($existing['db_name'])
             && $existing['db_name'] == $this->_db_name
             && isset($existing['prefix'])
-            && $existing['prefix']  == $this->_db_prefix
+            && $existing['prefix'] == $this->_db_prefix
         ) {
             Analog::log(
                 'Config file is already up-to-date, nothing to do.',
index 9ae6211cf763032d23265ede8b4477c22ac7c1fb..1462d7a13783f081ecd6d546f3345cfe51cb8f35 100644 (file)
@@ -99,7 +99,7 @@ class Links
             $del = $this->zdb->execute($delete);
             if ($del) {
                 Analog::log(
-                    'Temporary link for `' . $target .'-' . $id  . '` has been removed.',
+                    'Temporary link for `' . $target . '-' . $id . '` has been removed.',
                     Analog::DEBUG
                 );
             }
index ec3d3d8ad49e76bf352fa555389c2a08fe897b70..24078d1dddc12caac702e5874ae2e9c07e0b2691 100644 (file)
@@ -82,13 +82,13 @@ class Login extends Authentication
     }
 
     /**
-    * Login for the superuser
-    *
-    * @param string      $login       name
-    * @param Preferences $preferences Preferences instance
-    *
-    * @return void
-    */
+     * Login for the superuser
+     *
+     * @param string      $login       name
+     * @param Preferences $preferences Preferences instance
+     *
+     * @return void
+     */
     public function logAdmin($login, Preferences $preferences)
     {
         parent::logAdmin($login, $preferences);
@@ -96,10 +96,10 @@ class Login extends Authentication
     }
 
     /**
-    * Log out user and unset variables
-    *
-    * @return void
-    */
+     * Log out user and unset variables
+     *
+     * @return void
+     */
     public function logOut()
     {
         parent::logOut();
index d944bb0612342b0d3b661d74e4fbc9d6e99842df..91ebe405b0f1d406befb3acb9a31a0b588949eb7 100644 (file)
@@ -340,7 +340,7 @@ class Mailing extends GaletteMail
         ) {
             foreach ($this->attachments as &$attachment) {
                 $old_path = $attachment->getDestDir() . $attachment->getFileName();
-                $new_path = GALETTE_ATTACHMENTS_PATH . $this->id .'/' .
+                $new_path = GALETTE_ATTACHMENTS_PATH . $this->id . '/' .
                     $attachment->getFileName();
                 if (!file_exists(GALETTE_ATTACHMENTS_PATH . $this->id)) {
                     mkdir(GALETTE_ATTACHMENTS_PATH . $this->id);
@@ -579,10 +579,10 @@ class Mailing extends GaletteMail
                 break;
             case 'current_step':
                 if (is_int($value)
-                    && (   $value == self::STEP_START
+                    && ($value == self::STEP_START
                     || $value == self::STEP_PREVIEW
                     || $value == self::STEP_SEND
-                    || $value == self::STEP_SENT )
+                    || $value == self::STEP_SENT)
                 ) {
                     $this->current_step = (int)$value;
                 } else {
index ad23b9e13fa009c44357e4b6d615e664bf4855ab..6c32a94195c7c622f6feb2425c4a6b6dd6e56349 100644 (file)
@@ -78,7 +78,7 @@ class MailingHistory extends History
 
     private $senders;
 
-   /**
+    /**
      * Default constructor
      *
      * @param Db          $zdb     Database
@@ -436,14 +436,11 @@ class MailingHistory extends History
             }
 
             $sender = ($this->sender === 0) ?
-                new Expression('NULL') :
-                $this->sender;
+                new Expression('NULL') : $this->sender;
             $sender_name = ($this->sender_name === null) ?
-                new Expression('NULL') :
-                $this->sender_name;
+                new Expression('NULL') : $this->sender_name;
             $sender_address = ($this->sender_address === null) ?
-                new Expression('NULL') :
-                $this->sender_address;
+                new Expression('NULL') : $this->sender_address;
 
             $values = array(
                 'mailing_sender'            => $sender,
@@ -494,11 +491,9 @@ class MailingHistory extends History
                 $sender = $this->sender;
             }
             $sender_name = ($this->sender_name === null) ?
-                new Expression('NULL') :
-                $this->sender_name;
+                new Expression('NULL') : $this->sender_name;
             $sender_address = ($this->sender_address === null) ?
-                new Expression('NULL') :
-                $this->sender_address;
+                new Expression('NULL') : $this->sender_address;
 
             $values = array(
                 'mailing_sender'            => $sender,
index 1c5b33ea377ee3c045d7196fd45f05350c99ad1f..221ae173be0afa0d86561b8ef94820fa4e3e5a32 100644 (file)
@@ -123,7 +123,7 @@ abstract class Pagination
      */
     public function invertorder()
     {
-        $actual=$this->ordered;
+        $actual = $this->ordered;
         if ($actual == self::ORDER_ASC) {
                 $this->ordered = self::ORDER_DESC;
         }
@@ -175,7 +175,7 @@ abstract class Pagination
         if ($this->show !== 0) {
             $select->limit($this->show);
             $select->offset(
-                ($this->current_page - 1) * $this->show
+                ($this->current_page - 1)*$this->show
             );
         }
     }
@@ -201,10 +201,10 @@ abstract class Pagination
     protected function countPages()
     {
         if ($this->show !== 0) {
-            if ($this->counter % $this->show == 0) {
-                $this->pages = intval($this->counter / $this->show);
+            if ($this->counter%$this->show == 0) {
+                $this->pages = intval($this->counter/$this->show);
             } else {
-                $this->pages = intval($this->counter / $this->show) + 1;
+                $this->pages = intval($this->counter/$this->show) + 1;
             }
         } else {
             $this->pages = 0;
@@ -235,7 +235,7 @@ abstract class Pagination
 
         //Create pagination links
         if ($this->current_page < 11) {
-            $idepart=1;
+            $idepart = 1;
         } else {
             $idepart = $this->current_page - 10;
         }
@@ -386,7 +386,7 @@ abstract class Pagination
         } else {
             Analog::log(
                 '[' . get_class($this) .
-                '|Pagination] Unable to get proprety `' .$name . '`',
+                '|Pagination] Unable to get proprety `' . $name . '`',
                 Analog::WARNING
             );
         }
index 041c18243656fbad8265c087cf0369dfb335f330..43d138f3c5f8d571eb3f115f002cb0b957378674 100644 (file)
@@ -75,7 +75,7 @@ class PasswordImage extends AbstractPassword
     protected function cleanExpired()
     {
         $dh = @opendir(GALETTE_TEMPIMAGES_PATH);
-        while ($file=readdir($dh)) {
+        while ($file = readdir($dh)) {
             if (substr($file, 0, 3) == 'pw_'
                 && time() - filemtime(GALETTE_TEMPIMAGES_PATH . '/' . $file) > 60
             ) {
@@ -153,7 +153,7 @@ class PasswordImage extends AbstractPassword
         $this->generateNewPassword();
         $pass = $this->getNewPassword();
 
-        $png = imagecreate(10 + 7.5 * strlen($pass), 18);
+        $png = imagecreate(10 + 7.5*strlen($pass), 18);
         $bg = imagecolorallocate($png, 160, 160, 160);
         imagestring($png, 3, 5, 2, $pass, imagecolorallocate($png, 0, 0, 0));
         $file = GALETTE_TEMPIMAGES_PATH . '/' . $this->getImageName();
index 0736b09ccaf0dc65826d8b4aeaf738a57822df7b..991b6b0214c9fe31ef5b05213abf54b0e5c64e03 100644 (file)
@@ -276,15 +276,15 @@ class Picture implements FileInterface
 
         if ($this->height > $this->width) {
             if ($this->height > $this->max_height) {
-                $ratio = $this->max_height / $this->height;
+                $ratio = $this->max_height/$this->height;
                 $this->optimal_height = $this->max_height;
-                $this->optimal_width = $this->width * $ratio;
+                $this->optimal_width = $this->width*$ratio;
             }
         } else {
             if ($this->width > $this->max_width) {
-                $ratio = $this->max_width / $this->width;
+                $ratio = $this->max_width/$this->width;
                 $this->optimal_width = $this->max_width;
-                $this->optimal_height = $this->height * $ratio;
+                $this->optimal_height = $this->height*$ratio;
             }
         }
     }
@@ -306,7 +306,7 @@ class Picture implements FileInterface
      */
     public function display()
     {
-        header('Content-type: '.$this->mime);
+        header('Content-type: ' . $this->mime);
         ob_clean();
         flush();
         $this->getContents();
@@ -440,7 +440,7 @@ class Picture implements FileInterface
                 $err_msg .= 'Invalid extension for file ' . $name . '.';
                 $ret = self::INVALID_EXTENSION;
             } else {
-                $err_msg = 'Invalid filename `' . $name  . '` (Tip: ';
+                $err_msg = 'Invalid filename `' . $name . '` (Tip: ';
                 $err_msg .= preg_replace(
                     '|%s|',
                     htmlentities($this->getBadChars()),
@@ -457,10 +457,10 @@ class Picture implements FileInterface
         }
 
         //Second, let's check file size
-        if ($file['size'] > ( $this->maxlenght * 1024 )) {
+        if ($file['size'] > ($this->maxlenght*1024)) {
             Analog::log(
-                '[' . $class . '] File is too big (' . ( $file['size'] * 1024 ) .
-                'Ko for maximum authorized ' . ( $this->maxlenght * 1024 ) .
+                '[' . $class . '] File is too big (' . ($file['size']*1024) .
+                'Ko for maximum authorized ' . ($this->maxlenght*1024) .
                 'Ko',
                 Analog::ERROR
             );
@@ -518,7 +518,7 @@ class Picture implements FileInterface
     {
         $f = fopen($file, 'r');
         $picture = '';
-        while ($r=fread($f, 8192)) {
+        while ($r = fread($f, 8192)) {
             $picture .= $r;
         }
         fclose($f);
@@ -720,10 +720,10 @@ class Picture implements FileInterface
             list($cur_width, $cur_height, $cur_type, $curattr)
                 = getimagesize($source);
 
-            $ratio = $cur_width / $cur_height;
+            $ratio = $cur_width/$cur_height;
 
             // calculate image size according to ratio
-            if ($cur_width>$cur_height) {
+            if ($cur_width > $cur_height) {
                 $h = $w/$ratio;
             } else {
                 $w = $h*$ratio;
index 4d58d6b335cb53620c0d268660eea0487abee560..37b49717251803ec2ce60ba8b8fc02aec645a5f5 100644 (file)
@@ -85,7 +85,7 @@ class PluginInstall extends Install
     public function atPreviousStep()
     {
         if ($this->_step > 0) {
-            if ($this->_step -1 !== self::STEP_DB_INSTALL
+            if ($this->_step - 1 !== self::STEP_DB_INSTALL
                 && $this->_step !== self::STEP_END
             ) {
                 if ($this->_step === self::STEP_DB_INSTALL) {
@@ -94,7 +94,7 @@ class PluginInstall extends Install
                     if ($this->_step === self::STEP_DB_UPGRADE) {
                         $this->setInstalledVersion(null);
                     }
-                    $this->_step = $this->_step -1;
+                    $this->_step = $this->_step - 1;
                 }
             } else {
                 $msg = null;
index ec93e147ab260f0459cca2eb8c9b85a4c776c3bd..db588ca0dc57671483d89d9ce371819bca378335 100644 (file)
@@ -120,7 +120,7 @@ class Plugins
                             Analog::WARNING
                         );
                         $this->setDisabled(self::DISABLED_MISS);
-                    } elseif (!file_exists($full_entry.'/_disabled')) {
+                    } elseif (!file_exists($full_entry . '/_disabled')) {
                         include $full_entry . '/_define.php';
                         $this->id = null;
                         $this->mroot = null;
@@ -255,8 +255,7 @@ class Plugins
                     'acls'          => $acls,
                     'date'          => $release_date,
                     'priority'      => $priority === null ?
-                                         1000 :
-                                         (integer) $priority,
+                                         1000 : (integer)$priority,
                     'root_writable' => is_writable($this->mroot),
                     'route'         => $route
                 );
@@ -313,7 +312,7 @@ class Plugins
             throw new \Exception(_T("Cannot activate plugin."));
         }
 
-        if (@unlink($this->disabled[$id]['root'].'/_disabled') === false) {
+        if (@unlink($this->disabled[$id]['root'] . '/_disabled') === false) {
             throw new \Exception(_T("Cannot activate plugin."));
         }
     }
index 633708c2f167986b4c6a621765dc304cb456da67..f2cb3a35bbd801904695b680c446e212bf49682b 100644 (file)
@@ -395,7 +395,7 @@ class Preferences
             if (isset($values[$fieldname])) {
                 $value = trim($values[$fieldname]);
             } else {
-                $value="";
+                $value = "";
             }
 
             // now, check validity
@@ -437,7 +437,7 @@ class Preferences
                     case 'pref_card_hspace':
                     case 'pref_card_vspace':
                         // prevent division by zero
-                        if ($fieldname=='pref_numrows' && $value=='0') {
+                        if ($fieldname == 'pref_numrows' && $value == '0') {
                             $value = '10';
                         }
                         if (!is_numeric($value) || $value < 0) {
@@ -446,7 +446,7 @@ class Preferences
                         break;
                     case 'pref_card_tcol':
                         // Set strip text color to white
-                        if (! preg_match("/#([0-9A-F]{6})/i", $value)) {
+                        if (!preg_match("/#([0-9A-F]{6})/i", $value)) {
                             $value = '#FFFFFF';
                         }
                         break;
@@ -552,7 +552,7 @@ class Preferences
             && isset($insert_values['pref_membership_ext'])
             && $insert_values['pref_membership_ext'] != ''
         ) {
-            $this->errors[] =_T("- Default membership extention and beginning of membership are mutually exclusive.");
+            $this->errors[] = _T("- Default membership extention and beginning of membership are mutually exclusive.");
         }
 
         if (isset($insert_values['pref_membership_offermonths'])
@@ -560,7 +560,7 @@ class Preferences
             && isset($insert_values['pref_membership_ext'])
             && $insert_values['pref_membership_ext'] != ''
         ) {
-            $this->errors[] =_T("- Offering months is only compatible with beginning of membership.");
+            $this->errors[] = _T("- Offering months is only compatible with beginning of membership.");
         }
 
         // missing required fields?
@@ -601,7 +601,7 @@ class Preferences
                 || (!$login->isSuperAdmin()
                 && ($champ != 'pref_admin_pass' && $champ != 'pref_admin_login'))
             ) {
-                if (($champ == "pref_admin_pass" && $_POST['pref_admin_pass'] !=  '')
+                if (($champ == "pref_admin_pass" && $_POST['pref_admin_pass'] != '')
                     || ($champ != "pref_admin_pass")
                 ) {
                     $this->$champ = $valeur;
@@ -685,12 +685,12 @@ class Preferences
     public function getPostalAddress()
     {
         $regs = array(
-          '/%name/',
-          '/%complement/',
-          '/%address/',
-          '/%zip/',
-          '/%town/',
-          '/%country/',
+            '/%name/',
+            '/%complement/',
+            '/%address/',
+            '/%zip/',
+            '/%town/',
+            '/%country/',
         );
 
         $replacements = null;
@@ -892,7 +892,7 @@ class Preferences
             }
             foreach ($addresses as $address) {
                 if (!GaletteMail::isValidEmail($address)) {
-                    $msg =  str_replace('%s', $address, _T("Invalid E-Mail address: %s"));
+                    $msg = str_replace('%s', $address, _T("Invalid E-Mail address: %s"));
                     Analog::log($msg, Analog::WARNING);
                     $this->errors[] = $msg;
                 }
@@ -948,22 +948,22 @@ class Preferences
         //check page width
         $max = 210;
         //margins
-        $size = $this->pref_card_marges_h * 2;
+        $size = $this->pref_card_marges_h*2;
         //cards
-        $size += PdfMembersCards::getWidth() * PdfMembersCards::getCols();
+        $size += PdfMembersCards::getWidth()*PdfMembersCards::getCols();
         //spacing
-        $size += $this->pref_card_hspace * (PdfMembersCards::getCols() - 1);
+        $size += $this->pref_card_hspace*(PdfMembersCards::getCols() - 1);
         if ($size > $max) {
             $warning_detected[] = _T('Current cards configuration may exceed page width!');
         }
 
         $max = 297;
         //margins
-        $size = $this->pref_card_marges_v * 2;
+        $size = $this->pref_card_marges_v*2;
         //cards
-        $size += PdfMembersCards::getHeight() * PdfMembersCards::getRows();
+        $size += PdfMembersCards::getHeight()*PdfMembersCards::getRows();
         //spacing
-        $size += $this->pref_card_vspace * (PdfMembersCards::getRows() - 1);
+        $size += $this->pref_card_vspace*(PdfMembersCards::getRows() - 1);
         if ($size > $max) {
             $warning_detected[] = _T('Current cards configuration may exceed page height!');
         }
index f2e7217ab976f74aa6b2b72c0bc1511abfbbfbc5..f25897a4dd9c09327d4ecf868c9364720e293633 100644 (file)
@@ -79,12 +79,12 @@ class SysInfos
             $php_conf .= str_pad("\n  $key:", 25, '.') . ' ' . $value;
         }
 
-        $str =  str_pad('Galette version:', 20, '.') . ' ' . \Galette\Core\Galette::gitVersion(true) . "\n";
-        $str .= str_pad('PHP version:', 20, '.') . ' ' . PHP_VERSION . " " . php_sapi_name()  . "\n";
-        $str .= 'PHP config:' . $php_conf  . "\n";
-        $str .= str_pad('Database:', 20, '.') . ' '  . $db_version . "\n";
-        $str .= str_pad('OS:', 20, '.') . ' '  . php_uname() . "\n";
-        $str .= str_pad('Browser:', 20, '.') . ' '  . $_SERVER['HTTP_USER_AGENT'] . "\n\n";
+        $str = str_pad('Galette version:', 20, '.') . ' ' . \Galette\Core\Galette::gitVersion(true) . "\n";
+        $str .= str_pad('PHP version:', 20, '.') . ' ' . PHP_VERSION . " " . php_sapi_name() . "\n";
+        $str .= 'PHP config:' . $php_conf . "\n";
+        $str .= str_pad('Database:', 20, '.') . ' ' . $db_version . "\n";
+        $str .= str_pad('OS:', 20, '.') . ' ' . php_uname() . "\n";
+        $str .= str_pad('Browser:', 20, '.') . ' ' . $_SERVER['HTTP_USER_AGENT'] . "\n\n";
 
         $str .= 'Modules:' . "\n";
         $mods = new CheckModules();
@@ -106,14 +106,14 @@ class SysInfos
 
         $str .= "\n" . 'Plugins:' . "\n";
         foreach ($plugins->getModules() as $p) {
-            $str .= '  ' . $p['name'] .  ' ' . $p['version'] .
+            $str .= '  ' . $p['name'] . ' ' . $p['version'] .
                 ' (' . $p['author'] . ")\n";
         }
 
         $str .= "\n" . 'PHP loaded modules:';
         $i = 0;
         foreach (get_loaded_extensions() as $e) {
-            if ($i % 10 === 0) {
+            if ($i%10 === 0) {
                 $str .= "\n  ";
             }
             $str .= $e . ", ";
index fa9ed7e293833c52ff2dc2784d92ccf2af0ef638..880dc0120efb441e17a31315562a64c4b4807553 100644 (file)
@@ -633,7 +633,7 @@ abstract class DynamicField
             $this->width = $values['field_width'];
         }
 
-        if ($this->hasHeight() && isset($values['field_height']) &&  trim($values['field_height']) != '') {
+        if ($this->hasHeight() && isset($values['field_height']) && trim($values['field_height']) != '') {
             $this->height = $values['field_height'];
         }
 
@@ -847,7 +847,7 @@ abstract class DynamicField
             $select = $this->zdb->select(self::TABLE);
             $select->columns(
                 array(
-                    'cnt' => new \Laminas\Db\Sql\Expression('COUNT('. self::PK.')')
+                    'cnt' => new \Laminas\Db\Sql\Expression('COUNT(' . self::PK . ')')
                 )
             )->where(
                 array(
@@ -893,7 +893,7 @@ abstract class DynamicField
 
             $old_rank = $this->index;
 
-            $direction = $action == 'up' ? -1: 1;
+            $direction = $action == 'up' ? -1 : 1;
             $new_rank = $old_rank + $direction;
             $update = $this->zdb->update(self::TABLE);
             $update->set([
index 6a3308245d21f39bc6745accf808fa0257dd2681..33e650092794651749d12ae998cd8b3a5123a391 100644 (file)
@@ -419,7 +419,7 @@ class Adherent
 
             $results = $this->zdb->execute($select);
 
-            if ($results->count() >  0) {
+            if ($results->count() > 0) {
                 foreach ($results as $row) {
                     $deps = $this->_deps;
                     $deps['children'] = false;
@@ -491,8 +491,8 @@ class Adherent
             } else {
                 $date_end = new \DateTime($this->_due_date);
                 $date_diff = $date_now->diff($date_end);
-                $this->_days_remaining = ( $date_diff->invert == 1 )
-                    ? $date_diff->days * -1
+                $this->_days_remaining = ($date_diff->invert == 1)
+                    ? $date_diff->days*-1
                     : $date_diff->days;
 
                 if ($this->_days_remaining == 0) {
@@ -727,7 +727,7 @@ class Adherent
             $patterns = array('/%days/', '/%date/');
             $ddate = new \DateTime($this->_due_date);
             $replace = array(
-                $this->_days_remaining *-1,
+                $this->_days_remaining*-1,
                 $ddate->format(__("Y-m-d"))
             );
             if ($this->_active) {
@@ -1067,7 +1067,7 @@ class Adherent
                 if ($mandatory_missing === true) {
                     $this->errors[] = str_replace(
                         '%field',
-                        '<a href="#' . $key . '">' . $this->getFieldLabel($key) .'</a>',
+                        '<a href="#' . $key . '">' . $this->getFieldLabel($key) . '</a>',
                         _T("- Mandatory field %field empty.")
                     );
                 }
@@ -1145,14 +1145,14 @@ class Adherent
                         $diff = $now->diff($d);
                         $days = (integer)$diff->format('%R%a');
                         if ($days >= 0) {
-                            $this->errors[] =_T('- Birthdate must be set in the past!');
+                            $this->errors[] = _T('- Birthdate must be set in the past!');
                         }
 
                         $years = (integer)$diff->format('%R%Y');
                         if ($years <= -200) {
                             $this->errors[] = str_replace(
                                 '%years',
-                                $years * -1,
+                                $years*-1,
                                 _T('- Members must be less than 200 years old (currently %years)!')
                             );
                         }
@@ -1208,7 +1208,7 @@ class Adherent
                         }
 
                         $results = $this->zdb->execute($select);
-                        if ($results->count() !==  0) {
+                        if ($results->count() !== 0) {
                             $this->errors[] = _T("- This E-Mail address is already used by another member!");
                         }
                     } catch (\Exception $e) {
@@ -1253,7 +1253,7 @@ class Adherent
                             }
 
                             $results = $this->zdb->execute($select);
-                            if ($results->count() !==  0
+                            if ($results->count() !== 0
                                 || $value == $preferences->pref_admin_login
                             ) {
                                 $this->errors[] = _T("- This username is already in use, please choose another one!");
@@ -1275,7 +1275,7 @@ class Adherent
                 ) {
                     $this->errors[] = _T("- The passwords don't match!");
                 } elseif ($this->_self_adh === true
-                    && !crypt($value, $values['mdp_crypt'])==$values['mdp_crypt']
+                    && !crypt($value, $values['mdp_crypt']) == $values['mdp_crypt']
                 ) {
                     $this->errors[] = _T("Password misrepeated: ");
                 } else {
@@ -1841,7 +1841,7 @@ class Adherent
         // picture upload
         if (isset($files['photo'])) {
             if ($files['photo']['error'] === UPLOAD_ERR_OK) {
-                if ($files['photo']['tmp_name'] !='') {
+                if ($files['photo']['tmp_name'] != '') {
                     if (is_uploaded_file($files['photo']['tmp_name'])) {
                         $res = $this->picture->store($files['photo']);
                         if ($res < 0) {
index 8de385c396f40645cf16731b0aaf3bb837dcc697..59948165a9f5b99b08c263783257e6e1341e55a6 100644 (file)
@@ -274,7 +274,7 @@ class Contribution
                 return true;
             } else {
                 throw new \Exception(
-                    'No contribution #' . $id . ' (user ' .$this->login->id . ')'
+                    'No contribution #' . $id . ' (user ' . $this->login->id . ')'
                 );
             }
         } catch (\Exception $e) {
@@ -455,7 +455,7 @@ class Contribution
                 ) {
                     $this->errors[] = str_replace(
                         '%field',
-                        '<a href="#' . $key . '">' . $this->getFieldLabel($key) .'</a>',
+                        '<a href="#' . $key . '">' . $this->getFieldLabel($key) . '</a>',
                         _T("- Mandatory field %field empty.")
                     );
                 }
@@ -800,9 +800,8 @@ class Contribution
      */
     public function getRowClass()
     {
-        return ( $this->_end_date != $this->_begin_date && $this->_is_cotis) ?
-            'cotis-normal' :
-            'cotis-give';
+        return ($this->_end_date != $this->_begin_date && $this->_is_cotis) ?
+            'cotis-normal' : 'cotis-give';
     }
 
     /**
@@ -1169,7 +1168,7 @@ class Contribution
                         $date_end = new \DateTime($this->_end_date);
                         $date_start = new \DateTime($this->_begin_date);
                         $diff = $date_end->diff($date_start);
-                        return $diff->format('%y') * 12 + $diff->format('%m');
+                        return $diff->format('%y')*12 + $diff->format('%m');
                     } else {
                         return '';
                     }
@@ -1188,8 +1187,7 @@ class Contribution
                         return null;
                     }
                     return ($this->isCotis()) ?
-                        PdfModel::INVOICE_MODEL :
-                        PdfModel::RECEIPT_MODEL;
+                        PdfModel::INVOICE_MODEL : PdfModel::RECEIPT_MODEL;
                     break;
                 default:
                     return $this->$rname;
index f1c79a344d4cb8a765a392aecf0f0186abaff37a..16653937dd9f5c1586b494eef41926ee67c5e381 100644 (file)
@@ -317,8 +317,7 @@ class DynamicFieldsHandle
                             'where2'    => $value['field_id'],
                             'where3'    => $value['field_form'],
                             'where4'    => isset($value['old_val_index']) ?
-                                $value['old_val_index'] :
-                                $value['val_index']
+                                $value['old_val_index'] : $value['val_index']
                         ];
                         $this->update_stmt->execute($params);
                         $this->has_changed = true;
@@ -502,7 +501,7 @@ class DynamicFieldsHandle
             if (($perm == DynamicField::PERM_MANAGER &&
                     $access_level < Authentication::ACCESS_MANAGER) ||
                 ($perm == DynamicField::PERM_STAFF &&
-                        $access_level < Authentication::ACCESS_STAFF)   ||
+                        $access_level < Authentication::ACCESS_STAFF) ||
                 ($perm == DynamicField::PERM_ADMIN &&
                     $access_level < Authentication::ACCESS_ADMIN)
             ) {
index e94285244be1d444bb52ad12a6a9a17df23ff221..ff39e9ed624b1a81fa89594d15819b6fe8bab7c8 100644 (file)
@@ -231,7 +231,7 @@ trait DynamicsTrait
             }
 
             list($field_id, $val_index) = explode('_', substr($key, 11));
-            if (! is_numeric($field_id) || ! is_numeric($val_index)) {
+            if (!is_numeric($field_id) || !is_numeric($val_index)) {
                 continue;
             }
 
@@ -258,8 +258,7 @@ trait DynamicsTrait
 
             $max_size =
                 $fields[$field_id]->getSize() ?
-                $fields[$field_id]->getSize() * 1024 :
-                File::DEFAULT_MAX_FILE_SIZE * 1024;
+                $fields[$field_id]->getSize()*1024 : File::DEFAULT_MAX_FILE_SIZE*1024;
             if ($file['size'] > $max_size) {
                 Analog::log(
                     "file too large: " . $file['size'] . " Ko, vs $max_size Ko allowed",
index afacf0d7af6d461d55593b6f69af9a11dd306b04..a9328c6532ccb0e8e51cc60417420ba6a30fc69c 100644 (file)
@@ -134,7 +134,7 @@ abstract class Entitled
             }
         } catch (\Exception $e) {
             Analog::log(
-                'Cannot load ' . $this->getType()  . ' from id `' . $id . '` | ' .
+                'Cannot load ' . $this->getType() . ' from id `' . $id . '` | ' .
                 $e->getMessage(),
                 Analog::WARNING
             );
@@ -206,14 +206,14 @@ abstract class Entitled
             }
 
             Analog::log(
-                'Defaults (' . $this->getType()  .
+                'Defaults (' . $this->getType() .
                 ') were successfully stored into database.',
                 Analog::INFO
             );
             return true;
         } catch (\Exception $e) {
             Analog::log(
-                'Unable to initialize defaults (' . $this->getType()  . ').' .
+                'Unable to initialize defaults (' . $this->getType() . ').' .
                 $e->getMessage(),
                 Analog::WARNING
             );
@@ -292,7 +292,7 @@ abstract class Entitled
 
             if ($results->count() == 0) {
                 Analog::log(
-                    'No entries (' . $this->getType()  . ') defined in database.',
+                    'No entries (' . $this->getType() . ') defined in database.',
                     Analog::INFO
                 );
             } else {
@@ -398,7 +398,7 @@ abstract class Entitled
             }
         } catch (\Exception $e) {
             Analog::log(
-                'Unable to retrieve ' . $this->getType()  . ' from label `' .
+                'Unable to retrieve ' . $this->getType() . ' from label `' .
                 $label . '` | ' . $e->getMessage(),
                 Analog::ERROR
             );
@@ -440,9 +440,9 @@ abstract class Entitled
 
             $ret = $this->zdb->execute($insert);
 
-            if ($ret->count() >  0) {
+            if ($ret->count() > 0) {
                 Analog::log(
-                    'New ' . $this->getType() .' `' . $label .
+                    'New ' . $this->getType() . ' `' . $label .
                     '` added successfully.',
                     Analog::INFO
                 );
@@ -457,7 +457,7 @@ abstract class Entitled
 
                 $this->addTranslation($label);
             } else {
-                throw new \Exception('New ' . $this->getType() .' not added.');
+                throw new \Exception('New ' . $this->getType() . ' not added.');
             }
             $this->zdb->connection->commit();
             return true;
@@ -520,7 +520,7 @@ abstract class Entitled
         } catch (\Exception $e) {
             $this->zdb->connection->rollBack();
             Analog::log(
-                'Unable to update ' . $this->getType() . ' #' . $id  . ' | ' .
+                'Unable to update ' . $this->getType() . ' #' . $id . ' | ' .
                 $e->getMessage(),
                 Analog::ERROR
             );
@@ -566,7 +566,7 @@ abstract class Entitled
         } catch (\Exception $e) {
             $this->zdb->connection->rollBack();
             Analog::log(
-                'Unable to delete ' . $this->getType()  . ' ' . $id .
+                'Unable to delete ' . $this->getType() . ' ' . $id .
                 ' | ' . $e->getMessage(),
                 Analog::ERROR
             );
@@ -597,7 +597,7 @@ abstract class Entitled
             }
         } catch (\Exception $e) {
             Analog::log(
-                'Unable to check if ' . $this->getType  . ' `' . $id .
+                'Unable to check if ' . $this->getType . ' `' . $id .
                 '` is used. | ' . $e->getMessage(),
                 Analog::ERROR
             );
index 28f01fb818503298a975a9447fbda42beeb9d46d..6e644209ba18e4807cb8a008d4de0db486f82a5d 100644 (file)
@@ -490,7 +490,7 @@ class FieldsConfig
                 if ($cat_label === null) {
                     $cat_label = $c->category;
                 }
-                $cat = (object) array(
+                $cat = (object)array(
                     'id'        => (int)$c->$cpk,
                     'label'     => $cat_label,
                     'elements'  => array()
@@ -616,7 +616,7 @@ class FieldsConfig
                 if ($cat_label === null) {
                     $cat_label = $c->category;
                 }
-                $cat = (object) array(
+                $cat = (object)array(
                     'id'        => (int)$c->$cpk,
                     'label'     => $cat_label,
                     'elements'  => array()
@@ -857,8 +857,7 @@ class FieldsConfig
                 $stmt->execute(
                     array(
                         'required'  => ($or->required === false) ?
-                            ($this->zdb->isPostgres() ? 'false' : 0) :
-                            true,
+                            ($this->zdb->isPostgres() ? 'false' : 0) : true,
                         'where1'    => $or->field_id
                     )
                 );
index 58486787f945fd13952af11d6e1dd3641c29d614..e8412747bb710123820458f035e992e464546618 100644 (file)
@@ -86,7 +86,7 @@ class ImportModel
         } catch (\Exception $e) {
             Analog::log(
                 'Cannot load import model | ' . $e->getMessage() .
-                "\n" .  $e->__toString(),
+                "\n" . $e->__toString(),
                 Analog::ERROR
             );
             return false;
index f426ac84fc840f897946b37434c69cb2f0050ae8..94419b6973b7c443a37fa795fe5bcd2ae0f90fa2 100644 (file)
@@ -144,7 +144,7 @@ class Reminder
             $this->comment = $rs->reminder_comment;
         } catch (\Exception $e) {
             Analog::log(
-                __METHOD__ . ': incorrect ResultSet. Error: ' .$e->getMessage(),
+                __METHOD__ . ': incorrect ResultSet. Error: ' . $e->getMessage(),
                 Analog::ERROR
             );
             Analog::log(
@@ -379,7 +379,7 @@ class Reminder
                         $this->nomail = false;
                     }
                     if ($this->type === self::LATE) {
-                        $this->replaces['days_expired'] = $value->days_remaining *-1;
+                        $this->replaces['days_expired'] = $value->days_remaining*-1;
                     }
                     if ($this->type === self::IMPENDING) {
                         $this->replaces['days_remaining'] = $value->days_remaining;
@@ -398,7 +398,7 @@ class Reminder
                 break;
             default:
                 Analog::log(
-                    'Unable to set property ' .$name,
+                    'Unable to set property ' . $name,
                     Analog::WARNING
                 );
                 break;
index 3afa27036891d989324f41f8ad4feeee88feaf63..218f7e8a4a3a435515e1acae1a844b5ed98ff801 100644 (file)
@@ -168,7 +168,7 @@ class SavedSearch
             $this->errors = array_merge($this->errors, $mandatory);
         }
 
-        if ($this->id === null &&$this->login->isSuperAdmin()) {
+        if ($this->id === null && !$this->login->isSuperAdmin()) {
             //set author for new searches
             $this->author_id = $this->login->id;
         }
@@ -208,7 +208,7 @@ class SavedSearch
                 ->limit(1);
 
             $results = $this->zdb->execute($select);
-            if ($results->count() !==  0) {
+            if ($results->count() !== 0) {
                 $result = $results->current();
                 //search already exists
                 Analog::log(
index 69d717fedd2e8c003e33656b63ffe2b393c47633..04a39a3326a874228f33995ba4d8cb112c525753 100644 (file)
@@ -438,7 +438,7 @@ class Texts
                 }
             }
 
-            if (count($missing) >0) {
+            if (count($missing) > 0) {
                 $this->insert($zdb, $missing);
 
                 Analog::log(
index cd72ecaf77c8606b0a691c7ac6994b4a46b5404a..9277ca62ad2b03b1607218a2fe6e539c66e21247 100644 (file)
@@ -285,7 +285,7 @@ class Title
                 break;
             default:
                 Analog::log(
-                    'Unable to set property ' .$name,
+                    'Unable to set property ' . $name,
                     Analog::WARNING
                 );
                 break;
index c8e1432203e7c42afd449397276a16ef601ce2c0..201494bc2dd52d3469a34b543d3e2d3f5cc0bac9 100644 (file)
@@ -332,7 +332,7 @@ class Transaction
                 if (!isset($disabled[$key]) && !isset($this->$prop)) {
                     $this->errors[] = str_replace(
                         '%field',
-                        '<a href="#' . $key . '">' . $this->getFieldLabel($key) .'</a>',
+                        '<a href="#' . $key . '">' . $this->getFieldLabel($key) . '</a>',
                         _T("- Mandatory field %field empty.")
                     );
                 }
@@ -533,9 +533,8 @@ class Transaction
      */
     public function getRowClass()
     {
-        return ( $this->getMissingAmount() == 0 ) ?
-            'transaction-normal' :
-            'transaction-uncomplete';
+        return ($this->getMissingAmount() == 0) ?
+            'transaction-normal' : 'transaction-uncomplete';
     }
 
     /**
index 3f988cf944688e34872918346c73671b477f3c98..3774fbe5430a3dcaec0d07b71e09af6d7eb2b239 100644 (file)
@@ -339,7 +339,7 @@ class AdvancedMembersList extends MembersList
                 return $this->$rname;
             } else {
                 Analog::log(
-                    '[AdvancedMembersList] Unable to get proprety `' .$name . '`',
+                    '[AdvancedMembersList] Unable to get proprety `' . $name . '`',
                     Analog::WARNING
                 );
             }
@@ -408,7 +408,7 @@ class AdvancedMembersList extends MembersList
                     } else {
                         if ($value !== null) {
                             Analog::log(
-                                'Incorrect amount for ' . $name  . '! ' .
+                                'Incorrect amount for ' . $name . '! ' .
                                 'Should be a float (' . gettype($value) . ' given)',
                                 Analog::WARNING
                             );
@@ -600,7 +600,7 @@ class AdvancedMembersList extends MembersList
                     } else {
                         Analog::log(
                             '[AdvancedMembersList] Value for group filter logical operator should be '
-                            .' in [0,1] (' . gettype($value) . '-> '.$value.' given )',
+                            .' in [0,1] (' . gettype($value) . '-> ' . $value . ' given )',
                             Analog::WARNING
                         );
                     }
index 8068bf59047d6a7b29bca5a27596e248e6e2a116..b6e939d3f37ceba6a03e8d64b5595a282ec1ccff 100644 (file)
@@ -178,7 +178,7 @@ class ContributionsList extends Pagination
                 }
             } else {
                 Analog::log(
-                    '[ContributionsList] Unable to get proprety `' .$name . '`',
+                    '[ContributionsList] Unable to get proprety `' . $name . '`',
                     Analog::WARNING
                 );
             }
@@ -225,7 +225,7 @@ class ContributionsList extends Pagination
                             }
 
                             $ym = \DateTime::createFromFormat(__("Y-m"), $value);
-                            if ($y === false && $ym  !== false) {
+                            if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
                                     $day = $ym->format('t');
@@ -239,7 +239,7 @@ class ContributionsList extends Pagination
                             }
 
                             $d = \DateTime::createFromFormat(__("Y-m-d"), $value);
-                            if ($y === false && $ym  === false && $d !== false) {
+                            if ($y === false && $ym === false && $d !== false) {
                                 $this->$name = $d->format('Y-m-d');
                             }
 
index 838e979a001a6309fb451e127b41f8bb5c71b3ad..625100bd797ce7d033d2ca6c6a8872f68a9943e3 100644 (file)
@@ -164,7 +164,7 @@ class HistoryList extends Pagination
                 }
             } else {
                 Analog::log(
-                    '[HistoryList] Unable to get proprety `' .$name . '`',
+                    '[HistoryList] Unable to get proprety `' . $name . '`',
                     Analog::WARNING
                 );
             }
@@ -211,7 +211,7 @@ class HistoryList extends Pagination
                             }
 
                             $ym = \DateTime::createFromFormat(__("Y-m"), $value);
-                            if ($y === false && $ym  !== false) {
+                            if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
                                     $day = $ym->format('t');
@@ -225,7 +225,7 @@ class HistoryList extends Pagination
                             }
 
                             $d = \DateTime::createFromFormat(__("Y-m-d"), $value);
-                            if ($y === false && $ym  === false && $d !== false) {
+                            if ($y === false && $ym === false && $d !== false) {
                                 $this->$name = $d->format('Y-m-d');
                             }
 
index 4c4b06a2b3d876907ad4088059653821879149e0..e857296d655f283262203c18080ffa01e9ec7c15 100644 (file)
@@ -158,7 +158,7 @@ class MailingsList extends Pagination
                 }
             } else {
                 Analog::log(
-                    '[MailingsList] Unable to get proprety `' .$name . '`',
+                    '[MailingsList] Unable to get proprety `' . $name . '`',
                     Analog::WARNING
                 );
             }
@@ -205,7 +205,7 @@ class MailingsList extends Pagination
                             }
 
                             $ym = \DateTime::createFromFormat(__("Y-m"), $value);
-                            if ($y === false && $ym  !== false) {
+                            if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
                                     $day = $ym->format('t');
@@ -219,7 +219,7 @@ class MailingsList extends Pagination
                             }
 
                             $d = \DateTime::createFromFormat(__("Y-m-d"), $value);
-                            if ($y === false && $ym  === false && $d !== false) {
+                            if ($y === false && $ym === false && $d !== false) {
                                 $this->$name = $d->format('Y-m-d');
                             }
 
index aa2ef055d959e9e90d9a1a2619901f109ee94ab4..ce4ca096c19d945b20b65c6e0db9cf84ef38f4fd 100644 (file)
@@ -140,7 +140,7 @@ class MembersList extends Pagination
                 }
             } else {
                 Analog::log(
-                    '[MembersList] Unable to get proprety `' .$name . '`',
+                    '[MembersList] Unable to get proprety `' . $name . '`',
                     Analog::WARNING
                 );
             }
index c30b44d860cee331f42253a13b7b0d4f639c5956..7a3f5cd3e0779f07363e20e5bd4c24ea63020e98 100644 (file)
@@ -153,7 +153,7 @@ class TransactionsList extends Pagination
                 }
             } else {
                 Analog::log(
-                    '[TransactionsList] Unable to get proprety `' .$name . '`',
+                    '[TransactionsList] Unable to get proprety `' . $name . '`',
                     Analog::WARNING
                 );
             }
@@ -200,7 +200,7 @@ class TransactionsList extends Pagination
                             }
 
                             $ym = \DateTime::createFromFormat(__("Y-m"), $value);
-                            if ($y === false && $ym  !== false) {
+                            if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
                                     $day = $ym->format('t');
@@ -214,7 +214,7 @@ class TransactionsList extends Pagination
                             }
 
                             $d = \DateTime::createFromFormat(__("Y-m-d"), $value);
-                            if ($y === false && $ym  === false && $d !== false) {
+                            if ($y === false && $ym === false && $d !== false) {
                                 $this->$name = $d->format('Y-m-d');
                             }
 
index 5b4edb79d3e52d14e9f5c7de456a84b227ea3937..866b2e670ccd102071b83aeace45644a38b7f548 100644 (file)
@@ -65,7 +65,7 @@ trait GaletteError
     public function __construct(Smarty $view, $displayErrorDetails = false)
     {
         $this->view = $view;
-        $this->displayErrorDetails = (bool) $displayErrorDetails;
+        $this->displayErrorDetails = (bool)$displayErrorDetails;
     }
 
 
index a968a60f3c59cac815496fb1291e673676f26ac3..1f76037b1d3e7470270d71cd56c968e46e1a41dc 100644 (file)
@@ -118,11 +118,11 @@ abstract class Csv
             $raw_size = filesize($file);
             $size = 0;
             if ($raw_size >= 1024*1024*1024) { // Go
-                $size = round(($raw_size / 1024)/1024/1024, 2) . ' Go';
+                $size = round(($raw_size/1024)/1024/1024, 2) . ' Go';
             } elseif ($raw_size >= 1024*1024) { // Mo
-                $size = round(($raw_size / 1024)/1024, 2) . ' Mo';
+                $size = round(($raw_size/1024)/1024, 2) . ' Mo';
             } elseif ($raw_size >= 1024) { // ko
-                $size = round(($raw_size / 1024), 2) . ' Ko';
+                $size = round(($raw_size/1024), 2) . ' Ko';
             } else { // octets
                 $size = $raw_size . ' octets';
             }
@@ -147,7 +147,7 @@ abstract class Csv
     {
         //let's ensure we do not have a path here
         $name = basename($name);
-        $filename=$this->default_directory . $name;
+        $filename = $this->default_directory . $name;
 
         if (file_exists($filename)) {
             $removed = unlink($filename);
@@ -193,7 +193,7 @@ abstract class Csv
     {
         $class = get_class($this);
         Analog::log(
-            '[' . $class  . '] ' . $msg,
+            '[' . $class . '] ' . $msg,
             Analog::ERROR
         );
         $this->errors[] = $msg;
index 11c1723c57a9539997a8e288f596f6271706d787..eb58815a8ddfbb70abae35cb725fd89fe021dfef 100644 (file)
@@ -353,8 +353,7 @@ class CsvIn extends Csv implements FileInterface
                         if (isset($this->emails[$column])) {
                             $existing = $this->emails[$column];
                             $extra = ($existing == -1 ?
-                                _T("from another member in import") :
-                                str_replace('%id_adh', $existing, _T("from member %id_adh"))
+                                _T("from another member in import") : str_replace('%id_adh', $existing, _T("from member %id_adh"))
                             );
                             $this->addError(
                                 str_replace(
@@ -421,7 +420,7 @@ class CsvIn extends Csv implements FileInterface
                 $member->dynamicsValidate($dfields);
                 $errors = $member->getErrors();
                 if (count($errors) > $errcnt) {
-                    $lcnt = ($errcnt > 0 ? $errcnt -1 : 0);
+                    $lcnt = ($errcnt > 0 ? $errcnt - 1 : 0);
                     for ($i = $lcnt; $i < count($errors); ++$i) {
                         $this->addError($errors[$i]);
                     }
@@ -487,7 +486,7 @@ class CsvIn extends Csv implements FileInterface
                             || $this->_fields[$col] == 'activite_adh')
                             && ($column == null || trim($column) == '')
                         ) {
-                            $values[$this->_fields[$col]] = 0;//defaults to 0 as in Adherent
+                            $values[$this->_fields[$col]] = 0; //defaults to 0 as in Adherent
                         }
 
                         if ($this->_fields[$col] == Status::PK && empty(trim($column))) {
index 9c5092c0fd68dd95d4a6c7fa189201e35f427e27..a63d2ad3bac53d2ba67f6c3a94dfc319b2a50088 100644 (file)
@@ -123,7 +123,7 @@ class CsvOut extends Csv
                 ) . $this->quote;
             }
             $this->result .= implode($this->separator, $fields) . self::NEWLINE;
-        } elseif ($titles && is_array($titles) && count($titles)>1) {
+        } elseif ($titles && is_array($titles) && count($titles) > 1) {
             foreach ($titles as $field) {
                 $field = str_replace(
                     array(':', '&nbsp;'),
@@ -175,7 +175,7 @@ class CsvOut extends Csv
     {
         if ($last && $this->file
             || !$last && $this->file
-            && ($this->current_line % self::BUFLINES) == 0
+            && ($this->current_line%self::BUFLINES) == 0
         ) {
             if ($this->file === true) {
                 echo $this->result;
@@ -249,14 +249,14 @@ class CsvOut extends Csv
                 Adapter::QUERY_MODE_EXECUTE
             );
 
-            $filename=self::DEFAULT_DIRECTORY . $export['filename'];
+            $filename = self::DEFAULT_DIRECTORY . $export['filename'];
 
             $fp = fopen($filename, 'w');
             if ($fp) {
-                $separator = ( $export->separator )
+                $separator = ($export->separator)
                     ? $export->separator
                     : self::DEFAULT_SEPARATOR;
-                $quote = ( $export->quote ) ? $export->quote : self::DEFAULT_QUOTE;
+                $quote = ($export->quote) ? $export->quote : self::DEFAULT_QUOTE;
                 if ($export->headers->none) {
                     //No title
                     $title = false;
index d17da573a62778875cd9c69d2d095752a085a2c5..418dcfb91dd4e2c08ccff2d2a6f32014c2f7b18e 100644 (file)
@@ -238,7 +238,7 @@ class ExternalScript
                 //get stderr, if any
                 $errors = stream_get_contents($pipes[2]);
                 if (trim($errors) !== '') {
-                    $this->output .="\n\nStdErr:\n" . $errors;
+                    $this->output .= "\n\nStdErr:\n" . $errors;
                 }
 
                 //closes pipes and process
index e1ca51bc73bf4cebd7deb481d86ece3362517e4a..5e16538f973732c81009d982ecabd4b0e51f2540 100644 (file)
@@ -271,7 +271,7 @@ trait FileTrait
                 $err_msg .= 'Invalid extension for file ' . $this->name . '.';
                 $ret = self::INVALID_EXTENSION;
             } else {
-                $err_msg = 'Invalid filename `' . $this->name  . '` (Tip: ';
+                $err_msg = 'Invalid filename `' . $this->name . '` (Tip: ';
                 $err_msg .= preg_replace(
                     '|%s|',
                     htmlentities($this->getBadChars()),
@@ -288,10 +288,10 @@ trait FileTrait
         }
 
         //Second, let's check file size
-        if ($file['size'] > ($this->maxlenght * 1024)) {
+        if ($file['size'] > ($this->maxlenght*1024)) {
             Analog::log(
-                '[' . $class . '] File is too big (' . ( $file['size'] * 1024 ) .
-                'Ko for maximum authorized ' . ( $this->maxlenght * 1024 ) .
+                '[' . $class . '] File is too big (' . ($file['size']*1024) .
+                'Ko for maximum authorized ' . ($this->maxlenght*1024) .
                 'Ko',
                 Analog::ERROR
             );
@@ -458,7 +458,7 @@ trait FileTrait
         }
 
         Analog::log(
-            '[' . $class . '] Found mimetype : ' . $mime . ' for file ' .  $file,
+            '[' . $class . '] Found mimetype : ' . $mime . ' for file ' . $file,
             Analog::INFO
         );
         return $mime;
index 9ca6a3c6976231322f2952a34293440b8c474c44..0aa0b1c722ad91ed86275c5e96f3aa65e116087f 100644 (file)
@@ -101,8 +101,8 @@ class MembersCsv extends CsvOut
     public function exportMembers(MembersList $filters)
     {
         $export_fields = null;
-        if (file_exists(GALETTE_CONFIG_PATH  . 'local_export_fields.inc.php')) {
-            include_once GALETTE_CONFIG_PATH  . 'local_export_fields.inc.php';
+        if (file_exists(GALETTE_CONFIG_PATH . 'local_export_fields.inc.php')) {
+            include_once GALETTE_CONFIG_PATH . 'local_export_fields.inc.php';
             $export_fields = $fields;
         }
 
index 25f237b1d4a9ff80f1ff80f33d67fe148ad6cccd..9a0a5826d82a869249485d725b117fe835d76898 100644 (file)
@@ -174,7 +174,7 @@ class News
      */
     private function getCacheFilename()
     {
-        return GALETTE_CACHE_DIR .str_replace(
+        return GALETTE_CACHE_DIR . str_replace(
             '%feed',
             md5($this->feed_url),
             $this->cache_filename
@@ -240,7 +240,7 @@ class News
             $this->posts = $posts;
         } catch (\Exception $e) {
             Analog::log(
-                'Unable to load feed from "' . $this->feed_url  .
+                'Unable to load feed from "' . $this->feed_url .
                 '" :( | ' . $e->getMessage(),
                 Analog::ERROR
             );
index e36620cf883cb4a3b04651663b050a4fa366d0bb..cdd16bc9855200dd8b33d5faaab3c565ecbebed8 100644 (file)
@@ -160,7 +160,7 @@ class Pdf extends \TCPDF
         global $container;
 
         Analog::log(
-            'PDF error: ' .$msg,
+            'PDF error: ' . $msg,
             Analog::ERROR
         );
 
@@ -170,8 +170,7 @@ class Pdf extends \TCPDF
         );
 
         $redirect = (isset($_SERVER['HTTP_REFERER']) ?
-            $_SERVER['HTTP_REFERER'] :
-            $container->get('router')->pathFor('slash'));
+            $_SERVER['HTTP_REFERER'] : $container->get('router')->pathFor('slash'));
         header('Location: ' . $redirect);
         die();
     }
@@ -206,11 +205,11 @@ class Pdf extends \TCPDF
      */
     protected function parsegif($file)
     {
-        $a=GetImageSize($file);
+        $a = GetImageSize($file);
         if (empty($a)) {
             $this->Error(_T("Missing or incorrect image file ") . $file);
         }
-        if ($a[2]!=1) {
+        if ($a[2] != 1) {
             $this->Error(_T("Not a GIF file ") . $file);
         }
 
@@ -220,15 +219,15 @@ class Pdf extends \TCPDF
 
             // Test d'échec & Affichage d'un message d'erreur
             if (!$data) {
-                    $this->Error(_T("Error loading ").$file);
+                    $this->Error(_T("Error loading ") . $file);
             }
             if (imagepng($data, GALETTE_ROOT . 'tempimages/gif2png.png')) {
                 return $this->_parsepng(GALETTE_ROOT . 'tempimages/gif2png.png');
             } else {
-                $this->Error(_T("Error creating temporary png file from ").$file);
+                $this->Error(_T("Error creating temporary png file from ") . $file);
             }
         } else {
-            $this->Error(_T("Unable to convert GIF file ").$file);
+            $this->Error(_T("Unable to convert GIF file ") . $file);
         }
     }
 
@@ -307,7 +306,7 @@ class Pdf extends \TCPDF
             if (trim($this->model->hstyles) !== '') {
                 $html .= "<style>\n" . $this->model->hstyles . "\n</style>\n\n";
             }
-            $html .= "<div dir=\"".($this->i18n->isRTL() ? 'rtl' : 'ltr')."\">" . $this->model->hheader . "</div>";
+            $html .= "<div dir=\"" . ($this->i18n->isRTL() ? 'rtl' : 'ltr') . "\">" . $this->model->hheader . "</div>";
             $this->writeHtml($html, true, false, true, false, '');
 
             if ($title !== null) {
@@ -380,7 +379,7 @@ class Pdf extends \TCPDF
             if ($title !== null) {
                 $this->Cell(0, 6, $title, 0, 1, ($this->i18n->isRTL() ? 'R' : 'L'), 0);
             }
-            $yend = $this->getY();//store position at the end of the text
+            $yend = $this->getY(); //store position at the end of the text
 
             $this->SetY($ystart);
             if ($this->i18n->isRTL()) {
@@ -446,7 +445,7 @@ class Pdf extends \TCPDF
      */
     protected function cut($str, $length)
     {
-        $length = $length -2; //keep a margin
+        $length = $length - 2; //keep a margin
         if ($this->GetStringWidth($str) > $length) {
             while ($this->GetStringWidth($str . '...') > $length) {
                 $str = mb_substr($str, 0, -1, 'UTF-8');
index 12b5cc478f531601f8724ea1348a2e8012f2a629..e344b98cf7e0cb865cee2b52597241ce69de42ca 100644 (file)
@@ -86,8 +86,7 @@ class PdfAdhesionForm extends Pdf
         parent::__construct($prefs, $model);
 
         $this->filename = $adh ?
-            __("adherent_form") . '.' . $adh->id . '.pdf' :
-            __("adherent_form") . '.pdf';
+            __("adherent_form") . '.' . $adh->id . '.pdf' : __("adherent_form") . '.pdf';
 
         $this->Open();
 
@@ -163,7 +162,7 @@ class PdfAdhesionForm extends Pdf
                 $main_group = $member_groups[0]->getName();
                 $group_list = '<ul>';
                 foreach ($member_groups as $group) {
-                    $group_list .= '<li>' . $group->getName()  . '</li>';
+                    $group_list .= '<li>' . $group->getName() . '</li>';
                 }
                 $group_list .= '</ul>';
             }
@@ -229,15 +228,15 @@ class PdfAdhesionForm extends Pdf
                 switch ($field_type) {
                     case DynamicField::TEXT:
                         $value .= '<textarea' .
-                            ' id="'    . $field_name  . '"' .
-                            ' name="'  . $field_name  . '"' .
+                            ' id="' . $field_name . '"' .
+                            ' name="' . $field_name . '"' .
                             ' value="' . $field_value['field_val'] . '"' .
                             '/>';
                         break;
                     case DynamicField::LINE:
                         $value .= '<input type="text"' .
-                            ' id="'    . $field_name  . '"' .
-                            ' name="'  . $field_name  . '"' .
+                            ' id="' . $field_name . '"' .
+                            ' name="' . $field_name . '"' .
                             ' value="' . $field_value['field_val'] . '"' .
                             ' size="20" maxlength="30"/>';
                         break;
@@ -245,8 +244,8 @@ class PdfAdhesionForm extends Pdf
                         $choice_values = $dynamic_fields[$field_id]->getValues();
                         foreach ($choice_values as $choice_idx => $choice_value) {
                             $value .= '<input type="radio"' .
-                                ' id="'    . $field_name . '"' .
-                                ' name="'  . $field_name . '"' .
+                                ' id="' . $field_name . '"' .
+                                ' name="' . $field_name . '"' .
                                 ' value="' . $choice_value . '"';
                             if ($choice_idx == $field_values[0]['field_val']) {
                                 $value .= ' checked="checked"';
@@ -258,12 +257,12 @@ class PdfAdhesionForm extends Pdf
                         break;
                     case DynamicField::DATE:
                         $value .= '<input type="text" name="' .
-                            $field_name  . '" value="' .
+                            $field_name . '" value="' .
                             $field_value . '" />';
                         break;
                     case DynamicField::BOOLEAN:
                         $value .= '<input type="checkbox"' .
-                            ' name="' .  $field_name . '"' .
+                            ' name="' . $field_name . '"' .
                             ' value="1"';
                         if ($field_value['field_val'] == 1) {
                             $value .= ' checked="checked"';
@@ -272,7 +271,7 @@ class PdfAdhesionForm extends Pdf
                         break;
                     case DynamicField::FILE:
                         $value .= '<input type="text" name="' .
-                            $field_name  . '" value="' .
+                            $field_name . '" value="' .
                             $field_value['field_val'] . '" />';
                         break;
                 }
index 5745f67dc620266d7a532bf758d662190d784eae..6d4aa13b7bb3814356a5ac5478acc0bb5343a722 100644 (file)
@@ -59,7 +59,7 @@ use Analog\Analog;
 
 class PdfAttendanceSheet extends Pdf
 {
-    const SHEET_FONT = self::FONT_SIZE-2;
+    const SHEET_FONT = self::FONT_SIZE - 2;
 
     public $doc_title = null;
     public $sheet_title = null;
@@ -147,7 +147,7 @@ class PdfAttendanceSheet extends Pdf
         // Set colors
         $this->SetDrawColor(160, 160, 160);
         $this->SetTextColor(0);
-        $this->SetFont(Pdf::FONT, '', Pdf::FONT_SIZE-2);
+        $this->SetFont(Pdf::FONT, '', Pdf::FONT_SIZE - 2);
     }
 
     /**
@@ -220,7 +220,7 @@ class PdfAttendanceSheet extends Pdf
                 if ($this->i18n->isRTL()) {
                     $ximg = $this->getPageWidth() - $x - $wlogo;
                 }
-                $this->Cell($wlogo+2, 16, '', ($this->i18n->isRTL() ? 'R' : 'L') . 'TB', 0);
+                $this->Cell($wlogo + 2, 16, '', ($this->i18n->isRTL() ? 'R' : 'L') . 'TB', 0);
                 $this->Image($p, $ximg, $y, $wlogo, $hlogo);
             } else {
                 $x = $this->getX() + 1;
index 84aa20830279d96c33eb0540aec7cbec916b67bb..2428eaa1cb76043c4631cd82c72cdcdb3e9571bb 100644 (file)
@@ -113,7 +113,7 @@ class PdfContribution extends Pdf
             $main_group = $member_groups[0]->getName();
             $group_list = '<ul>';
             foreach ($member_groups as $group) {
-                $group_list .= '<li>' . $group->getName()  . '</li>';
+                $group_list .= '<li>' . $group->getName() . '</li>';
             }
             $group_list .= '</ul>';
         }
index 2177b565b465553223b5ee0f6238811251077c7a..3d0070e944701620658bb3ad61329aea1014e12d 100644 (file)
@@ -191,19 +191,19 @@ class PdfMembersCards extends Pdf
      */
     public function drawCards($members)
     {
-        $nb_card=0;
+        $nb_card = 0;
         foreach ($members as $member) {
             // Detect page breaks
-            if ($nb_card % ($this->nbcol * $this->nbrow)==0) {
+            if ($nb_card%($this->nbcol*$this->nbrow) == 0) {
                 $this->AddPage();
             }
 
             // Compute card position on page
-            $col = $nb_card % $this->nbcol;
-            $row = ($nb_card/$this->nbcol) % $this->nbrow;
+            $col = $nb_card%$this->nbcol;
+            $row = ($nb_card/$this->nbcol)%$this->nbrow;
             // Set origin
-            $x0 = $this->xorigin + $col*(round($this->wi)+round($this->hspacing));
-            $y0 = $this->yorigin + $row*(round($this->he)+round($this->vspacing));
+            $x0 = $this->xorigin + $col*(round($this->wi) + round($this->hspacing));
+            $y0 = $this->yorigin + $row*(round($this->he) + round($this->vspacing));
             // Logo X position
             $xl = round($x0 + $this->wi - $this->wlogo);
             // Get data
@@ -289,7 +289,7 @@ class PdfMembersCards extends Pdf
 
             $xid = $x0 + $this->wi - $this->GetStringWidth($member->id, self::FONT, 'B', 8) - 0.2;
             $this->SetXY($xid, $y0 + 28);
-            $this->writeHTML('<strong>' . $member->id  . '</strong>', false, 0);
+            $this->writeHTML('<strong>' . $member->id . '</strong>', false, 0);
             $this->SetFontSize($this->year_font_size);
             $xan_cot = $xan_cot - 0.3;
             $this->SetXY($xan_cot, $y0 + $this->hlogo - 0.3);
index 31a179ef9a7467ddcb9a6101833757a85e24a005..65a42a72fe964d96604b7ffc0d2dccedfc2d71ae 100644 (file)
@@ -122,7 +122,7 @@ class PdfMembersLabels extends Pdf
         // Label heigth
         $this->lh = round($this->preferences->pref_etiq_vsize);
         // Line heigth
-        $this->line_h=round($this->lh/5);
+        $this->line_h = round($this->lh/5);
     }
 
     /**
@@ -134,20 +134,20 @@ class PdfMembersLabels extends Pdf
      */
     public function drawLabels($members)
     {
-        $nb_etiq=0;
+        $nb_etiq = 0;
         foreach ($members as $member) {
             // Detect page breaks
             $colsrows = $this->preferences->pref_etiq_cols
                 * $this->preferences->pref_etiq_rows;
-            if ($nb_etiq % $colsrows == 0) {
+            if ($nb_etiq%$colsrows == 0) {
                 $this->AddPage();
             }
             // Set font
             $this->SetFont(self::FONT, 'B', $this->preferences->pref_etiq_corps);
 
             // Compute label position
-            $col = $nb_etiq % $this->preferences->pref_etiq_cols;
-            $row = ($nb_etiq / $this->preferences->pref_etiq_cols)
+            $col = $nb_etiq%$this->preferences->pref_etiq_cols;
+            $row = ($nb_etiq/$this->preferences->pref_etiq_cols)
                 % $this->preferences->pref_etiq_rows;
             // Set label origin
             $x = $this->xorigin + $col*(
@@ -170,8 +170,7 @@ class PdfMembersLabels extends Pdf
             //calculte font size to display address and address continuation
             $max_text_size = $this->preferences->pref_etiq_hsize;
             $text = mb_strlen($member->address) > mb_strlen($member->address_continuation) ?
-                $member->address :
-                $member->address_continuation;
+                $member->address : $member->address_continuation;
             $this->fixSize(
                 $text,
                 $max_text_size,
index 5e385e72929a15c8392761a4938f5c8a1a739301..7f2f8f038cbd230e9da1bbb6df5653e4310b2da1 100644 (file)
@@ -98,7 +98,7 @@ class MembersNavigate
         }
 
         if (isset($this->session->filter_members)) {
-            $filters =  $this->session->filter_members;
+            $filters = $this->session->filter_members;
         } else {
             $filters = new MembersList();
         }
@@ -115,13 +115,13 @@ class MembersNavigate
                     $navigate = array(
                         'cur'  => $m['id_adh'],
                         'count' => count($ids),
-                        'pos' => $k+1
+                        'pos' => $k + 1
                     );
                     if ($k > 0) {
-                        $navigate['prev'] = $ids[$k-1]['id_adh'];
+                        $navigate['prev'] = $ids[$k - 1]['id_adh'];
                     }
-                    if ($k < count($ids)-1) {
-                        $navigate['next'] = $ids[$k+1]['id_adh'];
+                    if ($k < count($ids) - 1) {
+                        $navigate['next'] = $ids[$k + 1]['id_adh'];
                     }
                     break;
                 }
index 2285ae2de934c1d709163c179cd8263f45eafea0..2f03a02a4f4c27d3dea08342131755a665c8f9c1 100644 (file)
@@ -151,8 +151,8 @@ class Contributions
     private function buildSelect($fields, $count = false)
     {
         try {
-            $fieldsList = ( $fields != null )
-                            ? (( !is_array($fields) || count($fields) < 1 ) ? (array)'*'
+            $fieldsList = ($fields != null)
+                            ? ((!is_array($fields) || count($fields) < 1) ? (array)'*'
                             : implode(', ', $fields)) : (array)'*';
 
             $select = $this->zdb->select(self::TABLE, 'a');
index 341226bfa675c6adae2f617e98e7bff069a7ef22..9af798e04db5761c65e3c8154996bd8942ef97b3 100644 (file)
@@ -99,7 +99,7 @@ class DynamicFieldsSet
                 if (($perm == DynamicField::PERM_MANAGER &&
                         $access_level < Authentication::ACCESS_MANAGER) ||
                     ($perm == DynamicField::PERM_STAFF &&
-                         $access_level < Authentication::ACCESS_STAFF)   ||
+                         $access_level < Authentication::ACCESS_STAFF) ||
                     ($perm == DynamicField::PERM_ADMIN &&
                         $access_level < Authentication::ACCESS_ADMIN)
                 ) {
index 98dc350d67bee9c6fe3074b0eb04604a356f4956..77daf16dedc457f49a7363080190647ba99651c3 100644 (file)
@@ -210,8 +210,7 @@ class Groups
         global $zdb;
         try {
             $join_table = ($managed) ?
-                Group::GROUPSMANAGERS_TABLE :
-                Group::GROUPSUSERS_TABLE;
+                Group::GROUPSMANAGERS_TABLE : Group::GROUPSUSERS_TABLE;
 
             $select = $zdb->select(Group::TABLE, 'a');
             $select->join(
index d1d2daac5c971288bedb689e852e929eab60bb08..b3cf631069eb457133d49bc3f5c0ed36ff15ec0a 100644 (file)
@@ -310,7 +310,7 @@ class Members
                 foreach ($results as $member) {
                     $str_adh = $member->id_adh . ' (' . $member->nom_adh . ' ' .
                         $member->prenom_adh . ')';
-                    $infos .=  $str_adh . "\n";
+                    $infos .= $str_adh . "\n";
 
                     $p = new Picture($member->id_adh);
                     if ($p->hasPicture()) {
@@ -606,8 +606,8 @@ class Members
             if ($fields != null && is_array($fields) && !in_array('id_adh', $fields)) {
                 $fields[] = 'id_adh';
             }
-            $fieldsList = ( $fields != null )
-                            ? (( !is_array($fields) || count($fields) < 1 ) ? (array)'*'
+            $fieldsList = ($fields != null)
+                            ? ((!is_array($fields) || count($fields) < 1) ? (array)'*'
                             : $fields) : (array)'*';
 
             $select = $zdb->select(self::TABLE, 'a');
@@ -976,7 +976,7 @@ class Members
             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
             );
@@ -1016,19 +1016,19 @@ class Members
                         } else {
                             $sep = ', " ", ';
                             $pre = 'CONCAT(';
-                            $post=')';
+                            $post = ')';
                         }
                         //$sep = ( TYPE_DB === 'pgsql' ) ? " || ' ' || " : ', " ", ';
                         $select->where(
                             '(' .
                             $pre . 'LOWER(nom_adh)' . $sep .
                             'LOWER(prenom_adh)' . $sep .
-                            'LOWER(pseudo_adh)' . $post  . ' LIKE ' .
+                            'LOWER(pseudo_adh)' . $post . ' LIKE ' .
                             $token
                             . ' OR ' .
                             $pre . 'LOWER(prenom_adh)' . $sep .
                             'LOWER(nom_adh)' . $sep .
-                            'LOWER(pseudo_adh)' . $post  . ' LIKE ' .
+                            'LOWER(pseudo_adh)' . $post . ' LIKE ' .
                             $token
                             . ')'
                         );
@@ -1465,8 +1465,8 @@ class Members
                                 'dfc.field_id = ' . $k . ' AND ';
                             $field = 'field_val';
                             $qry .= 'LOWER(' . $prefix . $field . ') ' .
-                                $qop  . ' ' ;
-                            $select->where($qry . $zdb->platform->quoteValue('%' .strtolower($cd) . '%'));
+                                $qop . ' ';
+                            $select->where($qry . $zdb->platform->quoteValue('%' . strtolower($cd) . '%'));
                         }
                     }
                 }
@@ -1529,20 +1529,20 @@ class Members
 
                         if ($dyn_field && $dyn_field instanceof \Galette\DynamicFields\Boolean) {
                             if ($fs['search'] != 0) {
-                                $qry .= $prefix . $fs['field'] . $qop  . ' ' .
-                                    $fs['search'] ;
+                                $qry .= $prefix . $fs['field'] . $qop . ' ' .
+                                    $fs['search'];
                             } else {
                                 $qry .= $prefix . $fs['field'] . ' IS NULL';
                             }
                         } elseif (!strncmp($fs['field'], 'bool_', strlen('bool_'))) {
-                            $qry .= $prefix . $fs['field'] . $qop  . ' ' .
-                                $fs['search'] ;
+                            $qry .= $prefix . $fs['field'] . $qop . ' ' .
+                                $fs['search'];
                         } elseif ($fs['qry_op'] === AdvancedMembersList::OP_BEFORE
                             || $fs['qry_op'] === AdvancedMembersList::OP_AFTER
                         ) {
                             if ($prefix === 'a.') {
                                 //dates are OK in the main fields. no cast, just query!
-                                $qry .= $prefix . $fs['field'] . $qop  . ' ' .
+                                $qry .= $prefix . $fs['field'] . $qop . ' ' .
                                     $zdb->platform->quoteValue($fs['search']);
                             } else {
                                 //dynamic dates are stored in their localized format :/
@@ -1557,7 +1557,7 @@ class Members
                                     $qry .= 'STR_TO_DATE(' . $prefix . $fs['field'] . ', \'' . $store_fmt . '\') ';
                                 }
 
-                                $qry .= $qop  . ' ' .  $fs['search'] ;
+                                $qry .= $qop . ' ' . $fs['search'];
                             }
                         } elseif ($fs['field'] == 'status_label') {
                             $qry_pattern = '%p%field %op %value';
@@ -1578,7 +1578,7 @@ class Members
                             );
                         } else {
                             $qry .= 'LOWER(' . $prefix . $fs['field'] . ') ' .
-                                $qop  . ' ' . $zdb->platform->quoteValue($fs['search']);
+                                $qop . ' ' . $zdb->platform->quoteValue($fs['search']);
                         }
 
                         if ($fs['log_op'] === AdvancedMembersList::OP_AND) {
index e8798402c92c36aa3bed92d699f17e11461ff956..b2346f7bb89999c2a40a67670152daf947932dc8 100644 (file)
@@ -183,7 +183,7 @@ class PaymentTypes extends Repository
                 }
             }
 
-            if (count($missing) >0) {
+            if (count($missing) > 0) {
                 $this->zdb->connection->beginTransaction();
                 $this->insert($ent::TABLE, $missing);
                 Analog::log(
index ad00522c2cf57be46559dddfa8fcdf7c5ce8c58a..1267f4d15388a0e4c06166f679c0809b60d32b96 100644 (file)
@@ -132,8 +132,8 @@ class SavedSearches
     private function buildSelect($fields, $count = false)
     {
         try {
-            $fieldsList = ( $fields != null )
-                            ? (( !is_array($fields) || count($fields) < 1 ) ? (array)'*'
+            $fieldsList = ($fields != null)
+                            ? ((!is_array($fields) || count($fields) < 1) ? (array)'*'
                             : implode(', ', $fields)) : (array)'*';
 
             $select = $this->zdb->select(self::TABLE, 's');
index 7e7d96a8cb6def6b307c82f1dc306ee41dc6963f..0f000cdaa77b99e4e184c3a10906cc9f11e22ea7 100644 (file)
@@ -135,8 +135,8 @@ class Transactions
     private function buildSelect($fields, $count = false)
     {
         try {
-            $fieldsList = ( $fields != null )
-                            ? (( !is_array($fields) || count($fields) < 1 ) ? (array)'*'
+            $fieldsList = ($fields != null)
+                            ? ((!is_array($fields) || count($fields) < 1) ? (array)'*'
                             : implode(', ', $fields)) : (array)'*';
 
             $select = $this->zdb->select(self::TABLE, 't');
index f3b25c31eac4fee7b442b9e452c976aaddc359fa..d9f8d857d1ab84cff9a942e4f7d4389b40a7caec 100644 (file)
@@ -291,7 +291,7 @@ class FakeData
             }
         }
 
-        if ($count !=0 && $done != 0) {
+        if ($count != 0 && $done != 0) {
             if ($done === $count) {
                 $this->addSuccess(
                     str_replace('%count', $count, _T("%count groups created"))
@@ -364,7 +364,7 @@ class FakeData
             }
         }
 
-        if ($count !=0 && $done != 0) {
+        if ($count != 0 && $done != 0) {
             if ($done === $count) {
                 $this->addSuccess(
                     str_replace('%count', $count, _T("%count members created"))
@@ -411,7 +411,7 @@ class FakeData
             $this->status = array_keys($status->getList());
         }
 
-        $data= [
+        $data = [
             'nom_adh'           => $faker->lastName(),
             'prenom_adh'        => $faker->firstName(),
             'ville_adh'         => $faker->city(),
@@ -521,7 +521,7 @@ class FakeData
         }
 
         for ($i = 0; $i < $count; $i++) {
-            $data= [
+            $data = [
                 'trans_date'    => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now')->format(_T("Y-m-d")),
                 Adherent::PK    => $faker->randomElement($mids),
                 'trans_amount'  => $faker->numberBetween($min = 50, $max = 2000),
@@ -537,7 +537,7 @@ class FakeData
             }
         }
 
-        if ($count !=0 && $done != 0) {
+        if ($count != 0 && $done != 0) {
             if ($done === $count) {
                 $this->addSuccess(
                     str_replace('%count', $count, _T("%count transactions created"))
@@ -654,8 +654,7 @@ class FakeData
                 ]
             ),
             'info_cotis'            => ($this->seed !== null ?
-                                        'FAKER' . $this->seed :
-                                        $faker->optional($weight = 0.1)->realText($maxNbChars = 500)),
+                                        'FAKER' . $this->seed : $faker->optional($weight = 0.1)->realText($maxNbChars = 500)),
             'date_enreg'            => $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now')->format(_T("Y-m-d")),
             'date_debut_cotis'      => $begin_date->format(_T("Y-m-d")),
             'date_fin_cotis'        => $end_date->format(_T("Y-m-d"))
index 36ca0dbc4eef21878e4b363f030c01fca8a0612a..ed3edff4d2923c1529d6aeda7f926cba8c870489 100755 (executable)
 $args = array();
 $internal = false;
 
-if (defined('STDIN') ) {
+if (defined('STDIN')) {
     //we're called from command line
     $args = stream_get_contents(STDIN);
-} else if ( count($_POST) > 0 ) {
+} else if (count($_POST) > 0) {
     //we're called from HTTP POST
     $args = $_POST;
     //check if we're called from galette internal
-    if ( isset($_POST['galette_internal']) ) {
+    if (isset($_POST['galette_internal'])) {
         $internal = true;
         include_once 'includes/galette.inc.php';
         unset($_POST['galette_internal']);
@@ -57,25 +57,25 @@ if (defined('STDIN') ) {
     } else {
         echo 'Requested as HTTP POST with parameters:<br/>';
     }
-} else if ( count($_GET) > 0 ) {
+} else if (count($_GET) > 0) {
     //we're called from HTTP GET
     echo 'Requested as HTTP GET with parameters:<br/>';
     $args = $_GET;
 }
 
-if ( count($args) == 0 ) {
+if (count($args) == 0) {
     //we're called without arguments => exit.
     die('No arguments.');
 }
 
-if (defined('STDIN') ) {
+if (defined('STDIN')) {
     //a successfull script returns 0, we do not output anything
     $fp = fopen(__DIR__ . '/cache/galette_post_contrib_file.txt', 'w');
     fwrite($fp, $args);
     fclose($fp);
 } else {
     $json_args = json_decode($args);
-    foreach ( $json_args as $k=>$v ) {
+    foreach ($json_args as $k=>$v) {
         echo 'key: ' . $k . ' | value: ' . $v;
     }
 }
index 06c648b842634f68d48bddb0ca36ecb6375ebc46..4e9287e4892576f384faf82a5ef91db897025cec 100644 (file)
@@ -113,7 +113,7 @@ if ($install->isStepPassed(GaletteInstall::STEP_TYPE)) {
 
     $now = new \DateTime();
     $dbg_log_path = GALETTE_LOGS_PATH . 'galette_debug_' .
-        $now->format('Y-m-d')  . '.log';
+        $now->format('Y-m-d') . '.log';
     $galette_debug_log = LevelName::init(Handler\File::init($dbg_log_path));
 
     if (defined('GALETTE_SYS_LOG') && GALETTE_SYS_LOG === true) {
@@ -127,7 +127,7 @@ if ($install->isStepPassed(GaletteInstall::STEP_TYPE)) {
 
     Analog::handler(
         Handler\Multi::init(
-            array (
+            array(
                 Analog::NOTICE  => Handler\Threshold::init(
                     $galette_run_log,
                     GALETTE_LOG_LVL
@@ -203,7 +203,7 @@ if (isset($_POST['stepback_btn'])) {
     if ($_POST['install_adminpass'] == '') {
         $error_detected[] = _T("No password");
     }
-    if (! isset($_POST['install_passwdverified'])
+    if (!isset($_POST['install_passwdverified'])
         && strcmp(
             $_POST['install_adminpass'],
             $_POST['install_adminpass_verif']
@@ -319,7 +319,7 @@ if ($install->isCheckStep()) {
                     <li<?php if ($install->isDbStep()) echo ' class="current"'; ?>><?php echo _T("Database"); ?> - </li>
                     <li<?php if ($install->isDbCheckStep()) echo ' class="current"'; ?>><?php echo _T("Database access/permissions"); ?> - </li>
 <?php
-if ( $install->isUpgrade() ) {
+if ($install->isUpgrade()) {
     ?>
                     <li<?php if ($install->isVersionSelectionStep()) echo ' class="current"'; ?>><?php echo _T("Version selection"); ?> - </li>
                     <li<?php if ($install->isDbUpgradeStep()) echo ' class="current"'; ?>><?php echo _T("Database upgrade"); ?> - </li>
@@ -330,7 +330,7 @@ if ( $install->isUpgrade() ) {
     <?php
 }
 
-if ( !$install->isUpgrade() ) {
+if (!$install->isUpgrade()) {
     ?>
                     <li<?php if ($install->isAdminStep()) echo ' class="current"'; ?>><?php echo _T("Admin parameters"); ?> - </li>
     <?php