]> git.agnieray.net Git - galette.git/commitdiff
Switch to phpstan level 4
authorJohan Cwiklinski <johan@x-tnd.be>
Thu, 9 Nov 2023 15:19:45 +0000 (16:19 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 13 Nov 2023 18:59:10 +0000 (19:59 +0100)
Remove dead code

32 files changed:
galette/lib/Galette/Controllers/Crud/MailingsController.php
galette/lib/Galette/Controllers/Crud/MembersController.php
galette/lib/Galette/Controllers/CrudController.php
galette/lib/Galette/Controllers/HistoryController.php
galette/lib/Galette/Controllers/PluginsController.php
galette/lib/Galette/Core/History.php
galette/lib/Galette/Core/Install.php
galette/lib/Galette/Core/MailingHistory.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/DynamicFields/DynamicField.php
galette/lib/Galette/Entity/Adherent.php
galette/lib/Galette/Entity/Contribution.php
galette/lib/Galette/Entity/Group.php
galette/lib/Galette/Entity/ImportModel.php
galette/lib/Galette/Entity/PdfModel.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/IO/CsvIn.php
galette/lib/Galette/IO/CsvOut.php
galette/lib/Galette/Repository/Contributions.php
galette/lib/Galette/Repository/Members.php
galette/lib/Galette/Repository/Reminders.php
galette/lib/Galette/Repository/Repository.php
galette/lib/Galette/Repository/SavedSearches.php
galette/lib/Galette/Repository/Transactions.php
phpstan.neon

index 9177bd472fa4faf91aa58f15929aba7fec8fbb01..1a174ad5a0f4fda6e45d61259383ff6b5e8bbf02 100644 (file)
@@ -519,7 +519,6 @@ class MailingsController extends CrudController
     public function filter(Request $request, Response $response): Response
     {
         $post = $request->getParsedBody();
-        $error_detected = [];
 
         if ($this->session->filter_mailings !== null) {
             $filters = $this->session->filter_mailings;
@@ -561,16 +560,6 @@ class MailingsController extends CrudController
 
         $this->session->filter_mailings = $filters;
 
-        if (count($error_detected) > 0) {
-            //report errors
-            foreach ($error_detected as $error) {
-                $this->flash->addMessage(
-                    'error_detected',
-                    $error
-                );
-            }
-        }
-
         return $response
             ->withStatus(301)
             ->withHeader('Location', $this->routeparser->urlFor('mailings'));
index 23e3f9b124a5d5df52e3976afde555b8e84aef5d..fd424bbdf00dda4fe1b03b4af6600d9d8136c6ba 100644 (file)
@@ -669,13 +669,6 @@ class MembersController extends CrudController
         $fc = $this->fields_config;
         $fc->filterVisible($this->login, $fields);
 
-        //add status label search
-        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);
-        }
-
         //dynamic fields
         $member = new Adherent($this->zdb);
         $member
@@ -1432,7 +1425,6 @@ class MembersController extends CrudController
             );
 
         $success_detected = [];
-        $warning_detected = [];
         $error_detected = [];
 
         if ($this->isSelfMembership() && !isset($post[Adherent::PK])) {
@@ -1637,14 +1629,6 @@ class MembersController extends CrudController
                 }
             }
 
