]> git.agnieray.net Git - galette.git/commitdiff
Switch to phpstan level 5
authorJohan Cwiklinski <johan@x-tnd.be>
Fri, 8 Dec 2023 07:18:27 +0000 (08:18 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Wed, 20 Dec 2023 19:54:26 +0000 (20:54 +0100)
36 files changed:
galette/lib/Galette/Common/ClassLoader.php
galette/lib/Galette/Controllers/AdminToolsController.php
galette/lib/Galette/Controllers/AuthController.php
galette/lib/Galette/Controllers/Crud/ContributionsController.php
galette/lib/Galette/Controllers/Crud/DynamicFieldsController.php
galette/lib/Galette/Controllers/Crud/GroupsController.php
galette/lib/Galette/Controllers/Crud/MembersController.php
galette/lib/Galette/Controllers/Crud/PaymentTypeController.php
galette/lib/Galette/Controllers/Crud/SavedSearchesController.php
galette/lib/Galette/Controllers/Crud/TitlesController.php
galette/lib/Galette/Controllers/Crud/TransactionsController.php
galette/lib/Galette/Controllers/PdfController.php
galette/lib/Galette/Core/Db.php
galette/lib/Galette/Core/I18n.php
galette/lib/Galette/Core/Install.php
galette/lib/Galette/Core/MailingHistory.php
galette/lib/Galette/Core/Pagination.php
galette/lib/Galette/Core/Picture.php
galette/lib/Galette/Core/Plugins.php
galette/lib/Galette/Core/Preferences.php
galette/lib/Galette/Entity/Adherent.php
galette/lib/Galette/Entity/ContributionsTypes.php
galette/lib/Galette/Features/Dynamics.php
galette/lib/Galette/Filters/ContributionsList.php
galette/lib/Galette/Filters/HistoryList.php
galette/lib/Galette/Filters/MailingsList.php
galette/lib/Galette/Filters/TransactionsList.php
galette/lib/Galette/IO/CsvOut.php
galette/lib/Galette/IO/FileTrait.php
galette/lib/Galette/IO/Pdf.php
galette/lib/Galette/IO/PdfAttendanceSheet.php
galette/lib/Galette/IO/PdfGroups.php
galette/lib/Galette/IO/PdfMembersCards.php
galette/lib/Galette/IO/PdfMembersLabels.php
galette/lib/Galette/Repository/Members.php
phpstan.neon

index a680fe11fa651e7b6b9456762cd759e45e63809b..e427fc74f5a2951ea39395ef3c71809da828f54a 100644 (file)
@@ -160,7 +160,9 @@ class ClassLoader
      */
     public function register()
     {
-        spl_autoload_register(array($this, 'loadClass'));
+        spl_autoload_register(function (string $class): void {
+            $this->loadClass($class);
+        });
     }
 
     /**
@@ -180,7 +182,7 @@ class ClassLoader
      *
      * @return boolean TRUE if the class has been successfully loaded, FALSE otherwise.
      */
-    public function loadClass($className)
+    public function loadClass($className): bool
     {
         if ($this->namespace !== null && strpos($className, $this->namespace . $this->namespaceSeparator) !== 0) {
             return false;
index 5186c326f2f6703c8ef213022e6c5857a7e15a88..bbd6dcb3c86c34bb30a2c85a6c5f9fd0370814b8 100644 (file)
@@ -147,7 +147,7 @@ class AdminToolsController extends AbstractController
             if ($res === true) {
                 $success_detected[] = str_replace(
                     '%i',
-                    $members->getCount(),
+                    (string)$members->getCount(),
                     _T("Logins and passwords have been successfully filled (%i processed).")
                 );
             } else {
index e812ea18662998d3d6713134e282657566ebb869..6cddaf9b61265813ea6f393d06a5a80ad4e7b0fa 100644 (file)
@@ -201,7 +201,7 @@ class AuthController extends AbstractController
         } else {
             $msg = str_replace(
                 '%id',
-                $id,
+                (string)$id,
                 _T("Unable to impersonate as %id")
             );
             $this->flash->addMessage(
@@ -279,7 +279,7 @@ class AuthController extends AbstractController
         $redirect_url = $this->routeparser->urlFor('slash');
         if ((($this->login->isAdmin() || $this->login->isStaff()) && $id_adh !== null)) {
             $from_admin = true;
-            $redirect_url = $this->routeparser->urlFor('member', ['id' => $id_adh]);
+            $redirect_url = $this->routeparser->urlFor('member', ['id' => (string)$id_adh]);
         }
 
         if (
@@ -512,7 +512,7 @@ class AuthController extends AbstractController
                         $this->history->add(
                             str_replace(
                                 '%s',
-                                $id_adh,
+                                (string)$id_adh,
                                 _T("Password changed for member '%s'.")
                             )
                         );
index 44be33650c038d7d3e17f28db7614eb13ac6d51f..572431f08da2bf6ed9f4644634fe94920a8abdd3 100644 (file)
@@ -249,7 +249,7 @@ class ContributionsController extends CrudController
                 'mode'          => ($request->getHeaderLine('X-Requested-With') === 'XMLHttpRequest') ? 'ajax' : '',
                 'page_title'    => str_replace(
                     '%count',
-                    count($data['id']),
+                    (string)count($data['id']),
                     _T('Mass add contribution on %count members')
                 ),
                 'data'          => $data,
@@ -297,7 +297,7 @@ class ContributionsController extends CrudController
                 'mode'          => ($request->getHeaderLine('X-Requested-With') === 'XMLHttpRequest') ? 'ajax' : '',
                 'page_title'    => str_replace(
                     '%count',
-                    count($data['id']),
+                    (string)count($data['id']),
                     _T('Mass add contribution on %count members')
                 ),
                 'form_url'      => $this->routeparser->urlFor('doMassAddContributions'),
@@ -748,7 +748,7 @@ class ContributionsController extends CrudController
                     'error_detected',
                     str_replace(
                         '%id',
-                        $id,
+                        (string)$id,
                         _T("Unable to load contribution #%id!")
                     )
                 );
index 6814648387f8c25be5d5c7d5cba195080c6cbeff..eda00443850d798088fc0d029c7193b0370d296a 100644 (file)
@@ -338,7 +338,7 @@ class DynamicFieldsController extends CrudController
                     'Location',
                     $this->routeparser->urlFor(
                         $route_name,
-                        ['id' => $id]
+                        ['id' => (string)$id]
                     )
                 );
         }
@@ -386,7 +386,7 @@ class DynamicFieldsController extends CrudController
             return $response
                 ->withHeader(
                     'Location',
-                    $this->routeparser->urlFor('member', ['id' => $id])
+                    $this->routeparser->urlFor('member', ['id' => (string)$id])
                 );
         }
     }
index e89e280172625053203dc4ea9ad7120c2ea989ec..ae27467a53e7a15dfc20a67c15d89d31c5971c6d 100644 (file)
@@ -93,13 +93,13 @@ class GroupsController extends CrudController
         $group->setName($name);
         $group->store();
         if (!$this->login->isSuperAdmin()) {
-            $group->setManagers(new Adherent($this->zdb, $this->login->id));
+            $group->setManagers([new Adherent($this->zdb, $this->login->id)]);
         }
         $id = $group->getId();
 
         return $response
             ->withStatus(301)
-            ->withHeader('Location', $this->routeparser->urlFor('groups', ['id' => $id]));
+            ->withHeader('Location', $this->routeparser->urlFor('groups', ['id' => (string)$id]));
     }
 
 
