Skip to content

Commit 9d304fd

Browse files
committed
Merge branch 'cleanup'
2 parents 311791f + b388a6c commit 9d304fd

File tree

15 files changed

+203
-112
lines changed

15 files changed

+203
-112
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ jobs:
8686
key: composer-cache-${{ runner.os }}-${{ hashFiles('**/composer.json', '**/composer.lock') }}
8787
restore-keys: composer-cache-${{ runner.os }}-
8888

89+
- name: Persist PHPStan cache
90+
uses: actions/cache@v4
91+
with:
92+
path: build/cache/phpstan
93+
key: phpstan-cache-${{ runner.os }}-${{ matrix.php-version }}-${{ github.run_id }}
94+
restore-keys: phpstan-cache-${{ runner.os }}-${{ matrix.php-version }}-
95+
8996
- name: Install PHP dependencies
9097
run: composer install --no-interaction --no-progress
9198

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"adodb/adodb-php": "^5",
2525
"analog/analog": "^1",
2626
"clue/phar-composer": "^1",
27+
"ergebnis/phpunit-slow-test-detector": "^2",
2728
"firebase/php-jwt": "^6",
2829
"league/oauth2-client": "^2",
2930
"php-http/psr7-integration-tests": "^1.3",

phpunit.xml.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,15 @@
4545
name="URI_FACTORY"
4646
value="Lkrms\Http\HttpFactory" />
4747
</php>
48+
<extensions>
49+
<extension class="Ergebnis\PHPUnit\SlowTestDetector\Extension">
50+
<arguments>
51+
<array>
52+
<element key="maximum-duration">
53+
<integer>200</integer>
54+
</element>
55+
</array>
56+
</arguments>
57+
</extension>
58+
</extensions>
4859
</phpunit>

src/Toolkit/Core/Catalog/CopyFlag.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
/**
99
* Get::copy() flags
1010
*
11+
* @api
12+
*
1113
* @extends AbstractEnumeration<int>
1214
*/
1315
final class CopyFlag extends AbstractEnumeration

src/Toolkit/Core/Catalog/EnvFlag.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
namespace Salient\Core\Catalog;
44

5-
use Salient\Core\Utility\Env;
65
use Salient\Core\AbstractEnumeration;
76

87
/**
98
* Env::apply() flags
109
*
10+
* @api
11+
*
1112
* @extends AbstractEnumeration<int>
1213
*/
1314
final class EnvFlag extends AbstractEnumeration
@@ -33,5 +34,7 @@ final class EnvFlag extends AbstractEnumeration
3334
/**
3435
* Apply all recognised values from the environment to the running script
3536
*/
36-
public const ALL = self::LOCALE | self::TIMEZONE;
37+
public const ALL =
38+
EnvFlag::LOCALE
39+
| EnvFlag::TIMEZONE;
3740
}

src/Toolkit/Core/Catalog/JsonDecodeFlag.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
use Salient\Core\AbstractEnumeration;
66

77
/**
8-
* json_decode() flags
8+
* Json::parse() flags
9+
*
10+
* @api
911
*
1012
* @extends AbstractEnumeration<int>
1113
*/
12-
class JsonDecodeFlag extends AbstractEnumeration
14+
final class JsonDecodeFlag extends AbstractEnumeration
1315
{
1416
public const BIGINT_AS_STRING = \JSON_BIGINT_AS_STRING;
1517
public const INVALID_UTF8_IGNORE = \JSON_INVALID_UTF8_IGNORE;

src/Toolkit/Core/Catalog/JsonEncodeFlag.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
use Salient\Core\AbstractEnumeration;
66

77
/**
8-
* json_encode() flags
8+
* Json::stringify() flags
9+
*
10+
* @api
911
*
1012
* @extends AbstractEnumeration<int>
1113
*/
12-
class JsonEncodeFlag extends AbstractEnumeration
14+
final class JsonEncodeFlag extends AbstractEnumeration
1315
{
1416
public const FORCE_OBJECT = \JSON_FORCE_OBJECT;
1517
public const INVALID_UTF8_IGNORE = \JSON_INVALID_UTF8_IGNORE;

src/Toolkit/Core/Catalog/QueryFlag.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
/**
88
* Get::query() flags
99
*
10+
* @api
11+
*
1012
* @extends AbstractEnumeration<int>
1113
*/
1214
final class QueryFlag extends AbstractEnumeration

src/Toolkit/Core/Catalog/SortFlag.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
/**
88
* Sorting flags
99
*
10+
* @api
11+
*
1012
* @extends AbstractEnumeration<int>
1113
*/
12-
class SortFlag extends AbstractEnumeration
14+
final class SortFlag extends AbstractEnumeration
1315
{
1416
public const REGULAR = \SORT_REGULAR;
1517
public const NUMERIC = \SORT_NUMERIC;

src/Toolkit/Core/Concern/HasReadableProperties.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22

33
namespace Salient\Core\Concern;
44

5-
use Lkrms\Support\Introspector as IS;
5+
use Lkrms\Support\Introspector;
66
use Salient\Core\Contract\Readable;
77

88
/**
99
* Implements Readable
1010
*
11-
* - If `_get<Property>()` is defined, `__get` will use its return value instead
12-
* of returning the value of `<Property>`.
13-
* - If `_isset<Property>()` is defined, `__isset` will use its return value
14-
* instead of returning the value of `isset(<Property>)`.
15-
* - The existence of `_get<Property>()` implies that `<Property>` is readable,
16-
* regardless of {@see HasReadableProperties::getReadableProperties()}'s
17-
* return value.
11+
* - If `_get<Property>()` is defined, it is called instead of returning the
12+
* value of `<Property>`.
13+
* - If `_isset<Property>()` is defined, it is called instead of returning
14+
* `isset(<Property>)`.
15+
* - The existence of `_get<Property>()` makes `<Property>` readable, regardless
16+
* of {@see Readable::getReadableProperties()}'s return value.
17+
*
18+
* @api
1819
*
1920
* @see Readable
2021
*/
@@ -30,7 +31,7 @@ public static function getReadableProperties(): array
3031
*/
3132
private function getProperty(string $action, string $name)
3233
{
33-
return IS::get(static::class)->getPropertyActionClosure($name, $action)($this);
34+
return Introspector::get(static::class)->getPropertyActionClosure($name, $action)($this);
3435
}
3536

3637
/**

0 commit comments

Comments
 (0)