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
4 changes: 2 additions & 2 deletions lib/AuditLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class AuditLogs
*
* @return Resource\AuditLogCreateEventStatus
*/
public function createEvent($organizationId, $event, $idempotencyKey = null)
public function createEvent($organizationId, $event, ?string $idempotencyKey = null)
{
$eventsPath = "audit_logs/events";

Expand Down Expand Up @@ -73,7 +73,7 @@ public function createEvent($organizationId, $event, $idempotencyKey = null)
* @return Resource\AuditLogExport
*/

public function createExport($organizationId, $rangeStart, $rangeEnd, $actions = null, $actors = null, $targets = null, $actorNames = null, $actorIds = null)
public function createExport($organizationId, $rangeStart, $rangeEnd, ?array $actions = null, ?array $actors = null, ?array $targets = null, ?array $actorNames = null, ?array $actorIds = null)
{
$createExportPath = "audit_logs/exports";

Expand Down
4 changes: 2 additions & 2 deletions lib/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function setRequestClient($requestClient)
*
* @return array<string, mixed>
*/
public static function request($method, $path, $headers = null, $params = null, $withAuth = false)
public static function request($method, $path, ?array $headers = null, ?array $params = null, $withAuth = false)
{
$url = self::generateUrl($path);

Expand Down Expand Up @@ -105,7 +105,7 @@ public static function generateBaseHeaders($withAuth = false)
*
* @return string
*/
public static function generateUrl($path, $params = null)
public static function generateUrl($path, ?array $params = null)
{
$url = WorkOS::getApiBaseUrl() . $path;

Expand Down
32 changes: 16 additions & 16 deletions lib/DirectorySync.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class DirectorySync
* @return array{?string, ?string, Resource\Directory[]} An array containing the Directory ID to use as before and after cursor, and an array of Directory instances
*/
public function listDirectories(
$domain = null,
$search = null,
?string $domain = null,
?string $search = null,
$limit = self::DEFAULT_PAGE_SIZE,
$before = null,
$after = null,
$organizationId = null,
$order = null
?string $before = null,
?string $after = null,
?string $organizationId = null,
?string $order = null
) {
$directoriesPath = "directories";
$params = [
Expand Down Expand Up @@ -78,12 +78,12 @@ public function listDirectories(
* @return array{?string, ?string, Resource\DirectoryGroup[]} An array containing the Directory Group ID to use as before and after cursor, and an array of Directory Group instances
*/
public function listGroups(
$directory = null,
$user = null,
?string $directory = null,
?string $user = null,
$limit = self::DEFAULT_PAGE_SIZE,
$before = null,
$after = null,
$order = null
?string $before = null,
?string $after = null,
?string $order = null
) {
$groupsPath = "directory_groups";

Expand Down Expand Up @@ -156,12 +156,12 @@ public function getGroup($directoryGroup)
* @throws Exception\WorkOSException
*/
public function listUsers(
$directory = null,
$group = null,
?string $directory = null,
?string $group = null,
$limit = self::DEFAULT_PAGE_SIZE,
$before = null,
$after = null,
$order = null
?string $before = null,
?string $after = null,
?string $order = null
) {
$usersPath = "directory_users";

Expand Down
2 changes: 1 addition & 1 deletion lib/Exception/BaseRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class BaseRequestException extends \Exception implements WorkOSException
* @param Response $response
* @param null|string $message Exception message
*/
public function __construct($response, $message = null)
public function __construct($response, ?string $message = null)
{
$this->response = $response;

Expand Down
2 changes: 1 addition & 1 deletion lib/Exception/GenericException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class GenericException extends \Exception implements WorkOSException
* @param string $message Exception message
* @param null|array $data Blob
*/
public function __construct($message, $data = null)
public function __construct($message, ?array $data = null)
{
$this->message = $message;

Expand Down
8 changes: 4 additions & 4 deletions lib/MFA.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class MFA
*/
public function enrollFactor(
$type,
$totpIssuer = null,
$totpUser = null,
$phoneNumber = null
?string $totpIssuer = null,
?string $totpUser = null,
?string $phoneNumber = null
) {
$enrollPath = "auth/factors/enroll";

Expand Down Expand Up @@ -79,7 +79,7 @@ public function enrollFactor(
*/
public function challengeFactor(
$authenticationFactorId,
$smsTemplate = null
?string $smsTemplate = null
) {
if (!isset($authenticationFactorId)) {
$msg = "Incomplete arguments: 'authentication_factor_id' is a required parameter";
Expand Down
34 changes: 17 additions & 17 deletions lib/Organizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class Organizations
* @throws Exception\WorkOSException
*/
public function listOrganizations(
$domains = null,
?array $domains = null,
$limit = self::DEFAULT_PAGE_SIZE,
$before = null,
$after = null,
$order = null
?string $before = null,
?string $after = null,
?string $order = null
) {
$organizationsPath = "organizations";
$params = [
Expand Down Expand Up @@ -76,12 +76,12 @@ public function listOrganizations(
*/
public function createOrganization(
$name,
$domains = null,
$allowProfilesOutsideOrganization = null,
$idempotencyKey = null,
$domain_data = null,
$externalId = null,
$metadata = null
?array $domains = null,
?bool $allowProfilesOutsideOrganization = null,
?string $idempotencyKey = null,
?array $domain_data = null,
?string $externalId = null,
?array $metadata = null
) {
$idempotencyKey ? $headers = array("Idempotency-Key: $idempotencyKey") : $headers = null;
$organizationsPath = "organizations";
Expand Down Expand Up @@ -126,13 +126,13 @@ public function createOrganization(
*/
public function updateOrganization(
$organization,
$domains = null,
$name = null,
$allowProfilesOutsideOrganization = null,
$domain_data = null,
$stripeCustomerId = null,
$externalId = null,
$metadata = null
?array $domains = null,
?string $name = null,
?bool $allowProfilesOutsideOrganization = null,
?array $domain_data = null,
?string $stripeCustomerId = null,
?string $externalId = null,
?array $metadata = null
) {
$organizationsPath = "organizations/{$organization}";

Expand Down
2 changes: 1 addition & 1 deletion lib/Portal.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Portal
*
* @return Resource\PortalLink
*/
public function generateLink($organization, $intent, $returnUrl = null, $successUrl = null)
public function generateLink($organization, $intent, ?string $returnUrl = null, ?string $successUrl = null)
{
$generateLinkPath = "portal/generate_link";
$params = [
Expand Down
2 changes: 1 addition & 1 deletion lib/RequestClient/CurlRequestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CurlRequestClient implements RequestClientInterface
*
* @return array An array composed of the result string, response headers and status code
*/
public function request($method, $url, $headers = null, $params = null)
public function request($method, $url, ?array $headers = null, ?array $params = null)
{
if (empty($headers)) {
$headers = array();
Expand Down
2 changes: 1 addition & 1 deletion lib/RequestClient/RequestClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ interface RequestClientInterface
*
* @return array An array composed of the result string, response headers and status code
*/
public function request($method, $url, $headers, $params);
public function request($method, $url, ?array $headers = null, ?array $params = null);
}
2 changes: 1 addition & 1 deletion lib/Resource/WebhookResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class WebhookResponse
* @return self
* @throws \InvalidArgumentException
*/
public static function create($type, $secret, $verdict, $errorMessage = null)
public static function create($type, $secret, $verdict, ?string $errorMessage = null)
{
if (!in_array($type, [self::USER_REGISTRATION_ACTION, self::AUTHENTICATION_ACTION])) {
throw new \InvalidArgumentException('Invalid response type');
Expand Down
18 changes: 9 additions & 9 deletions lib/SSO.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public function getAuthorizationUrl(
$state,
$provider = null,
$connection = null,
$organization = null,
$domainHint = null,
$loginHint = null
?string $organization = null,
?string $domainHint = null,
?string $loginHint = null
) {
$authorizationPath = "sso/authorize";

Expand Down Expand Up @@ -219,13 +219,13 @@ public function getConnection($connection)
* @throws Exception\WorkOSException
*/
public function listConnections(
$domain = null,
$connectionType = null,
$organizationId = null,
?string $domain = null,
?string $connectionType = null,
?string $organizationId = null,
$limit = self::DEFAULT_PAGE_SIZE,
$before = null,
$after = null,
$order = null
?string $before = null,
?string $after = null,
?string $order = null
) {
$connectionsPath = "connections";
$params = [
Expand Down
Loading