@@ -409,7 +409,7 @@ class GroupsController extends CrudController
         }
         return $response
             ->withStatus(301)
-            ->withHeader('Location', $this->routeparser->urlFor('groups', ['id' => $group->getId()]) . $tab);
+            ->withHeader('Location', $this->routeparser->urlFor('groups', ['id' => (string)$group->getId()]) . $tab);
     }
 
     /**
@@ -482,7 +482,7 @@ class GroupsController extends CrudController
     {
         return $this->routeparser->urlFor(
             'doRemoveGroup',
-            ['id' => (int)$args['id']]
+            ['id' => (string)$args['id']]
         );
     }
 
index d9b1fcaf3f7d1dabb1e46f7f4b2d39936bf3e871..5e8a0b46cb501551948517ec3d7df12fc9aa8b12 100644 (file)
@@ -272,7 +272,7 @@ class MembersController extends CrudController
             //member does not exist!
             $this->flash->addMessage(
                 'error_detected',
-                str_replace('%id', $id, _T("No member #%id."))
+                str_replace('%id', (string)$id, _T("No member #%id."))
             );
 
             return $response
@@ -1118,7 +1118,7 @@ class MembersController extends CrudController
                 'mode'          => ($request->getHeaderLine('X-Requested-With') === 'XMLHttpRequest') ? 'ajax' : '',
                 'page_title'    => str_replace(
                     '%count',
-                    count($data['id']),
+                    (string)count($data['id']),
                     _T('Mass change %count members')
                 ),
                 'form_url'      => $this->routeparser->urlFor('masschangeMembersReview'),
@@ -1215,7 +1215,7 @@ class MembersController extends CrudController
                 'mode'          => ($request->getHeaderLine('X-Requested-With') === 'XMLHttpRequest') ? 'ajax' : '',
                 'page_title'    => str_replace(
                     '%count',
-                    count($data['id']),
+                    (string)count($data['id']),
                     _T('Review mass change %count members')
                 ),
                 'form_url'      => $this->routeparser->urlFor('massstoremembers'),
@@ -1343,7 +1343,7 @@ class MembersController extends CrudController
                 'success_detected',
                 str_replace(
                     '%count',
-                    $mass,
+                    (string)$mass,
                     _T('%count members has been changed successfully!')
                 )
             );
@@ -1420,7 +1420,7 @@ class MembersController extends CrudController
                 throw new \RuntimeException(
                     str_replace(
                         '%id',
-                        $member->id,
+                        (string)$member->id,
                         'No right to store member #%id'
                     )
                 );
@@ -1494,7 +1494,7 @@ class MembersController extends CrudController
         }
 
         // Validation
-        $redirect_url = $this->routeparser->urlFor('member', ['id' => $member->id]);
+        $redirect_url = $this->routeparser->urlFor('member', ['id' => (string)$member->id]);
         if (!count($real_requireds) || isset($post[array_shift($real_requireds)])) {
             // regular fields
             $valid = $member->check($post, $required, $disabled);
@@ -1574,7 +1574,7 @@ class MembersController extends CrudController
                 }
 
                 if (isset($post['del_photo'])) {
-                    if (!$member->picture->delete($member->id)) {
+                    if (!$member->picture->delete()) {
                         $error_detected[] = _T("Delete failed");
                         $str_adh = $member->id . ' (' . $member->sname . ' ' . ')';
                         Analog::log(
@@ -1627,7 +1627,7 @@ class MembersController extends CrudController
                             $redirect_url = $this->routeparser->urlFor('addMember');
                             break;
                         case Adherent::AFTER_ADD_SHOW:
-                            $redirect_url = $this->routeparser->urlFor('member', ['id' => $member->id]);
+                            $redirect_url = $this->routeparser->urlFor('member', ['id' => (string)$member->id]);
                             break;
                         case Adherent::AFTER_ADD_LIST:
                             $redirect_url = $this->routeparser->urlFor('members');
@@ -1642,7 +1642,7 @@ class MembersController extends CrudController
                         ['type' => 'fee']
                     ) . '?id_adh=' . $member->id;
                 } else {
-                    $redirect_url = $this->routeparser->urlFor('member', ['id' => $member->id]);
+                    $redirect_url = $this->routeparser->urlFor('member', ['id' => (string)$member->id]);
                 }
             } else {
                 //store entity in session
@@ -1654,7 +1654,7 @@ class MembersController extends CrudController
                     if ($member->id) {
                         $redirect_url = $this->routeparser->urlFor(
                             'editMember',
-                            ['id'    => $member->id]
+                            ['id'    => (string)$member->id]
                         );
                     } else {
                         $redirect_url = $this->routeparser->urlFor((isset($post['addchild']) ? 'addMemberChild' : 'addMember'));
@@ -1722,7 +1722,7 @@ class MembersController extends CrudController
             $this->session->{$this->getFilterName(['suffix' => 'delete'])} = $filters;
             return str_replace(
                 '%count',
-                count($filters->selected),
+                (string)count($filters->selected),
                 _T('You are about to remove %count members.')
             );
         }
index d8f7dc674c361143b3866700ca4f92326fdd9b3e..e39c49b36e53711822c14b0078266450e0d674af 100644 (file)
@@ -226,7 +226,7 @@ class PaymentTypeController extends CrudController
                     _T("Payment type '%s' has not been modified!")
                 );
                 //redirect to payment type edition
-                $redirect_uri = $this->routeparser->urlFor('editPaymentType', ['id' => $id]);
+                $redirect_uri = $this->routeparser->urlFor('editPaymentType', ['id' => (string)$id]);
             }
         } else {
             if ($id === null) {
index 8262342159fc9691b11353eb2f926ad85de77918..010e227feaf643b28b62f758fc4d3f679827ff6d 100644 (file)
@@ -303,7 +303,7 @@ class SavedSearchesController extends CrudController
             $filters = $this->session->filter_savedsearch;
             return str_replace(
                 '%count',
-                count($filters->selected),
+                (string)count($filters->selected),
                 _T('You are about to remove %count searches.')
             );
         }
index 4fc2256544ade541ce94b72eec965a31d7c1ee02..13317e634dfeab4c6f51d40a2bedc55aa8a3e84e 100644 (file)
@@ -221,7 +221,7 @@ class TitlesController extends CrudController
                     _T("Title '%s' has not been modified!")
                 );
 
-                $redirect_uri = $this->routeparser->urlFor('editTitle', ['id' => $id]);
+                $redirect_uri = $this->routeparser->urlFor('editTitle', ['id' => (string)$id]);
             }
         } else {
             if ($id === null) {
index ec259a4804fb8d7006df13c871889375687a4095..148acb17cc5840bbc4932f0aa491bec4c027163e 100644 (file)
@@ -89,7 +89,7 @@ class TransactionsController extends ContributionsController
      */
     public function doAdd(Request $request, Response $response, string $type = null): Response
     {
-        return $this->doEdit($request, $response, $type);
+        return $this->doEdit($request, $response, null, $type);
     }
 
     // /CRUD - Create
