Skip to content

Commit 2a99ef5

Browse files
committed
feat: add online version script and update Makefile for tagging after static update
refactor: update type hints in RO class for better clarity test: reformat evidenceToClassName test method in FunctionsTest
1 parent 5c27828 commit 2a99ef5

File tree

4 files changed

+39
-16
lines changed

4 files changed

+39
-16
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static: ## Generate Static files by api structure
3838
echo "STATIC #######################"
3939
cd tools/ ; ./update_all.sh ; cd ..
4040
make cssilent
41+
[ -f tools/online-version.php ] && php tools/online-version.php | xargs -I{} git tag -a {} -m "Tagging version {} after static update"
4142

4243
.PHONY: clean
4344
clean: ## Clean up build artifacts

src/AbraFlexi/RO.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class RO extends \Ease\Sand
144144
*
145145
* @var null|array<string, mixed>
146146
*/
147-
public null|array $curlInfo;
147+
public ?array $curlInfo;
148148

149149
/**
150150
* Informace o poslední HTTP chybě.
@@ -184,7 +184,7 @@ class RO extends \Ease\Sand
184184
/**
185185
* Last operation result data or message(s).
186186
*
187-
* @var array<mixed>|null
187+
* @var null|array<mixed>
188188
*/
189189
public ?array $lastResult = null;
190190

@@ -531,7 +531,7 @@ public function setObjectName($objectName = null)
531531
/**
532532
* Get Current connection options for use in another object.
533533
*
534-
* @return array<string, int|string|null> Usable as second constructor parameter
534+
* @return array<string, null|int|string> Usable as second constructor parameter
535535
*/
536536
public function getConnectionOptions(): array
537537
{
@@ -560,7 +560,7 @@ public function getConnectionOptions(): array
560560
/**
561561
* Export current/given configuration into Environment.
562562
*
563-
* @param array<string, int|string|null> $opts Configuration options to export to environment variables
563+
* @param array<string, null|int|string> $opts Configuration options to export to environment variables
564564
*/
565565
public function configToEnv(array $opts = []): void
566566
{

tests/src/AbraFlexi/FunctionsTest.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,17 @@ protected function tearDown(): void
4040
{
4141
}
4242

43-
/**
44-
* @covers \AbraFlexi\Functions::evidenceToClassName
45-
*
46-
* @todo Implement testevidenceToClassName().
47-
*/
48-
public function testevidenceToClassName(): void
49-
{
50-
$this->assertEquals('', $this->object->evidenceToClassName());
51-
// Remove the following lines when you implement this test.
52-
$this->markTestIncomplete('This test has not been implemented yet.');
53-
}
54-
43+
/**
44+
* @covers \AbraFlexi\Functions::evidenceToClassName
45+
*
46+
* @todo Implement testevidenceToClassName().
47+
*/
48+
public function testevidenceToClassName(): void
49+
{
50+
$this->assertEquals('', $this->object->evidenceToClassName());
51+
// Remove the following lines when you implement this test.
52+
$this->markTestIncomplete('This test has not been implemented yet.');
53+
}
5554

5655
// /**
5756
// * @covers \AbraFlexi\Functions::urlEncode

tools/online-version.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* Print the current online version from AbraFlexi Status.
7+
*
8+
* @author Vítězslav Dvořák <[email protected]>
9+
* @copyright (C) 2025 Spoje.Net
10+
*/
11+
12+
namespace AbraFlexi;
13+
14+
require_once __DIR__ . '/../tests/bootstrap.php';
15+
16+
try {
17+
$status = new Status();
18+
$version = $status->getDataValue('version');
19+
echo $version;
20+
} catch (\Throwable $exception) {
21+
// Print a meaningful error message
22+
echo 'Error: ' . $exception->getMessage();
23+
}

0 commit comments

Comments
 (0)