Skip to content

Commit 4caf39e

Browse files
committed
try to satisfy psalm
1 parent b64740f commit 4caf39e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Payload/Alert.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
* remediation: bool,
7474
* source: TSource,
7575
* events: list<TEvent>,
76-
* decisions: list<TDecision>,
77-
* meta: list<TMeta>,
78-
* labels: list<non-empty-string>
76+
* decisions?: list<TDecision>,
77+
* meta?: list<TMeta>,
78+
* labels?: list<non-empty-string>
7979
* }
8080
*/
8181
class Alert implements \JsonSerializable
@@ -157,8 +157,8 @@ public static function fromArray(array $data): self
157157
public function toArray(): array
158158
{
159159
$result = $this->properties;
160-
$result['events'] = $this->events;
161160
$result['source'] = $this->source;
161+
$result['events'] = $this->events;
162162
if ([] !== $this->decisions) {
163163
$result['decisions'] = $this->decisions;
164164
}

tools/coding-standards/psalm/psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
</UndefinedMethod>
2828
<PropertyTypeCoercion>
2929
<errorLevel type="suppress">
30+
<referencedProperty name="CrowdSec\LapiClient\Payload\Alert::$properties"/>
3031
<referencedProperty name="CrowdSec\LapiClient\Payload\Alert::$source"/>
3132
<referencedProperty name="CrowdSec\LapiClient\Payload\Alert::$decisions"/>
3233
<referencedProperty name="CrowdSec\LapiClient\Payload\Alert::$events"/>

0 commit comments

Comments
 (0)