Skip to content

Commit dc25fbc

Browse files
committed
release v3.5.1 Refactor code style and improve consistency across multiple files
1 parent e75bc13 commit dc25fbc

File tree

10 files changed

+34
-26
lines changed

10 files changed

+34
-26
lines changed

debian/changelog

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
php-spojenet-abraflexi (3.5.2.295~noble.296~trixie) UNRELEASED; urgency=medium
1+
php-spojenet-abraflexi (3.5.3) UNRELEASED; urgency=medium
22

3+
* Refactor code style and improve consistency across multiple files
4+
5+
-- vitex <info@vitexsoftware.cz> Tue, 24 Jun 2025 14:48:46 +0200
6+
7+
php-spojenet-abraflexi (3.5.2.295~noble.296~trixie) experimental; urgency=medium
8+
9+
[ Vitex ]
310
* new method RO::getSumsFromAbraFlexi()
411
* jenkins-Spoje.Net-php-spojenet-abraflexi-283
512
* jenkins-Spoje.Net-php-spojenet-abraflexi-284
@@ -8,7 +15,7 @@ php-spojenet-abraflexi (3.5.2.295~noble.296~trixie) UNRELEASED; urgency=medium
815
* jenkins-Spoje.Net-php-spojenet-abraflexi-295
916
* jenkins-Spoje.Net-php-spojenet-abraflexi-296
1017

11-
-- Vitex <jenkins@vyvojar.spoje.net> Thu, 17 Apr 2025 12:54:30 +0000
18+
-- vitex <info@vitexsoftware.cz> Tue, 24 Jun 2025 14:48:26 +0200
1219

1320
php-spojenet-abraflexi (3.4.0.273) experimental; urgency=medium
1421