-            if (count($warning_detected) > 0) {
-                foreach ($warning_detected as $warning) {
-                    $this->flash->addMessage(
-                        'warning_detected',
-                        $warning
-                    );
-                }
-            }
             if (count($success_detected) > 0) {
                 foreach ($success_detected as $success) {
                     $this->flash->addMessage(
index 83089ac9e20648a864e15f960d291d71c147b363..c20806168dca922625ab75a8369d0c9868a683ae 100644 (file)
@@ -189,6 +189,7 @@ abstract class CrudController extends AbstractController
      */
     protected function getIdsToRemove(&$args, $post)
     {
+        /** @var  null|array|string $ids */
         $ids = null;
         if (isset($post['id'])) {
             $ids = $post['id'];
@@ -210,6 +211,7 @@ abstract class CrudController extends AbstractController
         }
 
         //add to $args if needed
+        //@phpstan-ignore-next-line
         if (is_array($ids)) {
             $args['ids'] = $ids;
         } elseif (!isset($args['id']) && $ids) {
index 5bf8b1a3b4a03e04673a36ef591c7ee888f05a0e..d24070748749e4a410fd445ed9377f81ec5fc282 100644 (file)
@@ -127,7 +127,6 @@ class HistoryController extends AbstractController
     public function historyFilter(Request $request, Response $response): Response
     {
         $post = $request->getParsedBody();
-        $error_detected = [];
 
         if ($this->session->filter_history !== null) {
             $filters = $this->session->filter_history;
@@ -164,16 +163,6 @@ class HistoryController extends AbstractController
 
         $this->session->filter_history = $filters;
 
-        if (count($error_detected) > 0) {
-            //report errors
-            foreach ($error_detected as $error) {
-                $this->flash->addMessage(
-                    'error_detected',
-                    $error
-                );
-            }
-        }
-
         return $response
             ->withStatus(301)
             ->withHeader('Location', $this->routeparser->urlFor('history'));
index 6354e7652b9541d372e18246941d8fabc9e3c6f6..f64840d55a07462085fe9e0ccd8b00179497dece 100644 (file)
@@ -176,19 +176,16 @@ class PluginsController extends AbstractController
         $error_detected = [];
 
         $plugid = $id;
-        $plugin = $this->plugins->getModules($plugid);
-
-        if ($plugin === null) {
+        if (!$this->plugins->moduleExists($plugid)) {
             Analog::log(
                 'Unable to load plugin `' . $plugid . '`!',
                 Analog::URGENT
             );
-            //FIXME: use proper error page
-            /*$notFound = $this->notFoundHandler;
-            return $notFound($request, $response);*/
             return $response->withStatus(404);
         }
 
+        $plugin = $this->plugins->getModules($plugid);
+
         $install = null;
         $mdplugin = md5($plugin['root']);
         if (
index 4448a597629a8a4c70bbb240342e45908e30d1ff..4ca3c1cb05d2c786cefa4522d5afbb0603e21955 100644 (file)
@@ -344,6 +344,7 @@ class History
                 );
             }
 
+            //@phpstan-ignore-next-line
             if ($this->filters->action_filter != null && $this->filters->action_filter != '0') {
                 $select->where->equalTo(
                     'action_log',
@@ -439,7 +440,7 @@ class History
      * 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
+     * @param mixed  $value a relevant value for the property
      *
      * @return void
      */
index 9aac05df4f0cd796c8b29327fc8b78d2b6e58f94..e7dc5a5d5661ab0a22fec46f81ea706513b4d2ce 100644 (file)
@@ -80,7 +80,6 @@ class Install
 
     protected $_step;
     private $_mode;
-    private $_version;
     private $_installed_version;
 
     private $_db_type;
@@ -106,7 +105,6 @@ class Install
     {
         $this->_step = self::STEP_CHECK;
         $this->_mode = null;
-        $this->_version = str_replace('v', '', GALETTE_VERSION);
         $this->_db_connected = false;
         $this->_db_prefix = null;
     }
@@ -1140,7 +1138,7 @@ define('PREFIX_DB', '" . $this->_db_prefix . "');
      *
      * @param I18n  $i18n  I18n
      * @param Db    $zdb   Database instance
-     * @param Login $login Loged in instance
+     * @param Login $login Logged in instance
      *
      * @return boolean
      */
@@ -1302,7 +1300,7 @@ define('PREFIX_DB', '" . $this->_db_prefix . "');
             if (isset($this->versions_mapper[$db_ver])) {
                 return $this->versions_mapper[$db_ver];
             } else {
-                return (string)$db_ver;
+                return $db_ver;
             }
         } catch (\LogicException $e) {
             return false;
index 3ef11adc19309a12542462bd06014afad1fdee78..49048d09ef65bd721e08488239d336d96c93875e 100644 (file)
@@ -472,51 +472,48 @@ class MailingHistory extends History
     public function removeEntries($ids, History $hist)
     {
         $list = array();
-        if (is_numeric($ids)) {
-            //we've got only one identifier
-            $list[] = $ids;
-        } else {
+        if (is_array($ids)) {
             $list = $ids;
+        } elseif (is_numeric($ids)) {
+            $list = [(int)$ids];
+        } else {
+            //not numeric and not an array: incorrect.
+            Analog::log(
+                'Asking to remove mailing entries, but without ' .
+                'providing an array or a single numeric value.',
+                Analog::WARNING
+            );
+            return false;
         }
 
-        if (is_array($list)) {
-            try {
-                foreach ($list as $id) {
-                    $mailing = new Mailing($this->preferences, [], $id);
-                    $mailing->removeAttachments();
-                }
+        try {
+            foreach ($list as $id) {
+                $mailing = new Mailing($this->preferences, [], $id);
+                $mailing->removeAttachments();
+            }
 
-                $this->zdb->connection->beginTransaction();
+            $this->zdb->connection->beginTransaction();
 
-                //delete members
-                $delete = $this->zdb->delete(self::TABLE);
-                $delete->where->in(self::PK, $list);
-                $this->zdb->execute($delete);
+            //delete members
+            $delete = $this->zdb->delete(self::TABLE);
+            $delete->where->in(self::PK, $list);
+            $this->zdb->execute($delete);
 
-                //commit all changes
-                $this->zdb->connection->commit();
+            //commit all changes
+            $this->zdb->connection->commit();
 
-                //add an history entry
-                $hist->add(
-                    _T("Delete mailing entries")
-                );
+            //add an history entry
+            $hist->add(
+                _T("Delete mailing entries")
+            );
 
-                return true;
-            } catch (Throwable $e) {
-                $this->zdb->connection->rollBack();
-                Analog::log(
-                    'Unable to delete selected mailing history entries |' .
-                    $e->getMessage(),
-                    Analog::ERROR
-                );
-                return false;
-            }
-        } else {
-            //not numeric and not an array: incorrect.
+            return true;
+        } catch (Throwable $e) {
+            $this->zdb->connection->rollBack();
             Analog::log(
-                'Asking to remove mailing entries, but without ' .
-                'providing an array or a single numeric value.',
-                Analog::WARNING
+                'Unable to delete selected mailing history entries |' .
+                $e->getMessage(),
+                Analog::ERROR
             );
             return false;
         }
index 27508f089deef87a559bbda2ac86b0ba97505b27..b0bcaef967dee8854d091c87af59c40cd5505718 100644 (file)
@@ -703,219 +703,222 @@ class Picture implements FileInterface
      *                         If null, we'll use the source image. Defaults to null
      * @param array  $cropping Cropping properties
      *
-     * @return void|false
+     * @return boolean
      */
     private function resizeImage($source, $ext, $dest = null, $cropping = null)
     {
         $class = get_class($this);
 
-        if (function_exists("gd_info")) {
-            $gdinfo = gd_info();
-            $h = $this->max_height;
-            $w = $this->max_width;
-            if ($dest == null) {
-                $dest = $source;
-            }
+        if (!function_exists("gd_info")) {
+            Analog::log(
+                '[' . $class . '] GD is not present - ' .
+                'pictures could not be resized!',
+                Analog::ERROR
+            );
+            return false;
+        }
 
-            switch (strtolower($ext)) {
-                case 'jpg':
-                    if (!$gdinfo['JPEG Support']) {
-                        Analog::log(
-                            '[' . $class . '] GD has no JPEG Support - ' .
-                            'pictures could not be resized!',
-                            Analog::ERROR
-                        );
-                        return false;
-                    }
-                    break;
-                case 'png':
-                    if (!$gdinfo['PNG Support']) {
-                        Analog::log(
-                            '[' . $class . '] GD has no PNG Support - ' .
-                            'pictures could not be resized!',
-                            Analog::ERROR
-                        );
-                        return false;
-                    }
-                    break;
-                case 'gif':
-                    if (!$gdinfo['GIF Create Support']) {
-                        Analog::log(
-                            '[' . $class . '] GD has no GIF Support - ' .
-                            'pictures could not be resized!',
-                            Analog::ERROR
-                        );
-                        return false;
-                    }
-                    break;
-                case 'webp':
-                    if (!$gdinfo['WebP Support']) {
-                        Analog::log(
-                            '[' . $class . '] GD has no WebP Support - ' .
-                            'pictures could not be resized!',
-                            Analog::ERROR
-                        );
-                        return false;
-                    }
-                    break;
+        $gdinfo = gd_info();
+        $h = $this->max_height;
+        $w = $this->max_width;
+        if ($dest == null) {
+            $dest = $source;
+        }
 
-                default:
+        switch (strtolower($ext)) {
+            case 'jpg':
+                if (!$gdinfo['JPEG Support']) {
+                    Analog::log(
+                        '[' . $class . '] GD has no JPEG Support - ' .
+                        'pictures could not be resized!',
+                        Analog::ERROR
+                    );
                     return false;
-            }
-
-            list($cur_width, $cur_height, $cur_type, $curattr)
-                = getimagesize($source);
-
-            $ratio = $cur_width / $cur_height;
-
-            // Define cropping variables if necessary.
-            $thumb_cropped = false;
-            // Cropping is based on the smallest side of the source in order to
-            // provide as less focusing options as possible if the source doesn't
-            // fit the final ratio (center, top, bottom, left, right).
-            $min_size = min($cur_width, $cur_height);
-            // Cropping dimensions.
-            $crop_width = $min_size;
-            $crop_height = $min_size;
-            // Cropping focus.
-            $crop_x = 0;
-            $crop_y = 0;
-            if (isset($cropping['ratio']) && isset($cropping['focus'])) {
-                // Calculate cropping dimensions
-                switch ($cropping['ratio']) {
-                    case 'portrait_ratio':
-                        // Calculate cropping dimensions
-                        if ($ratio < 1) {
-                            $crop_height = ceil($crop_width * 4 / 3);
-                        } else {
-                            $crop_width = ceil($crop_height * 3 / 4);
-                        }
-                        // Calculate resizing dimensions
-                        $w = ceil($h * 3 / 4);
-                        break;
-                    case 'landscape_ratio':
-                        // Calculate cropping dimensions
-                        if ($ratio > 1) {
-                            $crop_width = ceil($crop_height * 4 / 3);
-                        } else {
-                            $crop_height = ceil($crop_width * 3 / 4);
-                        }
-                        // Calculate resizing dimensions
-                        $h = ceil($w * 3 / 4);
-                        break;
                 }
-                // Calculate focus coordinates
-                switch ($cropping['focus']) {
-                    case 'center':
-                        if ($ratio > 1) {
-                            $crop_x = ceil(($cur_width - $crop_width) / 2);
-                        } elseif ($ratio == 1) {
-                            $crop_x = ceil(($cur_width - $crop_width) / 2);
-                            $crop_y = ceil(($cur_height - $crop_height) / 2);
-                        } else {
-                            $crop_y = ceil(($cur_height - $crop_height) / 2);
-                        }
-                        break;
-                    case 'top':
-                        $crop_x = ceil(($cur_width - $crop_width) / 2);
-                        break;
-                    case 'bottom':
-                        $crop_y = $cur_height - $crop_height;
-                        break;
-                    case 'right':
-                        $crop_x = $cur_width - $crop_width;
-                        break;
+                break;
+            case 'png':
+                if (!$gdinfo['PNG Support']) {
+                    Analog::log(
+                        '[' . $class . '] GD has no PNG Support - ' .
+                        'pictures could not be resized!',
+                        Analog::ERROR
+                    );
+                    return false;
                 }
-                // Cropped image.
-                $thumb_cropped = imagecreatetruecolor($crop_width, $crop_height);
-                // Cropped ratio.
-                $ratio = $crop_width / $crop_height;
-            // Otherwise, calculate image size according to the source's ratio.
-            } else {
-                if ($cur_width > $cur_height) {
-                    $h = round($w / $ratio);
-                } else {
-                    $w = round($h * $ratio);
+                break;
+            case 'gif':
+                if (!$gdinfo['GIF Create Support']) {
+                    Analog::log(
+                        '[' . $class . '] GD has no GIF Support - ' .
+                        'pictures could not be resized!',
+                        Analog::ERROR
+                    );
+                    return false;
                 }
-            }
+                break;
+            case 'webp':
+                if (!$gdinfo['WebP Support']) {
+                    Analog::log(
+                        '[' . $class . '] GD has no WebP Support - ' .
+                        'pictures could not be resized!',
+                        Analog::ERROR
+                    );
+                    return false;
+                }
+                break;
+
+            default:
+                return false;
+        }
 
-            // Resized image.
-            $thumb = imagecreatetruecolor($w, $h);
-
-            $image = false;
-            switch ($ext) {
-                case 'jpg':
-                    $image = imagecreatefromjpeg($source);
-                    // Crop
-                    if ($thumb_cropped !== false) {
-                        // First, crop.
-                        imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
-                        // Then, resize.
-                        imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
-                    // Resize
+        list($cur_width, $cur_height, $cur_type, $curattr)
+            = getimagesize($source);
+
+        $ratio = $cur_width / $cur_height;
+
+        // Define cropping variables if necessary.
+        $thumb_cropped = false;
+        // Cropping is based on the smallest side of the source in order to
+        // provide as less focusing options as possible if the source doesn't
+        // fit the final ratio (center, top, bottom, left, right).
+        $min_size = min($cur_width, $cur_height);
+        // Cropping dimensions.
+        $crop_width = $min_size;
+        $crop_height = $min_size;
+        // Cropping focus.
+        $crop_x = 0;
+        $crop_y = 0;
+        if (isset($cropping['ratio']) && isset($cropping['focus'])) {
+            // Calculate cropping dimensions
+            switch ($cropping['ratio']) {
+                case 'portrait_ratio':
+                    // Calculate cropping dimensions
+                    if ($ratio < 1) {
+                        $crop_height = ceil($crop_width * 4 / 3);
                     } else {
-                        imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
+                        $crop_width = ceil($crop_height * 3 / 4);
                     }
-                    imagejpeg($thumb, $dest);
+                    // Calculate resizing dimensions
+                    $w = ceil($h * 3 / 4);
                     break;
-                case 'png':
-                    $image = imagecreatefrompng($source);
-                    // Turn off alpha blending and set alpha flag. That prevent alpha
-                    // transparency to be saved as an arbitrary color (black in my tests)
-                    imagealphablending($image, false);
-                    imagesavealpha($image, true);
-                    imagealphablending($thumb, false);
-                    imagesavealpha($thumb, true);
-                    // Crop
-                    if ($thumb_cropped !== false) {
-                        imagealphablending($thumb_cropped, false);
-                        imagesavealpha($thumb_cropped, true);
-                        // First, crop.
-                        imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
-                        // Then, resize.
-                        imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
-                    // Resize
+                case 'landscape_ratio':
+                    // Calculate cropping dimensions
+                    if ($ratio > 1) {
+                        $crop_width = ceil($crop_height * 4 / 3);
                     } else {
-                        imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
+                        $crop_height = ceil($crop_width * 3 / 4);
                     }
-                    imagepng($thumb, $dest);
+                    // Calculate resizing dimensions
+                    $h = ceil($w * 3 / 4);
                     break;
-                case 'gif':
-                    $image = imagecreatefromgif($source);
-                    // Crop
-                    if ($thumb_cropped !== false) {
-                        // First, crop.
-                        imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
-                        // Then, resize.
-                        imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
-                    // Resize
+            }
+            // Calculate focus coordinates
+            switch ($cropping['focus']) {
+                case 'center':
+                    if ($ratio > 1) {
+                        $crop_x = ceil(($cur_width - $crop_width) / 2);
+                    } elseif ($ratio == 1) {
+                        $crop_x = ceil(($cur_width - $crop_width) / 2);
+                        $crop_y = ceil(($cur_height - $crop_height) / 2);
                     } else {
-                        imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
+                        $crop_y = ceil(($cur_height - $crop_height) / 2);
                     }
-                    imagegif($thumb, $dest);
                     break;
-                case 'webp':
-                    $image = imagecreatefromwebp($source);
-                    // Crop
-                    if ($thumb_cropped !== false) {
-                        // First, crop.
-                        imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
-                        // Then, resize.
-                        imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
-                    // Resize
-                    } else {
-                        imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
-                    }
-                    imagewebp($thumb, $dest);
+                case 'top':
+                    $crop_x = ceil(($cur_width - $crop_width) / 2);
+                    break;
+                case 'bottom':
+                    $crop_y = $cur_height - $crop_height;
+                    break;
+                case 'right':
+                    $crop_x = $cur_width - $crop_width;
                     break;
             }
+            // Cropped image.
+            $thumb_cropped = imagecreatetruecolor($crop_width, $crop_height);
+            // Cropped ratio.
+            $ratio = $crop_width / $crop_height;
+        // Otherwise, calculate image size according to the source's ratio.
         } else {
-            Analog::log(
-                '[' . $class . '] GD is not present - ' .
-                'pictures could not be resized!',
-                Analog::ERROR
-            );
+            if ($cur_width > $cur_height) {
+                $h = round($w / $ratio);
+            } else {
+                $w = round($h * $ratio);
+            }
+        }
+
+        // Resized image.
+        $thumb = imagecreatetruecolor($w, $h);
+
+        $image = false;
+        switch ($ext) {
+            case 'jpg':
+                $image = imagecreatefromjpeg($source);
+                // Crop
+                if ($thumb_cropped !== false) {
+                    // First, crop.
+                    imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
+                    // Then, resize.
+                    imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
+                // Resize
+                } else {
+                    imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
+                }
+                imagejpeg($thumb, $dest);
+                break;
+            case 'png':
+                $image = imagecreatefrompng($source);
+                // Turn off alpha blending and set alpha flag. That prevent alpha
+                // transparency to be saved as an arbitrary color (black in my tests)
+                imagealphablending($image, false);
+                imagesavealpha($image, true);
+                imagealphablending($thumb, false);
+                imagesavealpha($thumb, true);
+                // Crop
+                if ($thumb_cropped !== false) {
+                    imagealphablending($thumb_cropped, false);
+                    imagesavealpha($thumb_cropped, true);
+                    // First, crop.
+                    imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
+                    // Then, resize.
+                    imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
+                // Resize
+                } else {
+                    imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
+                }
+                imagepng($thumb, $dest);
+                break;
+            case 'gif':
+                $image = imagecreatefromgif($source);
+                // Crop
+                if ($thumb_cropped !== false) {
+                    // First, crop.
+                    imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
+                    // Then, resize.
+                    imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
+                // Resize
+                } else {
+                    imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
+                }
+                imagegif($thumb, $dest);
+                break;
+            case 'webp':
+                $image = imagecreatefromwebp($source);
+                // Crop
+                if ($thumb_cropped !== false) {
+                    // First, crop.
+                    imagecopyresampled($thumb_cropped, $image, 0, 0, $crop_x, $crop_y, $cur_width, $cur_height, $cur_width, $cur_height);
+                    // Then, resize.
+                    imagecopyresampled($thumb, $thumb_cropped, 0, 0, 0, 0, $w, $h, $crop_width, $crop_height);
+                // Resize
+                } else {
+                    imagecopyresampled($thumb, $image, 0, 0, 0, 0, $w, $h, $cur_width, $cur_height);
+                }
+                imagewebp($thumb, $dest);
+                break;
         }
+
+        return true;
     }
 
     /**
index 1c6177a0764ceceac856a0b3f52fa40e7349ce9f..26ca0dbb131d15f4abd0e8e2d5ceecc1ca0a5c0c 100644 (file)
@@ -53,8 +53,6 @@ use Laminas\Db\Adapter\Adapter;
  */
 class PluginInstall extends Install
 {
-    private $versions_mapper = [];
-
     /**
      * Main constructor
      */
index 1d993d79f12cd4a436fa5f69224a8b5899538e9d..c9620bf82f3d5796ed5acf8f2568613c3e55a62f 100644 (file)
@@ -192,15 +192,15 @@ class Plugins
      * <var>$priority</var> is an integer. Modules are sorted by priority and name.
      * Lowest priority comes first.
      *
-     * @param string  $name     Module name
-     * @param string  $desc     Module description
-     * @param string  $author   Module author name
-     * @param string  $version  Module version
-     * @param string  $compver  Galette version compatibility
-     * @param string  $route    Module route name
-     * @param string  $date     Module release date
-     * @param string  $acls     Module routes ACLs
-     * @param integer $priority Module priority
+     * @param string   $name     Module name
+     * @param string   $desc     Module description
+     * @param string   $author   Module author name
+     * @param string   $version  Module version
+     * @param string   $compver  Galette version compatibility
+     * @param string   $route    Module route name
+     * @param string   $date     Module release date
+     * @param string   $acls     Module routes ACLs
+     * @param ?integer $priority Module priority
      *
      * @return void
      */
index b789eb8776064c5d78103952b2f82bcb4e48f4fe..504486573f499a55462d0fddeeb65456c595d031 100644 (file)
@@ -337,7 +337,7 @@ class Preferences
      * Check if all fields referenced in the default array does exists,
      * create them if not
      *
-     * @return void|false
+     * @return boolean
      */
     private function checkUpdate()
     {
@@ -392,6 +392,8 @@ class Preferences
                 Analog::INFO
             );
         }
+
+        return true;
     }
 
     /**
@@ -1041,7 +1043,7 @@ class Preferences
      * 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
+     * @param mixed  $value a relevant value for the property
      *
      * @return void
      */
index edbf9f085dbab694811dcb34d8e99a082b260f5c..b63c24f387d5632396fadbca56618565f3c6e3e5 100644 (file)
@@ -608,7 +608,7 @@ abstract class DynamicField
 
         if (
             (!isset($values['field_name']) || $values['field_name'] == '')
-            && get_class($this) != '\Galette\DynamicField\Separator'
+            && !$this instanceof Separator
         ) {
             $this->errors[] = _T('Missing required field name!');
         } else {
index 916c59cc305b2d584c556616ff6cdb81c12138ab..9b844fc231ac148872596412f6bb271251f5e888 100644 (file)
@@ -1316,30 +1316,29 @@ class Adherent
                     $this->errors[] = _T("- Non-valid E-Mail address!") .
                         ' (' . $this->getFieldLabel($field) . ')';
                 }
-                if ($field == 'email_adh') {
-                    try {
-                        $select = $this->zdb->select(self::TABLE);
-                        $select->columns(
-                            array(self::PK)
-                        )->where(array('email_adh' => $value));
-                        if (!empty($this->_id)) {
-                            $select->where->notEqualTo(
-                                self::PK,
-                                $this->_id
-                            );
-                        }
 
-                        $results = $this->zdb->execute($select);
-                        if ($results->count() !== 0) {
-                            $this->errors[] = _T("- This E-Mail address is already used by another member!");
-                        }
-                    } catch (Throwable $e) {
-                        Analog::log(
-                            'An error occurred checking member email uniqueness.',
-                            Analog::ERROR
+                try {
+                    $select = $this->zdb->select(self::TABLE);
+                    $select->columns(
+                        array(self::PK)
+                    )->where(array('email_adh' => $value));
+                    if (!empty($this->_id)) {
+                        $select->where->notEqualTo(
+                            self::PK,
+                            $this->_id
                         );
-                        $this->errors[] = _T("An error has occurred while looking if login already exists.");
                     }
+
+                    $results = $this->zdb->execute($select);
+                    if ($results->count() !== 0) {
+                        $this->errors[] = _T("- This E-Mail address is already used by another member!");
+                    }
+                } catch (Throwable $e) {
+                    Analog::log(
+                        'An error occurred checking member email uniqueness.',
+                        Analog::ERROR
+                    );
+                    $this->errors[] = _T("An error has occurred while looking if login already exists.");
                 }
                 break;
             case 'login_adh':
index 8017296954d0b5df16bc4ab81f3b352f2fa3e0fd..6998e91bffca4f7b2f7391489e3f0179f87c5106 100644 (file)
@@ -698,11 +698,6 @@ class Contribution
                     );
                 }
 
-                if ($edit === false) {
-                    throw new \Exception(
-                        'An error occurred updating contribution # ' . $this->_id . '!'
-                    );
-                }
                 $event = 'contribution.edit';
             }
             //update deadline
@@ -1482,7 +1477,7 @@ class Contribution
         }
 
         //admin and staff users can edit, as well as member itself
-        if (!$this->id || $this->id && $login->id == $this->_member || $login->isAdmin() || $login->isStaff()) {
+        if (!$this->id || $login->id == $this->_member || $login->isAdmin() || $login->isStaff()) {
             return true;
         }
 
index f9be6d97d8654843a26a6ba569665d708065938f..cd57d9bdc0bf8519d6fd2641167c7b7103174ab2 100644 (file)
@@ -689,6 +689,7 @@ class Group
             }
         } while ($group = $group->getParentGroup());
 
+        //@phpstan-ignore-next-line
         return true;
     }
 
index 6c80885b20be065765d1918366033229de8c35aa..a00eab056a7884c5aaa0744e89f5392e45c2f322 100644 (file)
@@ -119,19 +119,15 @@ class ImportModel
     public function remove(Db $zdb)
     {
         try {
-            $result = $zdb->db->query(
+            $zdb->db->query(
                 'TRUNCATE TABLE ' . PREFIX_DB . self::TABLE,
                 Adapter::QUERY_MODE_EXECUTE
             );
 
-            if ($result) {
-                $this->id = null;
-                $this->fields = null;
-                $this->creation_date = null;
-                return true;
-            }
-
-            return false;
+            $this->id = null;
+            $this->fields = null;
+            $this->creation_date = null;
+            return true;
         } catch (Throwable $e) {
             Analog::log(
                 'Unable to remove import model ' . $e->getMessage(),
@@ -194,7 +190,7 @@ class ImportModel
     /**
      * Get fields
      *
-     * @return array
+     * @return ?array
      */
     public function getFields()
     {
index b61859d4c19360ac0cab3161a1fc1a2c182988ca..5e801539782815efad0665d741315b502c3eef95 100644 (file)
@@ -217,11 +217,13 @@ abstract class PdfModel
     public function store()
     {
         $title = $this->title;
+        //@phpstan-ignore-next-line
         if ($title === null || trim($title) === '') {
             $title = new Expression('NULL');
         }
 
         $subtitle = $this->subtitle;
+        //@phpstan-ignore-next-line
         if ($subtitle === null || trim($subtitle) === '') {
             $subtitle = new Expression('NULL');
         }
index 94a5fb36fa39d8635b0dc1855ad638879e9d928e..563c737287a280634d7db10fa6c68d0bbb811d9c 100644 (file)
@@ -722,7 +722,7 @@ class Transaction
         }
 
         //admin and staff users can edit, as well as member itself
-        if (!$this->id || $this->id && $login->id == $this->_member || $login->isAdmin() || $login->isStaff()) {
+        if (!$this->id || $login->id == $this->_member || $login->isAdmin() || $login->isStaff()) {
             return true;
         }
 
index d14804824e13ade1296d981112375276d45013f8..d1baec5e8a340cefb767de62c9a52e08a6876e6b 100644 (file)
@@ -419,7 +419,7 @@ class AdvancedMembersList extends MembersList
      * 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
+     * @param mixed  $value a relevant value for the property
      *
      * @return void
      */
index b7b0263bcb30e6fa2a8218fa9341e4afef2384a5..022429a510b0c8e69894e115eda380d8338cb1ae 100644 (file)
@@ -240,7 +240,7 @@ class ContributionsList extends Pagination
      * 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
+     * @param mixed  $value a relevant value for the property
      *
      * @return void
      */
index d41cc60d2cf8a7b66599a546d627e1bc398f0331..975b252359dfa15b2d896ceb04f9145d343b2de9 100644 (file)
@@ -199,7 +199,7 @@ class HistoryList extends Pagination
      * 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
+     * @param mixed  $value a relevant value for the property
      *
      * @return void
      */
index e63a31f15651a67bd47d679551958a517140e337..3650f0b2994e4f2aea39d3c02e8ceffc422a4c70 100644 (file)
@@ -194,7 +194,7 @@ class MailingsList extends Pagination
      * 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
+     * @param mixed  $value a relevant value for the property
      *
      * @return void
      */
index dec852ea1bdb0fa7a86fc3ab7eceb70800de34a5..c8dd532aeddf9350ad42571573233bcfe21efb63 100644 (file)
@@ -422,6 +422,7 @@ class CsvIn extends Csv implements FileInterface
                 $member->dynamicsValidate($dfields);
                 $errors = $member->getErrors();
                 if (count($errors) > $errcnt) {
+                    //@phpstan-ignore-next-line
                     $lcnt = ($errcnt > 0 ? $errcnt - 1 : 0);
                     $cnt_err = count($errors);
                     for ($i = $lcnt; $i < $cnt_err; ++$i) {
index 9eb339bfe9e7d9d817b8ae31a23e4a5e8378ae39..7835d8aea8b9ae417831f0738ab555cd5ea78ca7 100644 (file)
@@ -82,7 +82,7 @@ class CsvOut extends Csv
      * @param string         $separator The CSV separator (either '\t', ';' or ','
      *                                  are accepted)
      * @param string         $quote     how does fields should be quoted
-     * @param bool           $titles    does export shows column titles or not.
+     * @param array|false    $titles    does export shows column titles or not.
      *                                  Defaults to false.
      * @param resource|false $file      export to a file on disk. A file pointer
      *                                  should be passed here. Defaults to false.
@@ -115,7 +115,7 @@ class CsvOut extends Csv
         $this->current_line = 0;
 
         $fields = array();
-        if ($titles && !is_array($titles)) {
+        if (!is_array($titles)) {
             $row = $results[0];
             foreach (array_keys((array)$row) as $field) {
                 $fields[] = $this->quote . str_replace(
@@ -125,7 +125,7 @@ class CsvOut extends Csv
                 ) . $this->quote;
             }
             $this->result .= implode($this->separator, $fields) . self::NEWLINE;
-        } elseif ($titles && is_array($titles) && count($titles) > 1) {
+        } elseif (count($titles) > 1) {
             foreach ($titles as $field) {
                 $field = str_replace(
                     array(':', '&nbsp;'),
@@ -321,7 +321,7 @@ class CsvOut extends Csv
                 );
                 return self::FILE_NOT_WRITABLE;
             }
-            return $export['filename'];
+            return (string)$export['filename'];
         } catch (Throwable $e) {
             Analog::log(
                 'An error occurred while exporting | ' . $e->getMessage(),
@@ -406,13 +406,13 @@ class CsvOut extends Csv
      *
      * @param string $id export's id to run
      *
-     * @return string filename used
+     * @return ?string filename used
      */
     public function runParametedExport($id)
     {
         //try first to run from YAML configuration file
         $run = $this->runYamlParametedExport($id);
-        if ($run !== null) {
+        if ($run !== null && $run !== false) {
             return $run;
         }
 
@@ -420,5 +420,7 @@ class CsvOut extends Csv
         if (file_exists($this->legacy_parameted_file)) {
             return $this->runXmlParametedExport($id);
         }
+
+        return null;
     }
 }
index f820e7f16b153292e7522606f7ae20651c169909..df4afad097821f594b0cf1db581144b7c17fcc30 100644 (file)
@@ -176,18 +176,20 @@ class Contributions
     /**
      * Builds the SELECT statement
      *
-     * @param array $fields fields list to retrieve
-     * @param bool  $count  true if we want to count members
-     *                      (not applicable from static calls), defaults to false
+     * @param ?array $fields fields list to retrieve
+     * @param bool   $count  true if we want to count members
+     *                       (not applicable from static calls), defaults to false
      *
-     * @return string SELECT statement
+     * @return Select SELECT statement
      */
-    private function buildSelect($fields, $count = false)
+    private function buildSelect(?array $fields, bool $count = false): Select
     {
         try {
-            $fieldsList = ($fields != null)
-                            ? ((!is_array($fields) || count($fields) < 1) ? (array)'*'
-                            : implode(', ', $fields)) : (array)'*';
+            $fieldsList = ['*'];
+            if (is_array($fields) && count($fields)) {
+                $fieldsList = $fields;
+            }
+
 
             $select = $this->zdb->select(self::TABLE, 'a');
             $select->columns($fieldsList);
@@ -499,50 +501,10 @@ class Contributions
     public function remove($ids, History $hist, $transaction = true)
     {
         $list = array();
-        if (is_numeric($ids)) {
-            //we've got only one identifier
-            $list[] = $ids;
-        } else {
+        if (is_array($ids)) {
             $list = $ids;
-        }
-
-        if (is_array($list)) {
-            try {
-                if ($transaction) {
-                    $this->zdb->connection->beginTransaction();
-                }
-                $select = $this->zdb->select(self::TABLE);
-                $select->where->in(self::PK, $list);
-                $contributions = $this->zdb->execute($select);
-                foreach ($contributions as $contribution) {
-                    $c = new Contribution($this->zdb, $this->login, $contribution);
-                    $res = $c->remove(false);
-                    if ($res === false) {
-                        throw new \Exception();
-                    }
-                }
-                if ($transaction) {
-                    $this->zdb->connection->commit();
-                }
-                $hist->add(
-                    str_replace(
-                        '%list',
-                        print_r($list, true),
-                        _T("Contributions deleted (%list)")
-                    )
-                );
-                return true;
-            } catch (Throwable $e) {
-                if ($transaction) {
-                    $this->zdb->connection->rollBack();
-                }
-                Analog::log(
-                    'An error occurred trying to remove contributions | ' .
-                    $e->getMessage(),
-                    Analog::ERROR
-                );
-                throw $e;
-            }
+        } elseif (is_numeric($ids)) {
+            $list = [(int)$ids];
         } else {
             //not numeric and not an array: incorrect.
             Analog::log(
@@ -551,5 +513,42 @@ class Contributions
             );
             return false;
         }
+
+        try {
+            if ($transaction) {
+                $this->zdb->connection->beginTransaction();
+            }
+            $select = $this->zdb->select(self::TABLE);
+            $select->where->in(self::PK, $list);
+            $contributions = $this->zdb->execute($select);
+            foreach ($contributions as $contribution) {
+                $c = new Contribution($this->zdb, $this->login, $contribution);
+                $res = $c->remove(false);
+                if ($res === false) {
+                    throw new \Exception();
+                }
+            }
+            if ($transaction) {
+                $this->zdb->connection->commit();
+            }
+            $hist->add(
+                str_replace(
+                    '%list',
+                    print_r($list, true),
+                    _T("Contributions deleted (%list)")
+                )
+            );
+            return true;
+        } catch (Throwable $e) {
+            if ($transaction) {
+                $this->zdb->connection->rollBack();
+            }
+            Analog::log(
+                'An error occurred trying to remove contributions | ' .
+                $e->getMessage(),
+                Analog::ERROR
+            );
+            throw $e;
+        }
     }
 }
index 5aec669a673c1016efd5dfeaa47fcd6355f3517e..779161b2713d4f1afbd81bbeef6f4c2a4526a738 100644 (file)
@@ -589,11 +589,11 @@ class Members
     /**
      * Builds the SELECT statement
      *
-     * @param int   $mode   the current mode (see self::SHOW_*)
-     * @param array $fields fields list to retrieve
-     * @param bool  $photos true if we want to get only members with photos
-     *                      Default to false, only relevant for SHOW_PUBLIC_LIST
-     * @param bool  $count  true if we want to count members, defaults to false
+     * @param int    $mode   the current mode (see self::SHOW_*)
+     * @param ?array $fields fields list to retrieve
+     * @param bool   $photos true if we want to get only members with photos
+     *                       Default to false, only relevant for SHOW_PUBLIC_LIST
+     * @param bool   $count  true if we want to count members, defaults to false
      *
      * @return Select SELECT statement
      */
@@ -605,9 +605,11 @@ 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)'*'
-                            : $fields) : (array)'*';
+
+            $fieldsList = ['*'];
+            if (is_array($fields) && count($fields)) {
+                $fieldsList = $fields;
+            }
 
             $select = $zdb->select(self::TABLE, 'a');
 
@@ -974,7 +976,7 @@ class Members
      * provided fields list (those that are SELECT'ed).
      *
      * @param string $field_name Field name to order by
-     * @param array  $fields     SELECTE'ed fields
+     * @param ?array $fields     SELECTE'ed fields
      *
      * @return boolean
      */
@@ -1514,23 +1516,6 @@ class Members
 
                         $qry .= $qop . ' ' . $fs['search'];
                     }
-                } elseif ($fs['field'] == 'status_label') {
-                    $qry_pattern = '%p%field %op %value';
-                    $qry .= str_replace(
-                        [
-                            '%p',
-                            '%field',
-                            '%op',
-                            '%value'
-                        ],
-                        [
-                            'status.',
-                            'libelle_statut',
-                            $qop,
-                            $zdb->platform->quoteValue($fs['search'])
-                        ],
-                        $qry_pattern
-                    );
                 } else {
                     $field = $prefix . $fs['field'];
                     if ($zdb->isPostgres()) {
index 0f44f8ca222fd0147b335ce536a530e700d03607..30ec5552511df84aa928af84102917a411e02d1d 100644 (file)
@@ -83,7 +83,7 @@ class Reminders
      * Load reminders
      *
      * @param Db      $zdb    Database instance
-     * @param string  $type   Reminder type
+     * @param integer $type   Reminder type
      * @param boolean $nomail Get reminders for members who do not have email address
      *
      * @return void
index 1d70b94c97d0621f53570c7847901da9898b1083..1b0dfb11e5c97f613ab44956ca39c40f02a0faa7 100644 (file)
@@ -7,7 +7,7 @@
  *
  * PHP version 5
  *
- * Copyright © 2013-2014 The Galette Team
+ * Copyright © 2013-2023 The Galette Team
  *
  * This file is part of Galette (http://galette.tuxfamily.org).
  *
@@ -28,7 +28,7 @@
  * @package   Galette
  *
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2013-2014 The Galette Team
+ * @copyright 2013-2023 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     Available since 0.7.5dev - 2013-02-26
@@ -48,7 +48,7 @@ use Galette\Core\Login;
  * @name      Repository
  * @package   Galette
  * @author    Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2013-2014 The Galette Team
+ * @copyright 2013-2023 The Galette Team
  * @license   http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
  * @link      http://galette.tuxfamily.org
  * @since     Available since 0.7.5dev - 2013-02-26
@@ -193,7 +193,7 @@ abstract class Repository
      * provided fields list (those that are SELECT'ed).
      *
      * @param string $field_name Field name to order by
-     * @param array  $fields     SELECTE'ed fields
+     * @param ?array $fields     SELECTE'ed fields
      *
      * @return boolean
      */
index 49618d47e07049ea9523b400e1ca1c59e5a9d0cc..ce4df5bb4834874cbebf81b489d4484090551a73 100644 (file)
@@ -129,18 +129,19 @@ class SavedSearches
     /**
      * Builds the SELECT statement
      *
-     * @param array $fields fields list to retrieve
-     * @param bool  $count  true if we want to count members
-     *                      (not applicable from static calls), defaults to false
+     * @param ?array $fields fields list to retrieve
+     * @param bool   $count  true if we want to count members
+     *                       (not applicable from static calls), defaults to false
      *
      * @return Select SELECT statement
      */
-    private function buildSelect($fields, $count = false)
+    private function buildSelect(?array $fields, bool $count = false): Select
     {
         try {
-            $fieldsList = ($fields != null)
-                            ? ((!is_array($fields) || count($fields) < 1) ? (array)'*'
-                            : implode(', ', $fields)) : (array)'*';
+            $fieldsList = ['*'];
+            if ($fields !== null && count($fields)) {
+                $fieldsList = $fields;
+            }
 
             $select = $this->zdb->select(self::TABLE, 's');
             $select->columns($fieldsList);
index c0165f1d9027fef3caff6fe1bdaaa7ed17233610..332c1e97c71933ef622ebb2c8d17b1e651849080 100644 (file)
@@ -94,13 +94,13 @@ class Transactions
      *
      * @param bool    $as_trans return the results as an array of
      *                          Transaction object.
-     * @param array   $fields   field(s) name(s) to get. Should be a string or
+     * @param ?array  $fields   field(s) name(s) to get. Should be a string or
      *                          an array. If null, all fields will be returned
      * @param boolean $count    true if we want to count members
      *
      * @return Transaction[]|ArrayObject
      */
-    public function getList($as_trans = false, $fields = null, $count = true)
+    public function getList(bool $as_trans = false, ?array $fields = null, bool $count = true): array|ArrayObject
     {
         try {
             $select = $this->buildSelect($fields, $count);
@@ -129,13 +129,13 @@ class Transactions
     /**
      * Builds the SELECT statement
      *
-     * @param array $fields fields list to retrieve
-     * @param bool  $count  true if we want to count members
-     *                      (not applicable from static calls), defaults to false
+     * @param ?array $fields fields list to retrieve
+     * @param bool   $count  true if we want to count members
+     *                       (not applicable from static calls), defaults to false
      *
      * @return Select SELECT statement
      */
-    private function buildSelect($fields, $count = false)
+    private function buildSelect(?array $fields, bool $count = false): Select
     {
         try {
             $select = $this->zdb->select(self::TABLE, 't');
index 31b15619af966b81db288b7c9909367f667ea5bc..8fe578f0cb531107d46cca498e880ca62485eea7 100644 (file)
@@ -1,7 +1,7 @@
 parameters:
     parallel:
         maximumNumberOfProcesses: 2
-    level: 3
+    level: 4
     paths:
         - galette/lib/
     scanFiles:
@@ -11,6 +11,8 @@ parameters:
         - galette/config/galette_tcpdf_config.php
     scanDirectories:
         - galette/includes/
+    dynamicConstantNames:
+        - GALETTE_NIGHTLY
     ignoreErrors:
         - '/Instantiated class XHProfRuns_Default not found/'
         - '/Attribute class .*\\Inject does not exist./'