From f1ece3c70f6dc46d68b266b6f85f798d7ba02c4e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 15:14:55 +0000 Subject: [PATCH 1/2] feat: Add type hints to fix static analysis errors This change adds PHPDoc type hints to arrays across numerous files. This resolves a large number of static analysis errors reported by PHPStan. This change also refactors the code() method to a centralized AbraFlexi\Functions::code() method. --- src/AbraFlexi/RO.php | 2 +- src/AbraFlexi/RW.php | 2 +- src/AbraFlexi/Relations.php | 6 ++++++ src/AbraFlexi/Stitek.php | 12 +++++++----- src/AbraFlexi/Zurnal.php | 9 ++++++--- src/AbraFlexi/firma.php | 2 +- src/AbraFlexi/getChanges.php | 2 +- src/AbraFlexi/kod.php | 2 +- src/AbraFlexi/stitky.php | 4 ++-- src/AbraFlexi/subItems.php | 3 ++- src/AbraFlexi/sum.php | 4 ++-- 11 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/AbraFlexi/RO.php b/src/AbraFlexi/RO.php index 4dfa008..aa30d01 100644 --- a/src/AbraFlexi/RO.php +++ b/src/AbraFlexi/RO.php @@ -360,7 +360,7 @@ class RO extends \Ease\Sand * Class for read only interaction with AbraFlexi. * * @param mixed $init default record id or initial data. See processInit() - * @param array $options Connection settings and other options override + * @param array $options Connection settings and other options override */ public function __construct($init = null, $options = []) { diff --git a/src/AbraFlexi/RW.php b/src/AbraFlexi/RW.php index 2ebe201..50cf013 100644 --- a/src/AbraFlexi/RW.php +++ b/src/AbraFlexi/RW.php @@ -65,7 +65,7 @@ class RW extends RO /** * SetUp Object to be ready for work. * - * @param array $options Object Options (authSessionId,user,password, + * @param array $options Object Options (authSessionId,user,password, * url,company,evidence,companyUrl * prefix,defaultUrlParams,debug,ver,dry-run * detail,offline,atomic,filter,ignore404 diff --git a/src/AbraFlexi/Relations.php b/src/AbraFlexi/Relations.php index d1abd86..6277dc5 100644 --- a/src/AbraFlexi/Relations.php +++ b/src/AbraFlexi/Relations.php @@ -28,6 +28,8 @@ class Relations /** * Evidence adresar (Adresy firem) Relations. + * + * @var array> */ public static array $adresar = [ 'odberatele' => [ @@ -94,6 +96,8 @@ class Relations /** * Evidence atribut (Atributy) Relations. + * + * @var array> */ public static array $atribut = [ 'uzivatelske-vazby' => [ @@ -105,6 +109,8 @@ class Relations /** * Evidence autotisk (Automatický tisk) Relations. + * + * @var array> */ public static array $autotisk = [ 'uzivatelske-vazby' => [ diff --git a/src/AbraFlexi/Stitek.php b/src/AbraFlexi/Stitek.php index f134555..0020422 100644 --- a/src/AbraFlexi/Stitek.php +++ b/src/AbraFlexi/Stitek.php @@ -25,6 +25,7 @@ class Stitek extends RW { /** * Evidence Path for vsb supported by label. + * @var array */ public static array $vsbToEvidencePath = [ 'vsbAdr' => 'adresar', // Adresář @@ -56,7 +57,8 @@ class Stitek extends RW /** * Convert coma-separated list to array. * - * @param array|string $listRaw + * @param array|string $listRaw + * @return array */ public static function listToArray($listRaw): array { @@ -80,7 +82,7 @@ public static function listToArray($listRaw): array * * @param RO $object * - * @return array + * @return array */ public static function getAvailableLabels($object) { @@ -112,8 +114,8 @@ public static function getAvailableLabels($object) * Create New Label for given evidences. * * @param string $name Label Name - * @param array $evidences Evidence code list ex: ['faktura-vydana','faktura-prijata'] - * @param array $options Additional Label properties ex: ['kod'=>'EXAMPLE','skupVybKlic'=>'SKUPINA_STITKU'] + * @param array $evidences Evidence code list ex: ['faktura-vydana','faktura-prijata'] + * @param array $options Additional Label properties ex: ['kod'=>'EXAMPLE','skupVybKlic'=>'SKUPINA_STITKU'] * * @return bool success */ @@ -129,7 +131,7 @@ public function createNew($name, $evidences, $options = []): bool } if (!\array_key_exists('kod', $options)) { - $this->setDataValue('kod', self::code($name)); + $this->setDataValue('kod', \AbraFlexi\Functions::code($name)); } $this->setDataValue('nazev', $name); diff --git a/src/AbraFlexi/Zurnal.php b/src/AbraFlexi/Zurnal.php index 68609a3..fff8cb4 100644 --- a/src/AbraFlexi/Zurnal.php +++ b/src/AbraFlexi/Zurnal.php @@ -28,13 +28,16 @@ class Zurnal extends RO * Evidence užitá objektem. */ public ?string $evidence = 'zurnal'; + /** + * @var array + */ public static array $evidenceToDb = ['faktura-vydana' => 'ddoklfak']; /** * Class for read only interaction with AbraFlexi. * * @param mixed $init default record id or initial data - * @param array $options Connection settings and other options override + * @param array $options Connection settings and other options override */ public function __construct($init = null, $options = []) { @@ -60,7 +63,7 @@ public function __construct($init = null, $options = []) * * @param RO $object * - * @return array changes history + * @return array changes history */ public function getAllChanges($object) { @@ -88,7 +91,7 @@ public function getAllChanges($object) * * @param RO $object * - * @return array Old/New values pairs + * @return array Old/New values pairs */ public function getLastChange($object) { diff --git a/src/AbraFlexi/firma.php b/src/AbraFlexi/firma.php index a81d90a..fc7ec82 100644 --- a/src/AbraFlexi/firma.php +++ b/src/AbraFlexi/firma.php @@ -31,7 +31,7 @@ trait firma /** * Instance of Adresar( $this->getDataValue('firma') ). * - * @param array $options for new Object + * @param array $options for new Object * * @return Adresar */ diff --git a/src/AbraFlexi/getChanges.php b/src/AbraFlexi/getChanges.php index 99134e9..7664082 100644 --- a/src/AbraFlexi/getChanges.php +++ b/src/AbraFlexi/getChanges.php @@ -44,7 +44,7 @@ trait getChanges /** * Obtain Chaneges from Journal. * - * @return array Changes obtained + * @return array Changes obtained */ public function getChanges() { diff --git a/src/AbraFlexi/kod.php b/src/AbraFlexi/kod.php index 4e13d93..b4ecde8 100644 --- a/src/AbraFlexi/kod.php +++ b/src/AbraFlexi/kod.php @@ -33,6 +33,6 @@ trait kod */ public function _getRecordCode() { - return empty($this->getDataValue('kod')) ? null : self::code($this->getDataValue('kod')); + return empty($this->getDataValue('kod')) ? null : \AbraFlexi\Functions::code($this->getDataValue('kod')); } } diff --git a/src/AbraFlexi/stitky.php b/src/AbraFlexi/stitky.php index 1615951..64e163d 100644 --- a/src/AbraFlexi/stitky.php +++ b/src/AbraFlexi/stitky.php @@ -26,7 +26,7 @@ trait stitky /** * Get all labels for current record. * - * @return array + * @return array */ public function getLabels() { @@ -50,7 +50,7 @@ public function setLabel($label) /** * UnSet Label for Current Object record. * - * @param array|string $labelsToRemove Label/Labels + * @param array|string $labelsToRemove Label/Labels * * @return bool success result ? */ diff --git a/src/AbraFlexi/subItems.php b/src/AbraFlexi/subItems.php index 01769bc..1b87fde 100644 --- a/src/AbraFlexi/subItems.php +++ b/src/AbraFlexi/subItems.php @@ -26,7 +26,7 @@ trait subItems /** * Subitems - ex. items of invoice. * - * @return array of document items or null + * @return array of document items or null */ public function getSubItems() { @@ -34,6 +34,7 @@ public function getSubItems() } /** + * @param array $subitems * @return bool */ public function setSubitems(array $subitems) diff --git a/src/AbraFlexi/sum.php b/src/AbraFlexi/sum.php index f42f159..361e057 100644 --- a/src/AbraFlexi/sum.php +++ b/src/AbraFlexi/sum.php @@ -26,9 +26,9 @@ trait sum /** * Vrací z AbraFlexi sumaci i podle podmínek. * - * @param array $conditions pole podmínek nebo ID záznamu + * @param array $conditions * - * @return array + * @return array */ public function getSumFromAbraFlexi($conditions = []) { From 3e1a7b67f023b3a92bf70e6c329c658b446320f3 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 29 Nov 2025 13:53:01 +0000 Subject: [PATCH 2/2] fix: Address code review feedback This commit addresses feedback from the code review: - Restores the getVazby() method in Status.php to avoid a regression. - Removes the composer.phar binary from the repository. - Reverts the file permission change on bootstrap-debian.sh.