Skip to content

Commit be08136

Browse files
Merge pull request #3 from cloudbeds/feat/php-8.4
chore: bump PHP to ^8.4 and illuminate/collections to ^10|^11|^12
2 parents 1d071bb + d73fa17 commit be08136

8 files changed

Lines changed: 63 additions & 12 deletions

File tree

.github/workflows/tests.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- master
8+
- main
9+
- 'feat/**'
10+
- 'fix/**'
11+
- 'chore/**'
12+
pull_request:
13+
branches:
14+
- develop
15+
- master
16+
- main
17+
18+
jobs:
19+
tests:
20+
name: PHP ${{ matrix.php-version }}
21+
runs-on: ubuntu-latest
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
php-version:
27+
- '8.2'
28+
- '8.4'
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: ${{ matrix.php-version }}
38+
coverage: none
39+
tools: composer:v2
40+
41+
- name: Validate composer.json
42+
run: composer validate --no-check-publish --no-check-lock
43+
44+
- name: Install dependencies
45+
run: composer update --prefer-dist --no-interaction --no-progress
46+
47+
- name: Lint PHP source
48+
run: find src -name '*.php' -print0 | xargs -0 -n1 -P4 php -l
49+
50+
- name: Check autoloader
51+
run: php -r "require 'vendor/autoload.php'; class_exists('Okta\\\\Client') or exit(1);"

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.3 | ^8.0",
13+
"php": "^8.2 || ^8.4",
1414
"psr/http-message": "^1.0",
1515
"php-http/client-common": "^2.2",
1616
"php-http/httplug": "^2.2",
@@ -19,7 +19,7 @@
1919
"php-http/curl-client": "^2.2",
2020
"symfony/yaml": "^3.2|^4.3|^5.0",
2121
"nesbot/carbon": "^2.0",
22-
"illuminate/collections": "^8.29.0",
22+
"illuminate/collections": "^10.0 || ^11.0 || ^12.0",
2323
"guzzlehttp/psr7": "^1.7.0",
2424
"psr/cache": "^1.0",
2525
"league/flysystem-memory": "^1.0",

src/Cache/MemoryManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class MemoryManager extends CacheManager
2626
{
2727

28-
public function __construct(AbstractAdapter $adapter = null)
28+
public function __construct(?AbstractAdapter $adapter = null)
2929
{
3030
if(null === $adapter) {
3131
$adapter = new MemoryAdapter();

src/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ class Client
8181
public function __construct(
8282
string $token,
8383
string $organizationUrl,
84-
HttpClient $httpClient = null,
84+
?HttpClient $httpClient = null,
8585
string $integrationUserAgent = null,
86-
CacheManager $cacheManager = null,
87-
AuthorizationMode $authorizationMode = null
86+
?CacheManager $cacheManager = null,
87+
?AuthorizationMode $authorizationMode = null
8888
) {
8989
$this->token = $token;
9090
$this->organizationUrl = $organizationUrl;

src/DataStore/DefaultDataStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class DefaultDataStore
8989
* @param HttpClient|NULL $httpClient
9090
* @param AuthorizationMode|NULL $authorizationMode
9191
*/
92-
public function __construct(string $token, string $organizationUrl, HttpClient $httpClient = null, AuthorizationMode $authorizationMode = null)
92+
public function __construct(string $token, string $organizationUrl, ?HttpClient $httpClient = null, ?AuthorizationMode $authorizationMode = null)
9393
{
9494
$this->token = $token;
9595
$this->organizationUrl = $organizationUrl;
@@ -121,7 +121,7 @@ public function __construct(string $token, string $organizationUrl, HttpClient $
121121
* @param array $options Any options you want to set.
122122
* @return object
123123
*/
124-
public function instantiate(string $class, \stdClass $properties = null, array $options = [])
124+
public function instantiate(string $class, ?\stdClass $properties = null, array $options = [])
125125
{
126126
$propertiesArr = array($properties, $options);
127127

src/Exceptions/ResourceException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ResourceException extends GeneralException
2323
{
2424
private $error;
2525

26-
public function __construct(Error $error, Throwable $previous = null)
26+
public function __construct(Error $error, ?Throwable $previous = null)
2727
{
2828
$this->error = $error;
2929
$message = $error->getErrorSummary() ?: '';

src/Okta.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Okta
3030

3131
const VERSION = '1.3.0';
3232

33-
public function __construct(Client $client = null, DefaultDataStore $dataStore = null)
33+
public function __construct(?Client $client = null, ?DefaultDataStore $dataStore = null)
3434
{
3535
$this->client = $client ?: Client::getInstance();
3636
$this->dataStore = $dataStore ?: $this->client->getDataStore();

src/Resource/AbstractResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract class AbstractResource
6565
* @param \stdClass|NULL $properties Properties for the resource.
6666
* @param array $options Options to use on the resource.
6767
*/
68-
public function __construct(DefaultDataStore $dataStore = null, \stdClass $properties = null, array $options = [])
68+
public function __construct(?DefaultDataStore $dataStore = null, ?\stdClass $properties = null, array $options = [])
6969
{
7070
$this->dataStore = $dataStore ?: Client::getInstance()->getDataStore();
7171
$this->setProperties($properties);
@@ -90,7 +90,7 @@ public function getHref()
9090
* @param \stdClass|NULL $properties the properties to set.
9191
* @return self
9292
*/
93-
public function setProperties(\stdClass $properties = null): self
93+
public function setProperties(?\stdClass $properties = null): self
9494
{
9595
$this->dirty = false;
9696

0 commit comments

Comments
 (0)