src/AbraFlexi/Company.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function restoreBackupFrom(
185185
$name = null,
186186
$disableEet = false,
187187
$disableAutoSendMail = false,
188-
$disableWebHooks = false
188+
$disableWebHooks = false,
189189
) {
190190
$options = [];
191191

src/AbraFlexi/Functions.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,12 @@ public static function flexiUrl(array $data, $joiner = 'and', $defop = 'eq'): st
210210
switch ($column) {
211211
case 'stitky':
212212
$parts[$column] = $column."='".self::code($data[$column])."'";
213-
break;
213+
214+
break;
215+
214216
default:
215217
$parts[$column] = $column." {$defop} '".$data[$column]."'";
218+
216219
break;
217220
}
218221

@@ -402,13 +405,13 @@ public static function xml2array($xml)
402405
public static function getOfflineColumnsInfo(string $evidence): ?array
403406
{
404407
$columnsInfo = null;
405-
$infoSource = self::$infoDir.'/Properties.'.$evidence.'.json';
408+
$infoSource = self::$infoDir.'/Properties.'.$evidence.'.php';
406409

407410
if (file_exists($infoSource)) {
408-
$columnsInfo = json_decode(file_get_contents($infoSource), true);
411+
$columnsInfo = require $infoSource;
409412
}
410413

411-
if (property_exists('\AbraFlexi\Relations', $evidence)) {
414+
if (property_exists('\\AbraFlexi\\Relations', $evidence)) {
412415
foreach (Relations::${$evidence} as $url => $properties) {
413416
$properties['type'] = 'relations';
414417
$columnsInfo[$url] = $properties;

src/AbraFlexi/Pokladna.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ class Pokladna extends RW
3636
* @see Relations
3737
*
3838
* @param array $data pole dat
39-
* @param string $relationPath path evidence (relation) pro vkládaná data
39+
* @param string $relationPath path evidence (relation) for inserted data
4040
* @param bool $removeAll
4141
*
4242
* @return bool Operation success
4343
*/
4444
public function addArrayToBranch(
4545
$data,
4646
$relationPath = 'polozkyIntDokladu',
47-
$removeAll = false
47+
$removeAll = false,
4848
) {
4949
return parent::addArrayToBranch($data, $relationPath, $removeAll);
5050
}

src/AbraFlexi/Priloha.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static function getAttachment($attachmentID, $options = [])
131131
public static function download(
132132
$object,
133133
$format = 'pdf',
134-
$attachmentID = null
134+
$attachmentID = null,
135135
): void {
136136
$attachments = self::getAttachmentsList($object);
137137

@@ -210,7 +210,7 @@ public static function addAttachment(
210210
$object,
211211
$filename,
212212
$attachment,
213-
$contentType
213+
$contentType,
214214
) {
215215
$attached = new self(null, $object->getConnectionOptions());
216216
$attached->postFields = $attachment;

src/AbraFlexi/RO.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ public function setDataValue(string $columnName, $value): bool
685685
// no break
686686
default:
687687
if (\is_object($value)) {
688-
switch (\get_class($value)) {
688+
switch ($value::class) {
689689
case 'DateTime':
690690
$columnInfo = $this->getColumnInfo($columnName);
691691

@@ -1038,7 +1038,7 @@ public function addDefaultUrlParams(string $urlRaw)
10381038
public function performRequest(
10391039
string $urlSuffix = '',
10401040
string $method = 'GET',
1041-
$format = null
1041+
$format = null,
10421042
) {
10431043
$this->rowCount = null;
10441044
$this->responseStats = [];
@@ -1880,8 +1880,6 @@ public function getAllFromAbraFlexi($conditions = null, $indexBy = null)
18801880
* @param array<string|string> $conditions
18811881
*
18821882
* @throws \InvalidArgumentException - when requested field does not support summmarization
1883-
*
1884-
* @return array
18851883
*/
18861884
public function getSumsFromAbraFlexi(
18871885
array $fields,
@@ -1896,8 +1894,8 @@ public function getSumsFromAbraFlexi(
18961894
$conditions['fields'] = implode(',', array_unique($fields));
18971895

18981896
$summaryRaw = $this->getFlexiData('$sum', $conditions);
1899-
1900-
return array_key_exists('sum', $summaryRaw) ? $summaryRaw['sum'] : [];
1897+
1898+
return \array_key_exists('sum', $summaryRaw) ? $summaryRaw['sum'] : [];
19011899
}
19021900

19031901
/**
@@ -1912,7 +1910,7 @@ public function getSumsFromAbraFlexi(
19121910
public function getColumnsFromAbraFlexi(
19131911
$columnsList,
19141912
$conditions = [],
1915-
$indexBy = null
1913+
$indexBy = null,
19161914
) {
19171915
$detail = 'full';
19181916

@@ -2759,7 +2757,7 @@ public function getInFormat(
27592757
string $format,
27602758
$reportName = null,
27612759
$lang = null,
2762-
$sign = false
2760+
$sign = false,
27632761
) {
27642762
$response = null;
27652763
$formatBackup = $this->format;
@@ -2820,7 +2818,7 @@ public function downloadInFormat(
28202818
$destDir = './',
28212819
$reportName = null,
28222820
$lang = null,
2823-
$sign = false
2821+
$sign = false,
28242822
) {
28252823
$downloadTo = $destDir.$this->getEvidence().'_'.str_replace(['/', ' ', ':'], '_', (string) $this->getRecordIdent()).'.'.$format;
28262824
$downloaded = $this->getInFormat($format, $reportName, $lang, $sign);

src/AbraFlexi/RW.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function assignResultIDs($candidates): void
206206

207207
if (\is_array($chainedExtid)) { // if there are more IDs
208208
foreach ($chainedExtid as $extId) { // find external ID in format ext:.....
209-
if (stripos($extId, 'ext:') === 0) {
209+
if (str_starts_with(strtolower($extId), strtolower('ext:'))) {
210210
$chainedExtid = $extId;
211211

212212
break;
@@ -432,7 +432,7 @@ public static function timestampToFlexiDateTime($timpestamp = null)
432432
public function addArrayToBranch(
433433
$data,
434434
$relationPath = 'polozkyDokladu',
435-
$removeAll = false
435+
$removeAll = false,
436436
) {
437437
$currentBranchData = $this->getDataValue($relationPath);
438438
$branchData = $currentBranchData;

src/AbraFlexi/Stitek.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static function getLabels($object)
6565
$labels = null;
6666
$labelsRaw = $object->getDataValue('stitky');
6767

68-
if (\strlen($labelsRaw)) {
68+
if (\is_string($labelsRaw) && \strlen($labelsRaw)) {
6969
$labels = \is_array($labelsRaw) ? $labelsRaw : self::listToArray($labelsRaw);
7070
}
7171

tools/force_update_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
mkdir -p ../static
3-
CURRENT=`php -qf current_version.php`
3+
CURRENT=$(php -qf current_version.php)
44
php -qf update_evidencelist_class.php
55
mv -f EvidenceList.php ../src/AbraFlexi/EvidenceList.php
66
php -qf update_properties_class.php

tools/update_all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

33
php -qf current_settings.php
4-
CURRENT=`php -qf current_version.php`
5-
if [ `php -qf time_to_update.php` = "true" ]
4+
CURRENT=$(php -qf current_version.php)
5+
if [ $(php -qf time_to_update.php) = "true" ]
66
then
77
echo updating for $CURRENT
88
./force_update_all.sh

0 commit comments

Comments
 (0)