Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
uses: ramsey/composer-install@v3

- name: Install PHP tools with phive.
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,99BF4D9A33D65E1E'"
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,99BF4D9A33D65E1E,12CE0F1D262429A5'"

- name: Run phpcs
if: always()
Expand All @@ -82,3 +82,7 @@ jobs:
- name: Run phpstan
if: always()
run: tools/phpstan analyse --error-format=github

- name: Run Psalm
if: always()
run: tools/psalm --output-format=github
1 change: 1 addition & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="2.1.40" installed="2.1.40" location="./tools/phpstan" copy="false"/>
<phar name="psalm" version="7.0.0-beta16" installed="7.0.0-beta16" location="./tools/psalm" copy="false"/>
</phive>
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@
"cs-check": "phpcs --colors -p",
"cs-fix": "phpcbf --colors -p",
"phpstan": "tools/phpstan analyse",
"stan": "@phpstan",
"stan": [
"tools/phpstan analyse",
"tools/psalm"
],
"stan-baseline": "tools/phpstan --generate-baseline",
"psalm-baseline": "tools/psalm --set-baseline=psalm-baseline.xml",
"stan-setup": "phive install"
},
"config": {
Expand Down
23 changes: 23 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<psalm
errorLevel="3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
autoloader="tests/bootstrap.php"
findUnusedPsalmSuppress="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="./src"/>
<ignoreFiles>
<directory name="./vendor"/>
</ignoreFiles>
</projectFiles>

<issueHandlers>
<MissingOverrideAttribute errorLevel="suppress"/>
<MissingPureAnnotation errorLevel="suppress"/>
<InternalMethod errorLevel="suppress"/>
</issueHandlers>
</psalm>
2 changes: 1 addition & 1 deletion src/Database/Log/CakeSentryLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function log($level, string|Stringable $message, array $context = []): vo
protected function isSchemaQuery(LoggedQuery $query): bool
{
$context = $query->getContext();
$querystring = $context['query'] ?? false;
$querystring = $context['query'] ?? '';

if ($querystring === '') {
$querystring = $query->jsonSerialize()['query'] ?? '';
Expand Down
2 changes: 1 addition & 1 deletion src/DebugTimer.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static function stop(?string $name = null): bool
$name = $_name . ' #' . $i;
}
}
if (!isset(self::$_timers[$name])) {
if ($name && !isset(self::$_timers[$name])) {
return false;
}
if ($name !== null) {
Expand Down
1 change: 1 addition & 0 deletions src/Log/Engines/SentryLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct(array $config = [])
* @param array $context
* @return void
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
* @psalm-suppress MoreSpecificImplementedParamType
*/
public function log($level, string|Stringable $message, array $context = []): void
{
Expand Down
Loading