summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-09-19 06:40:25 +0200
committerjld3103 <jld3103yt@gmail.com>2023-09-19 08:52:46 +0200
commitb7673cd353f13765a5c892d31e3b4e13057a0a3e (patch)
treedf9ba66ef07a21c4c81c5a85ac8a0a2d469f8bcc
parenta5c22fe6f4d7afbd4993777c3f736e93230e9e17 (diff)
Enable more/less specific errors
Signed-off-by: jld3103 <jld3103yt@gmail.com>
-rw-r--r--psalm-baseline.xml12
-rw-r--r--psalm.xml6
2 files changed, 18 insertions, 0 deletions
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index e5a5c9212..c585dd05e 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -1401,6 +1401,12 @@
<InvalidArgument>
<code>$exception</code>
</InvalidArgument>
+ <LessSpecificReturnStatement>
+ <code><![CDATA[new self($exception->getMessage(), $exception->getCode(), $exception)]]></code>
+ </LessSpecificReturnStatement>
+ <MoreSpecificReturnType>
+ <code>ServiceException</code>
+ </MoreSpecificReturnType>
<PossiblyUnusedMethod>
<code>from</code>
</PossiblyUnusedMethod>
@@ -1413,6 +1419,12 @@
<InvalidArgument>
<code>$exception</code>
</InvalidArgument>
+ <LessSpecificReturnStatement>
+ <code><![CDATA[new self($exception->getMessage(), $exception->getCode(), $exception)]]></code>
+ </LessSpecificReturnStatement>
+ <MoreSpecificReturnType>
+ <code>ServiceException</code>
+ </MoreSpecificReturnType>
<PossiblyUnusedMethod>
<code>from</code>
</PossiblyUnusedMethod>
diff --git a/psalm.xml b/psalm.xml
index bd452d274..1fd344c4a 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -15,4 +15,10 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
+ <issueHandlers>
+ <LessSpecificReturnStatement errorLevel="error" />
+ <LessSpecificReturnType errorLevel="error" />
+ <LessSpecificImplementedReturnType errorLevel="error" />
+ <MoreSpecificReturnType errorLevel="error" />
+ </issueHandlers>
</psalm>