@@ -201,8 +201,8 @@ class TransactionsController extends ContributionsController
      *
      * @param Request  $request  PSR Request
      * @param Response $response PSR Response
-     * @param integer  $id       Transaction id
-     * @param string   $type     Transaction type
+     * @param ?integer $id       Transaction id
+     * @param ?string  $type     Transaction type
      *
      * @return Response
      */
@@ -325,7 +325,7 @@ class TransactionsController extends ContributionsController
 
             $args = [];
             if ($trans_id !== null) {
-                $args['id'] = $id;
+                $args['id'] = (string)$id;
             }
             //redirect to calling action
             return $response
@@ -368,7 +368,7 @@ class TransactionsController extends ContributionsController
             ->withStatus(301)
             ->withHeader('Location', $this->routeparser->urlFor(
                 'editTransaction',
-                ['id' => $id]
+                ['id' => (string)$id]
             ));
     }
 
@@ -400,7 +400,7 @@ class TransactionsController extends ContributionsController
             ->withStatus(301)
             ->withHeader('Location', $this->routeparser->urlFor(
                 'editTransaction',
-                ['id' => $id]
+                ['id' => (string)$id]
             ));
     }
 
index 175d86b8a886528677d09d33d46927b831ef5193..2af52ca9821a4981d109dfbd11d7719b6388e50e 100644 (file)
@@ -442,7 +442,7 @@ class PdfController extends AbstractController
                 'error_detected',
                 str_replace(
                     '%id',
-                    $id,
+                    (string)$id,
                     _T("Unable to load contribution #%id!")
                 )
             );
