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: 4 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@ on:
jobs:
test:
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: false
strategy:
fail-fast: false
matrix:
php-version:
- '8.2'
- '8.3'
- '8.4'
symfony-version:
- '5.4.*'
- '6.4.*'
- '7.0.*'
- '7.1.*'
include:
- php-version: '8.1'
symfony-version: '5.4.*'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Action/Profile/FlushRequestStatesAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function doExecute(ProfileContext $context)
/**
* @param ContextInterface|null $requestStateContext
*/
protected function flush($requestStateContext = null)
protected function flush(?ContextInterface $requestStateContext = null)
{
if ($requestStateContext instanceof RequestStateContext &&
$requestStateContext->getRequestState() &&
Expand Down
4 changes: 2 additions & 2 deletions src/LightSaml/Binding/AbstractBinding.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ abstract class AbstractBinding
/**
* @return AbstractBinding
*/
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher = null)
public function setEventDispatcher(?EventDispatcherInterface $eventDispatcher = null)
{
$this->eventDispatcher = $eventDispatcher;

Expand Down Expand Up @@ -65,7 +65,7 @@ protected function dispatchSend($messageString)
*
* @return \Symfony\Component\HttpFoundation\Response
*/
abstract public function send(MessageContext $context, $destination = null);
abstract public function send(MessageContext $context, ?string $destination = null);

abstract public function receive(Request $request, MessageContext $context);
}
4 changes: 2 additions & 2 deletions src/LightSaml/Binding/BindingFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class BindingFactory implements BindingFactoryInterface
/**
* @param EventDispatcherInterface $eventDispatcher
*/
public function __construct(EventDispatcherInterface $eventDispatcher = null)
public function __construct(?EventDispatcherInterface $eventDispatcher = null)
{
$this->eventDispatcher = $eventDispatcher;
}

/**
* @return BindingFactoryInterface
*/
public function setEventDispatcher(EventDispatcherInterface $eventDispatcher = null)
public function setEventDispatcher(?EventDispatcherInterface $eventDispatcher = null)
{
$this->eventDispatcher = $eventDispatcher;

Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Binding/HttpPostBinding.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class HttpPostBinding extends AbstractBinding
*
* @return SamlPostResponse
*/
public function send(MessageContext $context, $destination = null)
public function send(MessageContext $context, ?string $destination = null)
{
$message = MessageContextHelper::asSamlMessage($context);
$destination = $message->getDestination() ? $message->getDestination() : $destination;
Expand Down
4 changes: 2 additions & 2 deletions src/LightSaml/Binding/HttpRedirectBinding.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class HttpRedirectBinding extends AbstractBinding
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function send(MessageContext $context, $destination = null)
public function send(MessageContext $context, ?string $destination = null)
{
$destination = $context->getMessage()->getDestination() ? $context->getMessage()->getDestination() : $destination;

Expand Down Expand Up @@ -203,7 +203,7 @@ protected function addRelayStateToUrl(&$msg, SamlMessage $message)
/**
* @param string $msg
*/
protected function addSignatureToUrl(&$msg, SignatureWriter $signature = null)
protected function addSignatureToUrl(&$msg, ?SignatureWriter $signature = null)
{
/** @var $key XMLSecurityKey */
$key = $signature ? $signature->getXmlSecurityKey() : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OwnContainerProvider implements ServiceProviderInterface
/**
* @param CredentialInterface[] $ownCredentials
*/
public function __construct(EntityDescriptorProviderInterface $ownEntityDescriptorProvider, array $ownCredentials = null)
public function __construct(EntityDescriptorProviderInterface $ownEntityDescriptorProvider, ?array $ownCredentials = null)
{
$this->ownEntityDescriptorProvider = $ownEntityDescriptorProvider;
if ($ownCredentials) {
Expand Down
4 changes: 2 additions & 2 deletions src/LightSaml/Context/AbstractContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getTopParent()
/**
* @return ContextInterface
*/
public function setParent(ContextInterface $parent = null)
public function setParent(?ContextInterface $parent = null)
{
$this->parent = $parent;

Expand All @@ -55,7 +55,7 @@ public function setParent(ContextInterface $parent = null)
*
* @return ContextInterface|null
*/
public function getSubContext($name, $class = null)
public function getSubContext($name, ?string $class = null)
{
if (isset($this->subContexts[$name])) {
return $this->subContexts[$name];
Expand Down
4 changes: 2 additions & 2 deletions src/LightSaml/Context/ContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ public function getTopParent();
/**
* @return ContextInterface
*/
public function setParent(ContextInterface $parent = null);
public function setParent(?ContextInterface $parent = null);

/**
* @param string $name
* @param string|null $class
*
* @return ContextInterface|null
*/
public function getSubContext($name, $class = null);
public function getSubContext($name, ?string $class = null);

/**
* @param string $class
Expand Down
4 changes: 2 additions & 2 deletions src/LightSaml/Context/Profile/AssertionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function getAssertion()
*
* @return AssertionContext
*/
public function setAssertion(Assertion $assertion = null)
public function setAssertion(?Assertion $assertion = null)
{
$this->assertion = $assertion;

Expand All @@ -78,7 +78,7 @@ public function getEncryptedAssertion()
*
* @return AssertionContext
*/
public function setEncryptedAssertion(EncryptedElement $encryptedAssertion = null)
public function setEncryptedAssertion(?EncryptedElement $encryptedAssertion = null)
{
$this->encryptedAssertion = $encryptedAssertion;

Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Context/Profile/ExceptionContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ExceptionContext extends AbstractProfileContext
/** @var ExceptionContext|null */
protected $nextExceptionContext;

public function __construct(\Exception $exception = null)
public function __construct(?\Exception $exception = null)
{
$this->exception = $exception;
}
Expand Down
6 changes: 3 additions & 3 deletions src/LightSaml/Context/Profile/Helper/LogHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ abstract class LogHelper
*
* @return array
*/
public static function getActionContext(ContextInterface $context, ActionInterface $action, array $extraData = null)
public static function getActionContext(ContextInterface $context, ActionInterface $action, ?array $extraData = null)
{
return self::getContext($context, $action, $extraData, false);
}
Expand All @@ -32,7 +32,7 @@ public static function getActionContext(ContextInterface $context, ActionInterfa
*
* @return array
*/
public static function getActionErrorContext(ContextInterface $context, ActionInterface $action, array $extraData = null)
public static function getActionErrorContext(ContextInterface $context, ActionInterface $action, ?array $extraData = null)
{
return self::getContext($context, $action, $extraData, true);
}
Expand All @@ -44,7 +44,7 @@ public static function getActionErrorContext(ContextInterface $context, ActionIn
*
* @return array
*/
private static function getContext(ContextInterface $context, ActionInterface $action = null, array $extraData = null, $logWholeContext = false)
private static function getContext(ContextInterface $context, ?ActionInterface $action = null, ?array $extraData = null, $logWholeContext = false)
{
$topContext = $context->getTopParent();
$result = [];
Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Context/Profile/MessageContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function getMessage()
/**
* @return MessageContext
*/
public function setMessage(SamlMessage $message = null)
public function setMessage(?SamlMessage $message = null)
{
$this->message = $message;

Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Credential/X509Credential.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class X509Credential extends AbstractCredential implements X509CredentialInterfa
/**
* @param XMLSecurityKey $privateKey
*/
public function __construct(X509Certificate $certificate, XMLSecurityKey $privateKey = null)
public function __construct(X509Certificate $certificate, ?XMLSecurityKey $privateKey = null)
{
parent::__construct();
$this->certificate = $certificate;
Expand Down
8 changes: 4 additions & 4 deletions src/LightSaml/Error/LightSamlAuthenticationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class LightSamlAuthenticationException extends LightSamlValidationException
protected $response;

/**
* @param string $message
* @param int $code
* @param \Exception $previous
* @param string $message
* @param int $code
* @param \Exception|null $previous
*/
public function __construct(StatusResponse $response, $message = '', $code = 0, \Exception $previous = null)
public function __construct(StatusResponse $response, $message = '', $code = 0, ?\Exception $previous = null)
{
parent::__construct($message, $code, $previous);

Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Error/LightSamlContextException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LightSamlContextException extends LightSamlException
* @param int $code
* @param \Exception $previous
*/
public function __construct(ContextInterface $context, $message = '', $code = 0, \Exception $previous = null)
public function __construct(ContextInterface $context, $message = '', $code = 0, ?\Exception $previous = null)
{
parent::__construct($message, $code, $previous);

Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Meta/ParameterBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function add(array $parameters = [])
*
* @return mixed
*/
public function get($key, $default = null)
public function get($key, mixed $default = null)
{
return array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default;
}
Expand Down
14 changes: 7 additions & 7 deletions src/LightSaml/Meta/SigningOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class SigningOptions
private $certificateOptions;

/**
* @param XMLSecurityKey $privateKey
* @param X509Certificate $certificate
* @param XMLSecurityKey|null $privateKey
* @param X509Certificate|null $certificate
*/
public function __construct(XMLSecurityKey $privateKey = null, X509Certificate $certificate = null)
public function __construct(?XMLSecurityKey $privateKey = null, ?X509Certificate $certificate = null)
{
$this->enabled = true;
$this->privateKey = $privateKey;
Expand All @@ -52,11 +52,11 @@ public function getCertificate()
}

/**
* @param X509Certificate $certificate
* @param X509Certificate|null $certificate
*
* @return SigningOptions
*/
public function setCertificate(X509Certificate $certificate = null)
public function setCertificate(?X509Certificate $certificate = null)
{
$this->certificate = $certificate;

Expand All @@ -72,11 +72,11 @@ public function getPrivateKey()
}

/**
* @param XMLSecurityKey $privateKey
* @param XMLSecurityKey|null $privateKey
*
* @return SigningOptions
*/
public function setPrivateKey(XMLSecurityKey $privateKey = null)
public function setPrivateKey(?XMLSecurityKey $privateKey = null)
{
$this->privateKey = $privateKey;

Expand Down
6 changes: 3 additions & 3 deletions src/LightSaml/Model/AbstractSamlModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function createElement($name, $namespace, \DOMNode $parent, Serializat
*
* @throws \LogicException
*/
private function oneElementToXml($name, \DOMNode $parent, SerializationContext $context, $namespace = null)
private function oneElementToXml($name, \DOMNode $parent, SerializationContext $context, ?string $namespace = null)
{
$value = $this->getPropertyValue($name);
if (null == $value) {
Expand All @@ -65,7 +65,7 @@ private function oneElementToXml($name, \DOMNode $parent, SerializationContext $
* @param array|string[] $names
* @param string|null $namespace
*/
protected function singleElementsToXml(array $names, \DOMNode $parent, SerializationContext $context, $namespace = null)
protected function singleElementsToXml(array $names, \DOMNode $parent, SerializationContext $context, ?string $namespace = null)
{
foreach ($names as $name) {
$this->oneElementToXml($name, $parent, $context, $namespace);
Expand All @@ -79,7 +79,7 @@ protected function singleElementsToXml(array $names, \DOMNode $parent, Serializa
*
* @throws \LogicException
*/
protected function manyElementsToXml($value, \DOMNode $node, SerializationContext $context, $nodeName = null, $namespaceUri = null)
protected function manyElementsToXml($value, \DOMNode $node, SerializationContext $context, ?string $nodeName = null, ?string $namespaceUri = null)
{
if (false == $value) {
return;
Expand Down
6 changes: 3 additions & 3 deletions src/LightSaml/Model/Assertion/AbstractNameID.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ abstract class AbstractNameID extends AbstractSamlModel
protected $spProvidedId;

/**
* @param string $value
* @param string $format
* @param string|null $value
* @param string|null $format
*/
public function __construct($value = null, $format = null)
public function __construct(?string $value = null, ?string $format = null)
{
$this->value = $value;
$this->format = $format;
Expand Down
6 changes: 3 additions & 3 deletions src/LightSaml/Model/Assertion/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function hasAnySessionIndex()
/**
* @return Assertion
*/
public function setConditions(Conditions $conditions = null)
public function setConditions(?Conditions $conditions = null)
{
$this->conditions = $conditions;

Expand Down Expand Up @@ -223,7 +223,7 @@ public function getIssueInstantDateTime()
*
* @return Assertion
*/
public function setIssuer(Issuer $issuer = null)
public function setIssuer(?Issuer $issuer = null)
{
$this->issuer = $issuer;

Expand All @@ -243,7 +243,7 @@ public function getIssuer()
*
* @return Assertion
*/
public function setSignature(Signature $signature = null)
public function setSignature(?Signature $signature = null)
{
$this->signature = $signature;

Expand Down
6 changes: 3 additions & 3 deletions src/LightSaml/Model/Assertion/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Attribute extends AbstractSamlModel
protected $attributeValue;

/**
* @param string|null $name
* @param string|string[] $value
* @param string|null $name
* @param string|string[]|null $value
*/
public function __construct($name = null, $value = null)
public function __construct(?string $name = null, string|array|null $value = null)
{
$this->name = $name;
if ($value) {
Expand Down
4 changes: 2 additions & 2 deletions src/LightSaml/Model/Assertion/ProxyRestriction.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class ProxyRestriction extends AbstractCondition
protected $audience;

/**
* @param int $count
* @param int|null $count
* @param string[] $audience
*/
public function __construct($count = null, array $audience = null)
public function __construct(?int $count = null, ?array $audience = null)
{
$this->count = $count;
$this->audience = $audience;
Expand Down
2 changes: 1 addition & 1 deletion src/LightSaml/Model/Assertion/Subject.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Subject extends AbstractSamlModel
*
* @return Subject
*/
public function setNameID(NameID $nameId = null)
public function setNameID(?NameID $nameId = null)
{
$this->nameId = $nameId;

Expand Down
Loading