Skip to content

Commit 60bc6ff

Browse files
committed
Fix several phpstan-issues
1 parent 3128e64 commit 60bc6ff

25 files changed

+35
-35
lines changed

phpstan.neon

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

src/Type/CIDRValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CIDRValue extends SAMLStringValue
1414
/**
1515
* Validate the content of the element.
1616
*
17-
* @param string $content The value to go in the XML textContent
17+
* @param string $value The value to go in the XML textContent
1818
* @throws \Exception on failure
1919
* @return void
2020
*/

src/Type/DomainValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function sanitizeValue(string $value): string
3232
/**
3333
* Validate the content of the element.
3434
*
35-
* @param string $content The value to go in the XML textContent
35+
* @param string $value The value to go in the XML textContent
3636
* @throws \Exception on failure
3737
* @return void
3838
*/

src/Type/EmailAddressValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function sanitizeValue(string $value): string
3232
/**
3333
* Validate the content of the element.
3434
*
35-
* @param string $content The value to go in the XML textContent
35+
* @param string $value The value to go in the XML textContent
3636
* @throws \Exception on failure
3737
* @return void
3838
*/

src/Type/GeolocationValue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function sanitizeValue(string $value): string
3030
/**
3131
* Validate the content of the element.
3232
*
33-
* @param string $content The value to go in the XML textContent
33+
* @param string $value The value to go in the XML textContent
3434
* @return void
3535
*/
3636
protected function validateValue(string $value): void

src/Type/KeyTypesValue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class KeyTypesValue extends SAMLStringValue
2222
* @throws \Exception on failure
2323
* @return void
2424
*/
25-
protected function validateValue(string $value): void
25+
protected function validateValue(string $content): void
2626
{
2727
Assert::oneOf(
28-
$this->sanitizeValue($value),
28+
$this->sanitizeValue($content),
2929
array_column(KeyTypesEnum::cases(), 'value'),
3030
SchemaViolationException::class,
3131
);

src/Type/ListOfStringsValue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function validateValue(string $value): void
4848
/**
4949
* Convert an array of xs:string items into a mdui:ListOfStrings
5050
*
51-
* @param array<\SimpleSAML\SAML2\Type\StringValue> $keywords
51+
* @param array<\SimpleSAML\SAML2\Type\SAMLStringValue> $keywords
5252
* @return static
5353
*/
5454
public static function fromArray(array $keywords): static
@@ -67,7 +67,7 @@ public static function fromArray(array $keywords): static
6767
/**
6868
* Convert this mdui:ListOfStrings to an array of xs:string items
6969
*
70-
* @return array<\SimpleSAML\SAML2\Type\StringValue>
70+
* @return array<\SimpleSAML\SAML2\Type\SAMLStringValue>
7171
*/
7272
public function toArray(): array
7373
{

src/Utilities/ArrayCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function get($key)
5454

5555

5656
/**
57-
* @param \Closure $f
57+
* @param \Closure $filterFunction
5858
*
5959
* @return ArrayCollection
6060
*/

src/XML/idpdisc/DiscoveryResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public function __construct(
5252
SAMLAnyURIValue $binding,
5353
SAMLAnyURIValue $location,
5454
?BooleanValue $isDefault = null,
55-
?SAMLAnyURIValue $unused = null,
55+
?SAMLAnyURIValue $responseLocation = null, // unused
5656
array $children = [],
5757
array $attributes = [],
5858
) {
5959
Assert::same($binding->getValue(), C::BINDING_IDPDISC, ProtocolViolationException::class);
6060
Assert::null(
61-
$unused,
61+
$responseLocation,
6262
'The \'ResponseLocation\' attribute must be omitted for idpdisc:DiscoveryResponse.',
6363
);
6464
parent::__construct($index, $binding, $location, $isDefault, null, $children, $attributes);

src/XML/md/AbstractIndexedEndpointType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract class AbstractIndexedEndpointType extends AbstractEndpointType implemen
4040
* @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue $binding
4141
* @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue $location
4242
* @param \SimpleSAML\XML\Type\BooleanValue|null $isDefault
43-
* @param \SimpleSAML\SAML2\Type\AnyURIValue|null $responseLocation
43+
* @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $responseLocation
4444
* @param array $children
4545
* @param list<\SimpleSAML\XML\Attribute> $attributes
4646
*/

0 commit comments

Comments
 (0)