@@ -711,7 +711,7 @@ class PdfController extends AbstractController
                     'error_detected',
                     str_replace(
                         '%id',
-                        $id,
+                        (string)$id,
                         _T("Unable to load contribution #%id!")
                     )
                 );
index ef1391c06483691565f19f6df703b3a0510430ed..23de641a0923a2fa47a7f68f6957011b5643691e 100644 (file)
@@ -722,6 +722,7 @@ class Db
             );
         } else {
             return $this->sql->select(
+                //@phpstan-ignore-next-line
                 array(
                     $alias => PREFIX_DB . $table
                 )
index 171c2609ac5d99f0b95652d9d7b3c104ce88eb2d..ccd455e53f6717b525cecc7adf25bef8f67affc6 100644 (file)
@@ -76,7 +76,7 @@ class I18n
      * Default constructor.
      * Initialize default language and set environment variables
      *
-     * @param bool $lang true if there were a language change
+     * @param string|false $lang true if there were a language change
      *
      * @return void
      */
index 30d12305923d03e70ebc707a958e276cf5be0a25..1143699bb42f60ac2805908cd8e5480482f8dc1d 100644 (file)
@@ -342,11 +342,11 @@ class Install
     /**
      * Set connection information
      *
-     * @param string $host Database host
-     * @param string $port Database port
-     * @param string $name Database name
-     * @param string $user Database user name
-     * @param string $pass Database user's password
+     * @param string  $host Database host
+     * @param string  $port Database port
+     * @param string  $name Database name
+     * @param string  $user Database username
+     * @param ?string $pass Database user's password
      *
      * @return void
      */
@@ -1277,7 +1277,7 @@ define('PREFIX_DB', '" . $this->_db_prefix . "');
     /**
      * Set installed version if we're upgrading
      *
-     * @param string $version Installed version
+     * @param ?string $version Installed version
      *
      * @return void
      */
index 0899539a7f3409a22a7cf2f892b94d80c29b0ad8..967e3fe7778566b6c2ddf037a776605fc2a7bd57 100644 (file)
@@ -89,6 +89,7 @@ class MailingHistory extends History
      */
     public function __construct(Db $zdb, Login $login, Preferences $preferences, MailingsList $filters = null, Mailing $mailing = null)
     {
+        //@phpstan-ignore-next-line
         parent::__construct($zdb, $login, $preferences, $filters);
         $this->mailing = $mailing;
     }
index fa8644494aa371625942ad1f45154210fe3e8062..4a983a81a629fd173392732fce446a00784e8e00 100644 (file)
@@ -276,13 +276,13 @@ abstract class Pagination
             $paginate .= $this->getLink(
                 '<i class="fast backward small icon" aria-hidden="true"></i>',
                 $this->getHref(1),
-                preg_replace("(%i)", $next, _T("First page"))
+                preg_replace("(%i)", (string)$next, _T("First page"))
             );
 
             $paginate .= $this->getLink(
                 '<i class="step backward small icon" aria-hidden="true"></i>',
                 $this->getHref($previous),
-                preg_replace("(%i)", $previous, _T("Previous page (%i)"))
+                preg_replace("(%i)", (string)$previous, _T("Previous page (%i)"))
             );
         }
 
@@ -293,16 +293,16 @@ abstract class Pagination
                     $this->getHref($this->current_page),
                     preg_replace(
                         "(%i)",
-                        $this->current_page,
+                        (string)$this->current_page,
                         _T("Current page (%i)")
                     ),
                     true
                 );
             } else {
                 $paginate .= $this->getLink(
-                    $i,
+                    (string)$i,
                     $this->getHref($i),
-                    preg_replace("(%i)", $i, _T("Page %i"))
+                    preg_replace("(%i)", (string)$i, _T("Page %i"))
                 );
             }
         }
