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
2 changes: 1 addition & 1 deletion src/Api/Ais/Connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Connect extends Api
*
* @return ApiResponse Generated connect.
*/
public function generate(string $redirectUri, string $state, string $scope = null): ApiResponse
public function generate(string $redirectUri, string $state, ?string $scope = null): ApiResponse
{
$params = Http::buildHttpQuery([
'redirect_uri' => $redirectUri,
Expand Down
8 changes: 4 additions & 4 deletions src/Api/ApiWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct()
*/
public function get(
string $endpoint,
array $headers = null,
?array $headers = null,
int $authMethod = 1
): ApiResponse {
if (!$headers) {
Expand Down Expand Up @@ -88,7 +88,7 @@ public function post(
string $endpoint,
$body = [],
bool $json = true,
array $headers = null,
?array $headers = null,
int $authMethod = 1
): ApiResponse {
if (!$headers) {
Expand Down Expand Up @@ -136,7 +136,7 @@ public function patch(
string $endpoint,
$body = null,
bool $json = true,
array $headers = null,
?array $headers = null,
int $authMethod = 1
): ApiResponse {
if (!$headers) {
Expand Down Expand Up @@ -184,7 +184,7 @@ public function delete(
string $endpoint,
$body = null,
bool $json = true,
array $headers = null,
?array $headers = null,
int $authMethod = 1
): ApiResponse {
if (!$headers) {
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Auth/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Token extends Api
*
* @return ApiResponse Generated token.
*/
public function generate(string $clientIdentifier = 'pis', string $code = null): ApiResponse
public function generate(string $clientIdentifier = 'pis', ?string $code = null): ApiResponse
{
if (!$config = Fintecture::getConfig()) {
throw new FintectureException('Token needs a configured client');
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Customers/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Customers extends Api
*
* @return ApiResponse
*/
public function get(string $customerId = null, array $additionalParams = []): ApiResponse
public function get(?string $customerId = null, array $additionalParams = []): ApiResponse
{
$path = '/v1/customers';

Expand Down
2 changes: 1 addition & 1 deletion src/Api/Pis/Initiate.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Initiate extends Api
*
* @return ApiResponse Generated connect.
*/
public function generate(array $data, string $providerId, string $redirectUri, string $state = null): ApiResponse
public function generate(array $data, string $providerId, string $redirectUri, ?string $state = null): ApiResponse
{
$params = Http::buildHttpQuery([
'redirect_uri' => $redirectUri,
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Pis/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Payment extends Api
*
* @return ApiResponse Payments.
*/
public function get(string $sessionId = null, bool $withBeneficiary = null, bool $withVirtualBeneficiary = null): ApiResponse
public function get(?string $sessionId = null, ?bool $withBeneficiary = null, ?bool $withVirtualBeneficiary = null): ApiResponse
{
$path = '/pis/v2/payments';
if ($sessionId) {
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Pis/Refund.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Refund extends Api
*
* @return ApiResponse Generated refund.
*/
public function generate(array $data, string $state = null): ApiResponse
public function generate(array $data, ?string $state = null): ApiResponse
{
$params = Http::buildHttpQuery([
'state' => $state
Expand Down
4 changes: 2 additions & 2 deletions src/Api/Pis/RequestToPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class RequestToPay extends Api
public function generate(
array $data,
string $xLanguage,
string $redirectUri = null,
string $state = null
?string $redirectUri = null,
?string $state = null
): ApiResponse {
$params = Http::buildHttpQuery([
'redirect_uri' => $redirectUri,
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Pis/Settlement.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Settlement extends Api
*
* @return ApiResponse Disbursements.
*/
public function get(string $settlementId = null, array $additionalParams = []): ApiResponse
public function get(?string $settlementId = null, array $additionalParams = []): ApiResponse
{
$path = '/pis/v2/settlements';
if ($settlementId) {
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Resources/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Provider extends Api
*
* @return ApiResponse Provider(s) infos.
*/
public function get(string $id = null, array $additionalParams = []): ApiResponse
public function get(?string $id = null, array $additionalParams = []): ApiResponse
{
$path = '/res/v1/providers' . ($id ? '/' . $id : '');
if (!empty($additionalParams)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract class Client
* @param array $config The config of the user app to create the main client.
* @param ?ClientInterface $httpClient Client to do HTTP requests, if not set, auto discovery will be used to find a HTTP client.
*/
public function __construct(array $config, ClientInterface $httpClient = null)
public function __construct(array $config, ?ClientInterface $httpClient = null)
{
// Set a unique identifier for the current instance
$this->identifier .= '-' . uniqid();
Expand Down
2 changes: 1 addition & 1 deletion src/Config/Endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private static function getCurrentEnvironment(): string
*
* @return string Main API URL.
*/
public static function getApiUrl(string $environment = null): string
public static function getApiUrl(?string $environment = null): string
{
$environment = $environment ?: self::getCurrentEnvironment();
switch ($environment) {
Expand Down
4 changes: 2 additions & 2 deletions src/Config/Telemetry.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Telemetry
*
* @return bool Sending status.
*/
public static function logAction(string $action, array $additionalMetrics = null): bool
public static function logAction(string $action, ?array $additionalMetrics = null): bool
{
// Don't send a call if telemetry is disabled
if (Fintecture::getConfig() && !Fintecture::getConfig()->getEnabledTelemetry()) {
Expand Down Expand Up @@ -68,7 +68,7 @@ public static function logMetric(string $category): bool
*
* @return array Configuration.
*/
private static function getMetrics(string $action, array $additionalMetrics = null): array
private static function getMetrics(string $action, ?array $additionalMetrics = null): array
{
// Construct configuration return
$metrics = [
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function generate(
string $path,
$body = null,
int $authMethod = 1,
array $customCredentials = null
?array $customCredentials = null
): array {
if (isset($customCredentials['appId']) && isset($customCredentials['appSecret']) && isset($customCredentials['privateKey'])) {
$appId = $customCredentials['appId'];
Expand Down
2 changes: 1 addition & 1 deletion src/Util/PemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class PemManager
/** @var ?EncryptionManager $encryptionManager */
private $encryptionManager;

public function __construct(EncryptionManager $encryptionManager = null)
public function __construct(?EncryptionManager $encryptionManager = null)
{
$this->encryptionManager = $encryptionManager ?: null;
}
Expand Down