Skip to content

Commit 6bc5f0f

Browse files
committed
Fix phpstan-issues
1 parent 88f0586 commit 6bc5f0f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

phpstan-dev.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
parameters:
2-
level: 8
2+
level: 9
33
paths:
44
- tests

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
parameters:
2-
level: 7
2+
level: 6
33
paths:
44
- src

src/Auth/Source/CAS.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use function array_merge_recursive;
2121
use function preg_split;
2222
use function strcmp;
23+
use function strval;
2324
use function var_export;
2425

2526
/**
@@ -159,18 +160,18 @@ private function casServiceValidate(string $ticket, string $service): array
159160
if ($message instanceof AuthenticationFailure) {
160161
throw new Exception(sprintf(
161162
"Error when validating CAS service ticket: %s (%s)",
162-
$message->getContent(),
163-
$message->getCode(),
163+
strval($message->getContent()),
164+
strval($message->getCode()),
164165
));
165166
} elseif ($message instanceof AuthenticationSuccess) {
166167
$user = $message->getUser()->getContent();
167-
$xPath = XPath::getXPath();
168+
$xPath = XPath::getXPath($message->toXML());
168169

169170
$attributes = [];
170171
if ($casattributes = $this->casConfig['attributes']) {
171172
// Some have attributes in the xml - attributes is a list of XPath expressions to get them
172173
foreach ($casattributes as $name => $query) {
173-
$attrs = $xPath->xpQuery($query, $xPath);
174+
$attrs = $xPath->query($message->toXML(), $query, $xPath);
174175
foreach ($attrs as $attrvalue) {
175176
$attributes[$name][] = $attrvalue->textContent;
176177
}

0 commit comments

Comments
 (0)