@@ -310,13 +310,13 @@ abstract class Pagination
             $paginate .= $this->getLink(
                 '<i class="step forward small icon" aria-hidden="true"></i>',
                 $this->getHref($next),
-                preg_replace("(%i)", $next, _T("Next page (%i)"))
+                preg_replace("(%i)", (string)$next, _T("Next page (%i)"))
             );
 
             $paginate .= $this->getLink(
                 '<i class="fast forward small icon" aria-hidden="true"></i>',
                 $this->getHref($this->pages),
-                preg_replace("(%i)", $this->pages, _T("Last page (%i)"))
+                preg_replace("(%i)", (string)$this->pages, _T("Last page (%i)"))
             );
         }
         if ($this->current_page == 1 && $this->current_page == $this->pages) {
index b0bcaef967dee8854d091c87af59c40cd5505718..a58918790882572edfc9755289ff09fa7c90e96a 100644 (file)
@@ -425,8 +425,8 @@ class Picture implements FileInterface
     /**
      * Stores an image on the disk and in the database
      *
-     * @param object  $file     The uploaded file
-     * @param boolean $ajax     If the image cames from an ajax call (dnd)
+     * @param array   $file     The uploaded file
+     * @param boolean $ajax     If the image comes from an ajax call (dnd)
      * @param array   $cropping Cropping properties
      *
      * @return bool|int
@@ -680,7 +680,7 @@ class Picture implements FileInterface
                 $file = $existing_disk[$valid->id_adh];
                 $this->storeInDb(
                     $zdb,
-                    $file['id'],
+                    (int)$file['id'],
                     $this->store_path . $file['id'] . '.' . $file['ext'],
                     $file['ext']
                 );
index c9620bf82f3d5796ed5acf8f2568613c3e55a62f..bedc1488ef9c38c9a621783026863f2b3cd9851b 100644 (file)
@@ -604,7 +604,7 @@ class Plugins
     /**
      * Get module namespace
      *
-     * @param integer $id Module ID
+     * @param string $id Module ID
      *
      * @return string
      */
@@ -616,8 +616,8 @@ class Plugins
     /**
      * Get module class name
      *
-     * @param integer $id   Module ID
-     * @param bool    $full Include namespace, defaults to false
+     * @param string $id   Module ID
+     * @param bool   $full Include namespace, defaults to false
      *
      * @return string
      */
index 504486573f499a55462d0fddeeb65456c595d031..81356d9ce51589a2face80ed03e9a68cb11ea8f9 100644 (file)
@@ -749,7 +749,7 @@ class Preferences
                     $this->errors[] = _T("- Invalid format of beginning of membership.");
                 } else {
                     $now = getdate();
-                    if (!checkdate($beg_membership[1], $beg_membership[0], $now['year'])) {
+                    if (!checkdate((int)$beg_membership[1], (int)$beg_membership[0], $now['year'])) {
                         $this->errors[] = _T("- Invalid date for beginning of membership.");
                     }
                 }
index b8f0e9dbd81cf00a6d53ebf6843cbc1b4ae08bf8..b2e064a3e0f88ec18d8ab1e29dbbd13d322b427c 100644 (file)
@@ -1274,7 +1274,7 @@ class Adherent
                         if ($years <= -200) {
                             $this->errors[] = str_replace(
                                 '%years',
-                                $years * -1,
+                                (string)($years * -1),
                                 _T('- Members must be less than 200 years old (currently %years)!')
                             );
                         }
@@ -1341,7 +1341,7 @@ class Adherent
                 if (strlen($value) < 2) {
                     $this->errors[] = str_replace(
                         '%i',
-                        2,
+                        '2',
                         _T("- The username must be composed of at least %i characters!")
                     );
                 } else {
@@ -1996,7 +1996,7 @@ class Adherent
 
         return str_replace(
             '%age',
-            $d->diff(new \DateTime())->y,
+            (string)$d->diff(new \DateTime())->y,
             _T(' (%age years old)')
         );
     }
index bf0bf3a1863593e7e8f13f3c9a420953f744c924..36e58854097469a39e77750caffd4f784ddb568a 100644 (file)
@@ -81,8 +81,8 @@ class ContributionsTypes extends Entitled
     /**
      * Default constructor
      *
-     * @param Db          $zdb  Database
-     * @param ArrayObject $args Optional existing result set
+     * @param Db    $zdb  Database
+     * @param mixed $args Optional existing result set
      */
     public function __construct(Db $zdb, $args = null)
     {
index 1b743a5612c523bef335327c62e2b6eb26be7e45..483e35883ff2fdd9d488d3d2d8e2f7d7c91c2bbf 100644 (file)
@@ -297,7 +297,7 @@ trait Dynamics
                 );
                 $this->errors[] = preg_replace(
                     '|%d|',
-                    $max_size,
+                    (string)$max_size,
                     _T("File is too big. Maximum allowed size is %dKo")
                 );
                 continue;
@@ -320,7 +320,7 @@ trait Dynamics
                 $tmp_filename,
                 GALETTE_FILES_PATH . $new_filename
             );
