Skip to content
Open
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
31 changes: 30 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,36 @@ jobs:

- run: composer test

php8-4:
name: Unit Tests php8.4 (php ${{ matrix.php-version }})
runs-on: ubuntu-latest
# always run on push events
# only run on pull_request_target event when pull request pulls from fork repository
if: >
github.event_name == 'push' ||
github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
strategy:
fail-fast: false
matrix:
php-version: [ 8.4 ]

steps:
- uses: actions/checkout@v2

- uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-version }}

# Remove php-cs-fixer until compatible with PHP 8
# This step might be removable if php-cs-fixer is compatible with 8.4 by the time this runs
- run: composer remove --dev --no-update --no-interaction friendsofphp/php-cs-fixer

- run: composer self-update

- run: composer install --no-interaction --prefer-source --dev

- run: composer test

php7-4:
name: Unit Tests php7.4 (php ${{ matrix.php-version }})
runs-on: ubuntu-latest
Expand Down Expand Up @@ -109,4 +139,3 @@ jobs:
- run: composer install --no-interaction --prefer-source --dev

- run: composer test

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"homepage": "https://yoti.com",
"license": "MIT",
"require": {
"php": "^7.4 || ^8.0 || ^8.1",
"php": "^7.4 || ^8.0 || ^8.1 || ^8.4",
"ext-json": "*",
"google/protobuf": "^3.10",
"phpseclib/phpseclib": "^3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Aml/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Profile implements \JsonSerializable
* @param \Yoti\Aml\Address $amlAddress
* @param null|string $ssn
*/
public function __construct($givenNames, $familyName, Address $amlAddress, string $ssn = null)
public function __construct(string $givenNames, string $familyName, Address $amlAddress, ?string $ssn = null)
{
$this->givenNames = $givenNames;
$this->familyName = $familyName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RequestedLivenessConfig implements RequestedCheckConfigInterface
*/
private $manualCheck;

public function __construct(string $livenessType, int $maxRetries, string $manualCheck = null)
public function __construct(string $livenessType, int $maxRetries, ?string $manualCheck = null)
{
$this->livenessType = $livenessType;
$this->maxRetries = $maxRetries;
Expand Down
2 changes: 1 addition & 1 deletion src/DocScan/Session/Create/ImportTokenBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ImportTokenBuilder

private int $ttl;

public function withTtl(int $ttl = null): ImportTokenBuilder
public function withTtl(?int $ttl = null): ImportTokenBuilder
{
$this->ttl = $ttl ?? self::DEFAULT_TTL;

Expand Down
6 changes: 3 additions & 3 deletions src/DocScan/Session/Create/SdkConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ class SdkConfig implements \JsonSerializable
* @var string|null
*/
private $darkMode;

/**
* @var string|null
*/
private $primaryColourDarkMode;

/**
* @var string|null
*/
Expand Down Expand Up @@ -263,7 +263,7 @@ public function getDarkMode(): ?string
{
return $this->darkMode;
}

/**
* @return string|null
*/
Expand Down
4 changes: 2 additions & 2 deletions src/DocScan/Session/Create/SdkConfigBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class SdkConfigBuilder
* @var string|null
*/
private $darkMode;

/**
* @var string|null
*/
Expand Down Expand Up @@ -161,7 +161,7 @@ public function withBiometricConsentFlow(string $biometricConsentFlow): self
$this->biometricConsentFlow = $biometricConsentFlow;
return $this;
}

/**
* Allows configuring the number of attempts permitted for text extraction on an ID document
*
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/ActivityDetailsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
$message = "",
?ResponseInterface $response = null,
?array $responseBody = null,
\Throwable $previous = null
?\Throwable $previous = null
) {
parent::__construct($message, $response, $previous);

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/base/YotiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class YotiException extends \Exception
* @param ResponseInterface|null $response
* @param \Throwable|null $previous
*/
public function __construct($message = "", ?ResponseInterface $response = null, \Throwable $previous = null)
public function __construct($message = "", ?ResponseInterface $response = null, ?\Throwable $previous = null)
{
parent::__construct($this->formatMessage($message, $response), 0, $previous);

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Exception/NetworkException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NetworkException extends ClientException implements NetworkExceptionInterf
public function __construct(
string $message,
RequestInterface $request,
\Throwable $previous = null
?\Throwable $previous = null
) {
$this->setRequest($request);
parent::__construct($message, 0, $previous);
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Exception/RequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RequestException extends ClientException implements RequestExceptionInterf
public function __construct(
string $message,
RequestInterface $request,
\Throwable $previous = null
?\Throwable $previous = null
) {
$this->setRequest($request);
parent::__construct($message, 0, $previous);
Expand Down
4 changes: 2 additions & 2 deletions src/Http/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class RequestBuilder
private $multipartEntity;

/**
* @param \Yoti\Util\Config $config
* @param \Yoti\Util\Config|null $config
*/
public function __construct(Config $config = null)
public function __construct(?Config $config = null)
{
$this->config = $config ?? new Config();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http/RequestSigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function sign(
PemFile $pemFile,
string $endpoint,
string $httpMethod,
Payload $payload = null
?Payload $payload = null
): string {
$messageToSign = "{$httpMethod}&$endpoint";
if ($payload instanceof Payload) {
Expand Down
2 changes: 1 addition & 1 deletion src/Identity/Content/ApplicationContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ApplicationContent
private ?ApplicationProfile $profile;
private ?ExtraData $extraData;

public function __construct(ApplicationProfile $profile = null, ExtraData $extraData = null)
public function __construct(?ApplicationProfile $profile = null, ?ExtraData $extraData = null)
{
$this->profile = $profile;
$this->extraData = $extraData;
Expand Down
2 changes: 1 addition & 1 deletion src/Identity/Content/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Content
private ?string $profile;
private ?string $extraData;

public function __construct(string $profile = null, string $extraData = null)
public function __construct(?string $profile = null, ?string $extraData = null)
{
$this->profile = $profile;
$this->extraData = $extraData;
Expand Down
2 changes: 1 addition & 1 deletion src/Identity/Content/UserContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class UserContent
private ?UserProfile $profile;
private ?ExtraData $extraData;

public function __construct(UserProfile $profile = null, ExtraData $extraData = null)
public function __construct(?UserProfile $profile = null, ?ExtraData $extraData = null)
{
$this->profile = $profile;
$this->extraData = $extraData;
Expand Down
38 changes: 19 additions & 19 deletions src/Identity/Policy/PolicyBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public function withWantedAttribute(WantedAttribute $wantedAttribute): self
*/
public function withWantedAttributeByName(
string $name,
array $constraints = null,
bool $acceptSelfAsserted = null
?array $constraints = null,
?bool $acceptSelfAsserted = null
): self {
$wantedAttributeBuilder = (new WantedAttributeBuilder())
->withName($name);
Expand All @@ -71,7 +71,7 @@ public function withWantedAttributeByName(
/**
* @param Constraint[]|null $constraints
*/
public function withFamilyName(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withFamilyName(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_FAMILY_NAME,
Expand All @@ -83,7 +83,7 @@ public function withFamilyName(array $constraints = null, bool $acceptSelfAssert
/**
* @param Constraint[]|null $constraints
*/
public function withGivenNames(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withGivenNames(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_GIVEN_NAMES,
Expand All @@ -95,7 +95,7 @@ public function withGivenNames(array $constraints = null, bool $acceptSelfAssert
/**
* @param Constraint[]|null $constraints
*/
public function withFullName(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withFullName(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_FULL_NAME,
Expand All @@ -107,7 +107,7 @@ public function withFullName(array $constraints = null, bool $acceptSelfAsserted
/**
* @param Constraint[]|null $constraints
*/
public function withDateOfBirth(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withDateOfBirth(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_DATE_OF_BIRTH,
Expand All @@ -119,7 +119,7 @@ public function withDateOfBirth(array $constraints = null, bool $acceptSelfAsser
/**
* @param Constraint[]|null $constraints
*/
public function withAgeOver(int $age, array $constraints = null, bool $acceptSelfAsserted = null): self
public function withAgeOver(int $age, ?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withAgeDerivedAttribute(
UserProfile::AGE_OVER . $age,
Expand All @@ -131,7 +131,7 @@ public function withAgeOver(int $age, array $constraints = null, bool $acceptSel
/**
* @param Constraint[]|null $constraints
*/
public function withAgeUnder(int $age, array $constraints = null, bool $acceptSelfAsserted = null): self
public function withAgeUnder(int $age, ?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withAgeDerivedAttribute(
UserProfile::AGE_UNDER . $age,
Expand All @@ -145,8 +145,8 @@ public function withAgeUnder(int $age, array $constraints = null, bool $acceptSe
*/
public function withAgeDerivedAttribute(
string $derivation,
array $constraints = null,
bool $acceptSelfAsserted = null
?array $constraints = null,
?bool $acceptSelfAsserted = null
): self {
$wantedAttributeBuilder = (new WantedAttributeBuilder())
->withName(UserProfile::ATTR_DATE_OF_BIRTH)
Expand All @@ -166,7 +166,7 @@ public function withAgeDerivedAttribute(
/**
* @param Constraint[]|null $constraints
*/
public function withGender(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withGender(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_GENDER,
Expand All @@ -178,7 +178,7 @@ public function withGender(array $constraints = null, bool $acceptSelfAsserted =
/**
* @param Constraint[]|null $constraints
*/
public function withPostalAddress(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withPostalAddress(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_POSTAL_ADDRESS,
Expand All @@ -190,7 +190,7 @@ public function withPostalAddress(array $constraints = null, bool $acceptSelfAss
/**
* @param Constraint[]|null $constraints
*/
public function withStructuredPostalAddress(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withStructuredPostalAddress(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_STRUCTURED_POSTAL_ADDRESS,
Expand All @@ -202,7 +202,7 @@ public function withStructuredPostalAddress(array $constraints = null, bool $acc
/**
* @param Constraint[]|null $constraints
*/
public function withNationality(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withNationality(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_NATIONALITY,
Expand All @@ -214,7 +214,7 @@ public function withNationality(array $constraints = null, bool $acceptSelfAsser
/**
* @param Constraint[]|null $constraints
*/
public function withPhoneNumber(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withPhoneNumber(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_PHONE_NUMBER,
Expand All @@ -226,7 +226,7 @@ public function withPhoneNumber(array $constraints = null, bool $acceptSelfAsser
/**
* @param Constraint[]|null $constraints
*/
public function withSelfie(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withSelfie(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_SELFIE,
Expand All @@ -238,7 +238,7 @@ public function withSelfie(array $constraints = null, bool $acceptSelfAsserted =
/**
* @param Constraint[]|null $constraints
*/
public function withDocumentDetails(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withDocumentDetails(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_DOCUMENT_DETAILS,
Expand All @@ -250,7 +250,7 @@ public function withDocumentDetails(array $constraints = null, bool $acceptSelfA
/**
* @param Constraint[]|null $constraints
*/
public function withDocumentImages(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withDocumentImages(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_DOCUMENT_IMAGES,
Expand All @@ -262,7 +262,7 @@ public function withDocumentImages(array $constraints = null, bool $acceptSelfAs
/**
* @param Constraint[]|null $constraints
*/
public function withEmail(array $constraints = null, bool $acceptSelfAsserted = null): self
public function withEmail(?array $constraints = null, ?bool $acceptSelfAsserted = null): self
{
return $this->withWantedAttributeByName(
UserProfile::ATTR_EMAIL_ADDRESS,
Expand Down
6 changes: 3 additions & 3 deletions src/Identity/Policy/WantedAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class WantedAttribute implements \JsonSerializable
*/
public function __construct(
string $name,
string $derivation = null,
?string $derivation = null,
bool $optional = false,
bool $acceptSelfAsserted = null,
array $constraints = null
?bool $acceptSelfAsserted = null,
?array $constraints = null
) {
Validation::notEmptyString($name, 'name');
$this->name = $name;
Expand Down
Loading
Loading