Skip to content

Commit

Permalink
Start testing PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Dec 2, 2024
1 parent 2812446 commit 16d7725
Show file tree
Hide file tree
Showing 90 changed files with 103 additions and 103 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Should be the higest supported version, so we can use the newest tools
php-version: '8.3'
php-version: '8.4'
tools: composer, composer-require-checker, composer-unused, phpcs
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, soap, spl, xml
coverage: none
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Setup PHP, with composer and extensions
Expand Down Expand Up @@ -185,15 +185,15 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Run unit tests with coverage
if: ${{ matrix.php-versions == '8.3' }}
if: ${{ matrix.php-versions == '8.4' }}
run: vendor/bin/phpunit

- name: Run unit tests (no coverage)
if: ${{ matrix.php-versions != '8.3' }}
if: ${{ matrix.php-versions != '8.4' }}
run: vendor/bin/phpunit --no-coverage

- name: Save coverage data
if: ${{ matrix.php-versions == '8.3' }}
if: ${{ matrix.php-versions == '8.4' }}
uses: actions/upload-artifact@v4
with:
name: coverage-data
Expand All @@ -207,7 +207,7 @@ jobs:
fail-fast: true
matrix:
operating-system: [windows-latest]
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.1', '8.2', '8.3', '8.4']

steps:
- name: Setup PHP, with composer and extensions
Expand Down
4 changes: 2 additions & 2 deletions src/Binding.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getDestination(): ?string
*
* @param string|null $relayState The RelayState.
*/
public function setRelayState(string $relayState = null): void
public function setRelayState(?string $relayState = null): void
{
$this->relayState = $relayState;
}
Expand All @@ -185,7 +185,7 @@ public function getRelayState(): ?string
*
* @param string|null $destination The destination the message should be delivered to.
*/
public function setDestination(string $destination = null): void
public function setDestination(?string $destination = null): void
{
$this->destination = $destination;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Certificate/KeyLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct()
*/
public static function extractPublicKeys(
CertificateProvider $config,
string $usage = null,
?string $usage = null,
bool $required = false,
): KeyCollection {
$keyLoader = new self();
Expand All @@ -63,7 +63,7 @@ public static function extractPublicKeys(
*/
public function loadKeysFromConfiguration(
CertificateProvider $config,
string $usage = null,
?string $usage = null,
bool $required = false,
): KeyCollection {
$keys = $config->getKeys();
Expand Down Expand Up @@ -96,7 +96,7 @@ public function loadKeysFromConfiguration(
* @param array|\Traversable $configuredKeys
* @param string|null $usage
*/
public function loadKeys($configuredKeys, string $usage = null): void
public function loadKeys($configuredKeys, ?string $usage = null): void
{
foreach ($configuredKeys as $keyData) {
if (isset($keyData['X509Certificate'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/Certificate/PrivateKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PrivateKey extends Key
* @throws \SimpleSAML\SAML2\Exception\InvalidArgumentException
* @return \SimpleSAML\SAML2\Certificate\PrivateKey
*/
public static function create(string $keyContents, string $passphrase = null): PrivateKey
public static function create(string $keyContents, ?string $passphrase = null): PrivateKey
{
$keyData = ['PEM' => $keyContents, self::USAGE_ENCRYPTION => true];
if ($passphrase) {
Expand Down
2 changes: 1 addition & 1 deletion src/Compat/AbstractContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ abstract public function getTempDir(): string;
* @param string $data The data we should write to the file.
* @param int|null $mode The permissions to apply to the file. Defaults to 0600.
*/
abstract public function writeFile(string $filename, string $data, int $mode = null): void;
abstract public function writeFile(string $filename, string $data, ?int $mode = null): void;


/**
Expand Down
4 changes: 2 additions & 2 deletions src/Compat/MockContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function debugMessage($message, string $type): void
* @return string
*/
public function getPOSTRedirectURL(
/** @scrutinizer ignore-unused */string $url = null,
/** @scrutinizer ignore-unused */?string $url = null,
/** @scrutinizer ignore-unused */array $data = [],
): string {
return strval($url);
Expand All @@ -82,7 +82,7 @@ public function getTempDir(): string
* @param string $data
* @param int|null $mode
*/
public function writeFile(string $filename, string $data, int $mode = null): void
public function writeFile(string $filename, string $data, ?int $mode = null): void
{
if ($mode === null) {
$mode = 0600;
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/DecryptionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getSharedKey(): ?string;
*
* @return mixed
*/
public function getPrivateKey(string $name, bool $required = null);
public function getPrivateKey(string $name, ?bool $required = null);



Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/IdentityProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getSharedKey(): ?string
* @param bool $required
* @return mixed|null
*/
public function getPrivateKey(string $name, bool $required = null)
public function getPrivateKey(string $name, ?bool $required = null)
{
if ($required === null) {
$required = false;
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function getSharedKey(): ?string
* @param bool $required
* @return mixed|null
*/
public function getPrivateKey(string $name, bool $required = null)
public function getPrivateKey(string $name, ?bool $required = null)
{
if ($required === null) {
$required = false;
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/ProtocolViolationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
class ProtocolViolationException extends RuntimeException
{
/**
* @param string $message
* @param string|null $message
*/
public function __construct(string $message = null)
public function __construct(?string $message = null)
{
if ($message === null) {
if (defined('static::DEFAULT_MESSAGE')) {
Expand Down
2 changes: 1 addition & 1 deletion src/SOAPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SOAPClient
public function send(
AbstractMessage $msg,
Configuration $srcMetadata,
Configuration $dstMetadata = null,
?Configuration $dstMetadata = null,
): AbstractMessage {
$issuer = $msg->getIssuer();

Expand Down
2 changes: 1 addition & 1 deletion src/XML/EncryptedElementTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static function fromXML(DOMElement $xml): static
/**
* @inheritDoc
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$this->encryptedData->toXML($e);
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ExtensionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function isEmptyElement(): bool
* @param \DOMElement|null $parent The element we should add this Extensions element to.
* @return \DOMElement The new md:Extensions XML element.
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/alg/DigestMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('Algorithm', $this->getAlgorithm());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/alg/SigningMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ecp/RelayState.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttributeNS(C::NS_SOAP_ENV_11, 'env:mustUnderstand', '1');
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ecp/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttributeNS(C::NS_SOAP_ENV_11, 'env:mustUnderstand', '1');
Expand Down
2 changes: 1 addition & 1 deletion src/XML/ecp/RequestAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ecp/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$response = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/ecp/SubjectConfirmation.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this element to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttributeNS(C::NS_SOAP_ENV_11, 'env:mustUnderstand', '1');
Expand Down
2 changes: 1 addition & 1 deletion src/XML/emd/RepublishRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/AbstractEndpointType.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement $parent The element we should append this endpoint to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = parent::instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/AbstractIndexedEndpointType.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement $parent The element we should append this endpoint to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = parent::instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/AbstractLocalizedName.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent
* @return \DOMElement
*/
final public function toXML(DOMElement $parent = null): DOMElement
final public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttributeNS(C::NS_XML, 'xml:lang', $this->getLanguage());
Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/AbstractMetadataDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected function getOriginalXML(): DOMElement
*
* @return \DOMElement
*/
public function toUnsignedXML(DOMElement $parent = null): DOMElement
public function toUnsignedXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/AbstractSSODescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function getNameIDFormat(): array
* @param \DOMElement|null $parent The EntityDescriptor we should append this SSODescriptorType to.
* @return \DOMElement The generated SSODescriptor DOMElement.
*/
public function toUnsignedXML(DOMElement $parent = null): DOMElement
public function toUnsignedXML(?DOMElement $parent = null): DOMElement
{
$e = parent::toUnsignedXML($parent);

Expand Down
4 changes: 2 additions & 2 deletions src/XML/md/AbstractSignedMdElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function setXML(DOMElement $xml): void
* @return \DOMElement
* @throws \Exception
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
if ($this->isSigned() === true && $this->signer === null) {
// We already have a signed document and no signer was set to re-sign it
Expand Down Expand Up @@ -100,5 +100,5 @@ public function toXML(DOMElement $parent = null): DOMElement
* @param \DOMElement|null $parent
* @return \DOMElement
*/
abstract public function toUnsignedXML(DOMElement $parent = null): DOMElement;
abstract public function toUnsignedXML(?DOMElement $parent = null): DOMElement;
}
2 changes: 1 addition & 1 deletion src/XML/md/AdditionalMetadataLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append to.
* @return \DOMElement This AdditionalMetadataLocation-element.
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->textContent = $this->getContent();
Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/AttributeConsumingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function getRequestedAttribute(): array
* @param \DOMElement $parent The element we should append this AttributeConsumingService to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);
$e->setAttribute('index', strval($this->getIndex()));
Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/AuthnAuthorityDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct(
array $protocolSupportEnumeration,
protected array $assertionIDRequestService = [],
protected array $nameIDFormat = [],
string $ID = null,
?string $ID = null,
?DateTimeImmutable $validUntil = null,
?string $cacheDuration = null,
?Extensions $extensions = null,
Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/ContactPerson.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public static function fromXML(DOMElement $xml): static
*
* @return \DOMElement The new ContactPerson-element.
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/EntityDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(
?string $id = null,
?DateTimeImmutable $validUntil = null,
?string $cacheDuration = null,
Extensions $extensions = null,
?Extensions $extensions = null,
protected array $roleDescriptor = [],
protected ?AffiliationDescriptor $affiliationDescriptor = null,
protected ?Organization $organization = null,
Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/KeyDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this KeyDescriptor to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/Organization.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should add this organization to.
* @return \DOMElement This Organization-element.
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = $this->instantiateParentElement($parent);

Expand Down
2 changes: 1 addition & 1 deletion src/XML/md/RequestedAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static function fromXML(DOMElement $xml): static
* @param \DOMElement|null $parent The element we should append this RequestedAttribute to.
* @return \DOMElement
*/
public function toXML(DOMElement $parent = null): DOMElement
public function toXML(?DOMElement $parent = null): DOMElement
{
$e = parent::toXML($parent);

Expand Down
Loading

0 comments on commit 16d7725

Please sign in to comment.