-            $this->dynamics->setValue($this->id, $field_id, $val_index, $file['name']);
+            $this->dynamics->setValue($this->id, (int)$field_id, (int)$val_index, $file['name']);
             $store = true;
         }
 
index d61a83052cd18efdd062e0595bc1cabd675a94d0..79e4daf253c1aeefb266b252ab0d7d0252263b25 100644 (file)
@@ -268,7 +268,7 @@ class ContributionsList extends Pagination
                                     $day = 31;
                                 }
                                 $y->setDate(
-                                    $y->format('Y'),
+                                    (int)$y->format('Y'),
                                     $month,
                                     $day
                                 );
@@ -279,11 +279,11 @@ class ContributionsList extends Pagination
                             if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
-                                    $day = $ym->format('t');
+                                    $day = (int)$ym->format('t');
                                 }
                                 $ym->setDate(
-                                    $ym->format('Y'),
-                                    $ym->format('m'),
+                                    (int)$ym->format('Y'),
+                                    (int)$ym->format('m'),
                                     $day
                                 );
                                 $this->$name = $ym->format('Y-m-d');
index 3f2faa6c390d7a0d4a3e02bff0e32fa6383b6489..78b13a757facf1af87499c49709f8f7c1e9d0cc6 100644 (file)
@@ -227,7 +227,7 @@ class HistoryList extends Pagination
                                     $day = 31;
                                 }
                                 $y->setDate(
-                                    $y->format('Y'),
+                                    (int)$y->format('Y'),
                                     $month,
                                     $day
                                 );
@@ -238,11 +238,11 @@ class HistoryList extends Pagination
                             if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
-                                    $day = $ym->format('t');
+                                    $day = (int)$ym->format('t');
                                 }
                                 $ym->setDate(
-                                    $ym->format('Y'),
-                                    $ym->format('m'),
+                                    (int)$ym->format('Y'),
+                                    (int)$ym->format('m'),
                                     $day
                                 );
                                 $this->$name = $ym->format('Y-m-d');
index ee6e58d9fb948a05320b0c2babe8b67b485ad978..1af95326b7c41569834a2f5e9df0730fe68c37d7 100644 (file)
@@ -222,7 +222,7 @@ class MailingsList extends Pagination
                                     $day = 31;
                                 }
                                 $y->setDate(
-                                    $y->format('Y'),
+                                    (int)$y->format('Y'),
                                     $month,
                                     $day
                                 );
@@ -233,11 +233,11 @@ class MailingsList extends Pagination
                             if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
-                                    $day = $ym->format('t');
+                                    $day = (int)$ym->format('t');
                                 }
                                 $ym->setDate(
-                                    $ym->format('Y'),
-                                    $ym->format('m'),
+                                    (int)$ym->format('Y'),
+                                    (int)$ym->format('m'),
                                     $day
                                 );
                                 $this->$name = $ym->format('Y-m-d');
index 90736f993749af471924f9ac491fe01bce4fa6f6..657a6566dbc74635a71614c92e21265ca0f8783e 100644 (file)
@@ -230,7 +230,7 @@ class TransactionsList extends Pagination
                                     $day = 31;
                                 }
                                 $y->setDate(
-                                    $y->format('Y'),
+                                    (int)$y->format('Y'),
                                     $month,
                                     $day
                                 );
