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
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests

on:
push:
branches:
- develop
- master
- main
- 'feat/**'
- 'fix/**'
- 'chore/**'
pull_request:
branches:
- develop
- master
- main

jobs:
tests:
name: PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- '8.2'
- '8.4'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: none
tools: composer:v2

- name: Validate composer.json
run: composer validate --no-check-publish --no-check-lock

- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress

- name: Lint PHP source
run: find src -name '*.php' -print0 | xargs -0 -n1 -P4 php -l

- name: Check autoloader
run: php -r "require 'vendor/autoload.php'; class_exists('Okta\\\\Client') or exit(1);"
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^7.3 | ^8.0",
"php": "^8.2 || ^8.4",
"psr/http-message": "^1.0",
"php-http/client-common": "^2.2",
"php-http/httplug": "^2.2",
Expand All @@ -19,7 +19,7 @@
"php-http/curl-client": "^2.2",
"symfony/yaml": "^3.2|^4.3|^5.0",
"nesbot/carbon": "^2.0",
"illuminate/collections": "^8.29.0",
"illuminate/collections": "^10.0 || ^11.0 || ^12.0",
"guzzlehttp/psr7": "^1.7.0",
"psr/cache": "^1.0",
"league/flysystem-memory": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/MemoryManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class MemoryManager extends CacheManager
{

public function __construct(AbstractAdapter $adapter = null)
public function __construct(?AbstractAdapter $adapter = null)
{
if(null === $adapter) {
$adapter = new MemoryAdapter();
Expand Down
6 changes: 3 additions & 3 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ class Client
public function __construct(
string $token,
string $organizationUrl,
HttpClient $httpClient = null,
?HttpClient $httpClient = null,
string $integrationUserAgent = null,
CacheManager $cacheManager = null,
AuthorizationMode $authorizationMode = null
?CacheManager $cacheManager = null,
?AuthorizationMode $authorizationMode = null
) {
$this->token = $token;
$this->organizationUrl = $organizationUrl;
Expand Down
4 changes: 2 additions & 2 deletions src/DataStore/DefaultDataStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DefaultDataStore
* @param HttpClient|NULL $httpClient
* @param AuthorizationMode|NULL $authorizationMode
*/
public function __construct(string $token, string $organizationUrl, HttpClient $httpClient = null, AuthorizationMode $authorizationMode = null)
public function __construct(string $token, string $organizationUrl, ?HttpClient $httpClient = null, ?AuthorizationMode $authorizationMode = null)
{
$this->token = $token;
$this->organizationUrl = $organizationUrl;
Expand Down Expand Up @@ -121,7 +121,7 @@ public function __construct(string $token, string $organizationUrl, HttpClient $
* @param array $options Any options you want to set.
* @return object
*/
public function instantiate(string $class, \stdClass $properties = null, array $options = [])
public function instantiate(string $class, ?\stdClass $properties = null, array $options = [])
{
$propertiesArr = array($properties, $options);

Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/ResourceException.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ResourceException extends GeneralException
{
private $error;

public function __construct(Error $error, Throwable $previous = null)
public function __construct(Error $error, ?Throwable $previous = null)
{
$this->error = $error;
$message = $error->getErrorSummary() ?: '';
Expand Down
2 changes: 1 addition & 1 deletion src/Okta.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Okta

const VERSION = '1.3.0';

public function __construct(Client $client = null, DefaultDataStore $dataStore = null)
public function __construct(?Client $client = null, ?DefaultDataStore $dataStore = null)
{
$this->client = $client ?: Client::getInstance();
$this->dataStore = $dataStore ?: $this->client->getDataStore();
Expand Down
4 changes: 2 additions & 2 deletions src/Resource/AbstractResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ abstract class AbstractResource
* @param \stdClass|NULL $properties Properties for the resource.
* @param array $options Options to use on the resource.
*/
public function __construct(DefaultDataStore $dataStore = null, \stdClass $properties = null, array $options = [])
public function __construct(?DefaultDataStore $dataStore = null, ?\stdClass $properties = null, array $options = [])
{
$this->dataStore = $dataStore ?: Client::getInstance()->getDataStore();
$this->setProperties($properties);
Expand All @@ -90,7 +90,7 @@ public function getHref()
* @param \stdClass|NULL $properties the properties to set.
* @return self
*/
public function setProperties(\stdClass $properties = null): self
public function setProperties(?\stdClass $properties = null): self
{
$this->dirty = false;

Expand Down
Loading