@@ -241,11 +241,11 @@ class TransactionsList extends Pagination
                             if ($y === false && $ym !== false) {
                                 $day = 1;
                                 if ($name === 'end_date_filter') {
-                                    $day = $ym->format('t');
+                                    $day = (int)$ym->format('t');
                                 }
                                 $ym->setDate(
-                                    $ym->format('Y'),
-                                    $ym->format('m'),
+                                    (int)$ym->format('Y'),
+                                    (int)$ym->format('m'),
                                     $day
                                 );
                                 $this->$name = $ym->format('Y-m-d');
index 7835d8aea8b9ae417831f0738ab555cd5ea78ca7..9ed09eaf5dc55a6047d9e6fe47c2948a256305c7 100644 (file)
@@ -78,11 +78,11 @@ class CsvOut extends Csv
     /**
      * Export Array result set to CSV
      *
-     * @param ResultSet      $rs        Results as an array
+     * @param mixed          $rs        Results as an array
      * @param string         $separator The CSV separator (either '\t', ';' or ','
      *                                  are accepted)
      * @param string         $quote     how does fields should be quoted
-     * @param array|false    $titles    does export shows column titles or not.
+     * @param array|boolean  $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.
index 6b79e2a44150d32b12b3ff04dbc55f5edb70b50c..679b91d122f0b9898070a79062e501bc961e6a55 100644 (file)
@@ -182,11 +182,11 @@ trait FileTrait
     /**
      * Initialization
      *
-     * @param string $dest        File destination directory
-     * @param array  $extensions  Array of permitted extensions
-     * @param array  $mimes       Array of permitted mime types
-     * @param int    $maxlenght   Maximum lenght for each file
-     * @param int    $mincropsize Minimum image side size required for cropping
+     * @param ?string $dest        File destination directory
+     * @param array   $extensions  Array of permitted extensions
+     * @param array   $mimes       Array of permitted mime types
+     * @param int     $maxlenght   Maximum length for each file
+     * @param int     $mincropsize Minimum image side size required for cropping
      *
      * @return void
      */
@@ -240,10 +240,10 @@ trait FileTrait
     }
 
     /**
-     * Stores an file on the disk
+     * Stores a file on the disk
      *
-     * @param object  $file the uploaded file
-     * @param boolean $ajax If the file cames from an ajax call (dnd)
+     * @param array   $file the uploaded file
+     * @param boolean $ajax If the file comes from an ajax call (dnd)
      *
      * @return true|false|int result of the storage process
      */
index 1385f44e753f9276a5d35d505f4815233714f61a..8bb69d9c452382fdaedb069e4aee3afef9cf1cde 100644 (file)
@@ -357,7 +357,7 @@ class Pdf extends \TCPDF
         $this->SetFont(self::FONT, 'B', self::FONT_SIZE + 2);
 
         if ($title !== null) {
-            $this->Cell(0, 6, $title, 0, 1, ($this->i18n->isRTL() ? 'R' : 'L'), 0);
+            $this->Cell(0, 6, $title, 0, 1, ($this->i18n->isRTL() ? 'R' : 'L'), false);
         }
         $yend = $this->getY(); //store position at the end of the text
 
index 3ac289ed1cc95127eb578f25d377c0f960dc7546..85a8528d22df771883b2953c7060fa1774edb8f9 100644 (file)
@@ -89,7 +89,7 @@ class PdfAttendanceSheet extends Pdf
             if ($this->sheet_date !== null) {
                 $head_title .= ' - ' . $this->sheet_date->format(__("Y-m-d"));
             }
-            $this->Cell(0, 10, $head_title, 0, false, 'C', 0, '', 0, false, 'M', 'M');
+            $this->Cell(0, 10, $head_title, 0, 0, 'C', false, '', 0, false, 'M', 'M');
         }
     }
 
@@ -182,15 +182,15 @@ class PdfAttendanceSheet extends Pdf
         // Header
         $this->SetFont('', 'B');
         $this->SetFillColor(255, 255, 255);
-        $this->Cell(110, 7, _T("Name"), 1, 0, 'C', 1);
-        $this->Cell(80, 7, _T("Signature"), 1, 1, 'C', 1);
+        $this->Cell(110, 7, _T("Name"), 1, 0, 'C', true);
+        $this->Cell(80, 7, _T("Signature"), 1, 1, 'C', true);
 
         // Data
         $this->SetFont('');
         $mcount = 0;
         foreach ($members as $m) {
             $mcount++;
-            $this->Cell(10, 16, $mcount, ($this->i18n->isRTL() ? 'R' : 'L') . 'TB', 0, 'R');
+            $this->Cell(10, 16, (string)$mcount, ($this->i18n->isRTL() ? 'R' : 'L') . 'TB', 0, 'R');
 
             if ($m->hasPicture() && $this->wimages) {
                 $p = $m->picture->getPath();
index 41436cf79b6fc761ef97fd646db42920cef1eb45..9388d872abda667880eac43d22edfecca781b76a 100644 (file)
@@ -85,9 +85,9 @@ class PdfGroups extends Pdf
             10,
             _T("Members by groups"),
             0,
-            false,
-            'C',
             0,
+            'C',
+            false,
             '',
             0,
             false,
@@ -176,10 +176,10 @@ class PdfGroups extends Pdf
 
             $this->SetFont('', 'B');
             $this->SetFillColor(255, 255, 255);
-            $this->Cell(80, 7, _T("Name"), 1, 0, 'C', 1);
-            $this->Cell(50, 7, _T("Email"), 1, 0, 'C', 1);
-            $this->Cell(30, 7, _T("Phone"), 1, 0, 'C', 1);
-            $this->Cell(30, 7, _T("GSM"), 1, 1, 'C', 1);
+            $this->Cell(80, 7, _T("Name"), 1, 0, 'C', true);
+            $this->Cell(50, 7, _T("Email"), 1, 0, 'C', true);
+            $this->Cell(30, 7, _T("Phone"), 1, 0, 'C', true);
+            $this->Cell(30, 7, _T("GSM"), 1, 1, 'C', true);
 
             $this->SetFont('', 'B');
 
index 2600285dbca77f0e92c12d89fe67090c8f954434..594d0d360cbe46d287d0a7a90b181b34623f0908 100644 (file)
@@ -272,7 +272,7 @@ class PdfMembersCards extends Pdf
                 $this->year_font_size
             ) - 0.2;
             $this->SetXY($xan_cot, $y0 + $this->hlogo - 0.3);
-            $this->writeHTML('<strong>' . $an_cot . '</strong>', false, 0);
+            $this->writeHTML('<strong>' . $an_cot . '</strong>', false, false);
 
             // Colored Text (Big label, id, year)
             $this->SetTextColor($fcol['R'], $fcol['G'], $fcol['B']);
@@ -283,12 +283,12 @@ class PdfMembersCards extends Pdf
                 $member_id = (!empty($member->number)) ? $member->number : $member->id;
                 $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, false);
             }
             $this->SetFontSize($this->year_font_size);
             $xan_cot = $xan_cot - 0.3;
             $this->SetXY($xan_cot, $y0 + $this->hlogo - 0.3);
-            $this->writeHTML('<strong>' . $an_cot . '</strong>', false, 0);
+            $this->writeHTML('<strong>' . $an_cot . '</strong>', false, false);
 
             // Abbrev: Adapt font size to text length
             $this->fixSize(
@@ -298,7 +298,7 @@ class PdfMembersCards extends Pdf
                 'B'
             );
             $this->SetXY($x0 + 27, $y0 + 12);
-            $this->writeHTML('<strong>' . $this->abrev . '</strong>', true, 0);
+            $this->writeHTML('<strong>' . $this->abrev . '</strong>', true, false);
 
             // Name: Adapt font size to text length
             $this->SetTextColor(0);
@@ -310,7 +310,7 @@ class PdfMembersCards extends Pdf
             );
             $this->SetXY($x0 + 27, $this->getY() + 4);
             //$this->setX($x0 + 27);
-            $this->writeHTML('<strong>' . $nom_adh_ext . '</strong>', true, 0);
+            $this->writeHTML('<strong>' . $nom_adh_ext . '</strong>', true, false);
 
             // Email (adapt too)
             $this->fixSize(
@@ -320,7 +320,7 @@ class PdfMembersCards extends Pdf
                 'B'
             );
             $this->setX($x0 + 27);
-            $this->writeHTML('<strong>' . $email . '</strong>', false, 0);
+            $this->writeHTML('<strong>' . $email . '</strong>', false, false);
 
             // Lower colored strip with long text
             $this->SetFillColor($fcol['R'], $fcol['G'], $fcol['B']);
@@ -338,7 +338,7 @@ class PdfMembersCards extends Pdf
                 0,
                 0,
                 'C',
-                1
+                true
             );
 
             // Draw a gray frame around the card
index 90d95f5a036caf5fe976846108978042ec22f806..52615cca950e860fb3cc665181eedd5091583810 100644 (file)
@@ -184,7 +184,7 @@ class PdfMembersLabels extends Pdf
                 $this->preferences->pref_etiq_corps
             );
             // Print full address
-            $this->writeHTMLCell($this->lw, $this->line_h, $x, $y, nl2br($full_address), 0, 0, 0, true, 'L', true);
+            $this->writeHTMLCell($this->lw, $this->line_h, $x, $y, nl2br($full_address), 0, 0, false, true, 'L', true);
 
             // Next label
             $nb_etiq++;
index 0f0764f478c527cddedb59eef309528ca9b5a66d..60838527aae46e26dbef5a4e75ab41afd656322e 100644 (file)
@@ -45,7 +45,7 @@ use Throwable;
 use Galette\DynamicFields\DynamicField;
 use Galette\Entity\DynamicFieldsHandle;
 use Analog\Analog;
-use Laminas\Db\Sql\Expression;
+use Laminas\Db\Sql\Predicate\Expression;
 use Laminas\Db\Sql\Select;
 use Laminas\Db\Sql\Predicate\PredicateSet;
 use Laminas\Db\Sql\Predicate\Operator;
index 8fe578f0cb531107d46cca498e880ca62485eea7..a3cb72ff8ccef15cb88698a583fed5edcdd16f79 100644 (file)
@@ -1,7 +1,7 @@
 parameters:
     parallel:
         maximumNumberOfProcesses: 2
-    level: 4
+    level: 5
     paths:
         - galette/lib/
     scanFiles:
@@ -18,3 +18,4 @@ parameters:
         - '/Attribute class .*\\Inject does not exist./'
         - '/Cannot access property .* on .*ArrayObject.*/'
         - '/Access to an undefined property ArrayObject.*/'
+        - '/Parameter #3 \$right of class Laminas\\Db\\Sql\\Predicate\\Operator constructor expects bool\|float\|int\|string\|null, Laminas\\Db\\Sql\\Predicate\\Expression given./'