Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion classes/Carrier/SendCloud/SendCloudApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function GetTrackingStatus(string $trackingNumber): ShipmentStatus|null
/**
* @throws SendcloudApiException
*/
function sendRequest(string $uri, array $query_params = null, bool $post = false, array $postFields = null,
function sendRequest(string $uri, ?array $query_params = null, bool $post = false, ?array $postFields = null,
array $allowedResponseCodes = [200]): ?array
{
if (empty($this->public_key) || empty($this->private_key))
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Database/Adapter/MysqliAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ final class MysqliAdapter implements AdapterInterface
* @param DatabaseConfig $config
* @param ProfilerInterface|null $profiler
*/
public function __construct(DatabaseConfig $config, ProfilerInterface $profiler = null)
public function __construct(DatabaseConfig $config, ?ProfilerInterface $profiler = null)
{
$this->config = $config;
$this->profiler = $profiler;
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Exporter/Csv/CsvExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class CsvExporter
/**
* @param CsvConfig|null $config
*/
public function __construct(CsvConfig $config = null)
public function __construct(?CsvConfig $config = null)
{
if ($config === null) {
$config = new CsvConfig();
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Exporter/Csv/CsvWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class CsvWriter
* @throws InvalidResourceException If resource is not writable or invalid
* @throws PhpExtensionMissingException If mbstring is missing
*/
public function __construct($handle, CsvConfig $config = null)
public function __construct($handle, ?CsvConfig $config = null)
{
if (!is_resource($handle)) {
throw new InvalidResourceException('First parameter is not a valid resource.');
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Exporter/Json/JsonExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class JsonExporter
/**
* @param JsonConfig|null $config
*/
public function __construct(JsonConfig $config = null)
public function __construct(?JsonConfig $config = null)
{
if ($config === null) {
$config = new JsonConfig();
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Exporter/Json/JsonWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class JsonWriter
* @throws InvalidResourceException If resource is not writable or invalid
* @throws PhpExtensionMissingException If mbstring is missing
*/
public function __construct($handle, JsonConfig $config = null)
public function __construct($handle, ?JsonConfig $config = null)
{
if (!is_resource($handle)) {
throw new InvalidResourceException('First parameter is not a valid resource.');
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Http/Exception/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
$statusCode = 500,
$message = '',
$code = 0,
Throwable $previous = null,
?Throwable $previous = null,
array $errors = []
) {
parent::__construct($message, $code, $previous);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class HttpHeaderValueException extends RuntimeException implements HttpComponentExceptionInterface
{
public function __construct($message = '', $code = 0, Throwable $previous = null, $headerValue = null)
public function __construct($message = '', $code = 0, ?Throwable $previous = null, $headerValue = null)
{
$headerString = '';
if ($headerValue === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public function __construct(
array $allowedMethods,
$message = null,
$code = 0,
Throwable $previous = null
?Throwable $previous = null
) {
if ($message === null) {
$message = sprintf('Method is not allowed. Allowed: %s', implode(', ', $allowedMethods));
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Http/FileResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function setContentFile($contentFile, $deleteFile = false)
* @param DateTimeInterface|null $sendTime leave empty
* @param int $chunkSize output content will be chunked
*/
public function send(DateTimeInterface $sendTime = null, $chunkSize = 65536)
public function send(?DateTimeInterface $sendTime = null, $chunkSize = 65536)
{
if ($this->file === null) {
throw new FileNotFoundException('No content File Available');
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function __construct(
*
* @return void
*/
public function send(DateTimeInterface $sendTime = null)
public function send(?DateTimeInterface $sendTime = null)
{
header(sprintf('HTTP/%s %s %s', $this->getProtocolVersion(), $this->getStatusCode(), $this->getStatusText()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class TransferErrorException extends RuntimeException implements TransferErrorEx
public function __construct(
$message = '',
$code = 0,
Throwable $previous = null,
ClientRequestInterface $request = null,
ServerResponseInterface $response = null
?Throwable $previous = null,
?ClientRequestInterface $request = null,
?ServerResponseInterface $response = null
) {
parent::__construct($message, $code, $previous);

Expand Down Expand Up @@ -102,7 +102,7 @@ public static function fromGuzzleException(GuzzleException $exception): Transfer
*/
public static function fromClientRequest(
ClientRequestInterface $request,
ServerResponseInterface $response = null
?ServerResponseInterface $response = null
): TransferErrorExceptionInterface {
$message = sprintf('Error Communicating with Server: %s %s', $request->getMethod(), $request->getUri());

Expand Down
4 changes: 2 additions & 2 deletions classes/Components/HttpClient/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class HttpClient implements HttpClientInterface
/**
* @param RequestOptions|null $options
*/
public function __construct(RequestOptions $options = null)
public function __construct(?RequestOptions $options = null)
{
$this->options = $options === null ? new RequestOptions() : clone $options;
}
Expand Down Expand Up @@ -56,7 +56,7 @@ public function request($method, $uri, array $headers = [], $body = null, $versi
*/
public function sendRequest(
ClientRequestInterface $request,
RequestOptions $options = null
?RequestOptions $options = null
): ServerResponseInterface {
$optionsArray = $options === null ? $this->options->toArray() : $options->toArray();

Expand Down
2 changes: 1 addition & 1 deletion classes/Components/HttpClient/HttpClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class HttpClientFactory
*
* @return HttpClientInterface
*/
public function createClient(RequestOptions $options = null): HttpClientInterface
public function createClient(?RequestOptions $options = null): HttpClientInterface
{
if ($options === null) {
$options = new RequestOptions();
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/HttpClient/HttpClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public function request(
*/
public function sendRequest(
ClientRequestInterface $request,
RequestOptions $options = null
?RequestOptions $options = null
): ServerResponseInterface;
}
4 changes: 2 additions & 2 deletions classes/Components/HttpClient/RequestOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function toArray(): array
*
* @return self
*/
public function setHeaders(array $headers = null): self
public function setHeaders(?array $headers = null): self
{
$this->options[GuzzleOptionKeys::HEADERS] = $headers;

Expand Down Expand Up @@ -351,7 +351,7 @@ public function disableStream(): self
*
* @return self
*/
public function setSslKey(string $path, string $passphrase = null): self
public function setSslKey(string $path, ?string $passphrase = null): self
{
if ($passphrase !== null) {
$this->options[GuzzleOptionKeys::SSL_KEY] = [$path, $passphrase];
Expand Down
8 changes: 4 additions & 4 deletions classes/Components/Logger/Context/LoggerContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ final class LoggerContext implements ContextInterface
*/
public function __construct(
DateTimeInterface $dateTime,
Invocation $invocation = null,
OriginInterface $origin = null,
Throwable $exception = null,
array $dump = null
?Invocation $invocation = null,
?OriginInterface $origin = null,
?Throwable $exception = null,
?array $dump = null
) {
$this->dateTime = $dateTime;
$this->invocation = $invocation;
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/MailClient/Client/ImapMailClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function deleteMessage(int $msgNumber): void
*
* @return MailBoxInfoData
*/
public function examineInbox(string $inbox = null): MailBoxInfoData
public function examineInbox(?string $inbox = null): MailBoxInfoData
{
$this->ensureConnection();
if ($inbox === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class MimeMessageFormatter implements MimeMessageFormatterInterface
*
* @return string
*/
public function formatMessage(EmailMessage $email, EmailRecipient $from, string $messageId = null): string
public function formatMessage(EmailMessage $email, EmailRecipient $from, ?string $messageId = null): string
{
if ($messageId !== null && !preg_match('/^<.*@.*>$/', $messageId)) {
throw new InvalidArgumentException('message id must be RFC 5322 conform');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ interface MimeMessageFormatterInterface
*
* @return string
*/
public function formatMessage(EmailMessage $email, EmailRecipient $sender, string $messageId = null): string;
public function formatMessage(EmailMessage $email, EmailRecipient $sender, ?string $messageId = null): string;
}
2 changes: 1 addition & 1 deletion classes/Components/MailClient/Data/MailAttachmentData.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct(
string $contentType,
string $encoding,
bool $isInlineAttachment = false,
string $cid = null
?string $cid = null
)
{
$this->filename = $filename;
Expand Down
16 changes: 8 additions & 8 deletions classes/Components/Mailer/Data/EmailMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ final class EmailMessage
public function __construct(
$subject,
$body,
array $recipients = null,
array $ccRecipients = null,
array $bccRecipients = null,
array $attachments = null
?array $recipients = null,
?array $ccRecipients = null,
?array $bccRecipients = null,
?array $attachments = null
) {
$this->recipients = [];
$this->setRecipients($recipients);
Expand Down Expand Up @@ -257,7 +257,7 @@ public function isHtml(): bool
*
* @return void
*/
private function setRecipients(array $recipients = null): void
private function setRecipients(?array $recipients = null): void
{
$this->recipients = [];
if ($recipients === null) {
Expand All @@ -273,7 +273,7 @@ private function setRecipients(array $recipients = null): void
*
* @return void
*/
private function setCcRecipients(array $ccRecipients = null): void
private function setCcRecipients(?array $ccRecipients = null): void
{
$this->ccRecipients = [];
if ($ccRecipients === null) {
Expand All @@ -289,7 +289,7 @@ private function setCcRecipients(array $ccRecipients = null): void
*
* @return void
*/
private function setBccRecipients(array $bccRecipients = null): void
private function setBccRecipients(?array $bccRecipients = null): void
{
$this->bccRecipients = [];
if ($bccRecipients === null) {
Expand All @@ -305,7 +305,7 @@ private function setBccRecipients(array $bccRecipients = null): void
*
* @return void
*/
private function setAttachments(array $attachments = null): void
private function setAttachments(?array $attachments = null): void
{
$this->attachments = [];
if ($attachments === null) {
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Mailer/Data/EmailRecipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class EmailRecipient implements JsonSerializable
* @param string $email
* @param string|null $name
*/
public function __construct(string $email, string $name = null)
public function __construct(string $email, ?string $name = null)
{
$this->email = $email;
$this->name = $name;
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Mailer/Data/FileAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class FileAttachment implements EmailAttachmentInterface
*/
public function __construct(
string $path,
string $name = null,
?string $name = null,
string $encoding = self::ENCODING_BASE64,
string $type = 'application/octet-stream',
string $disposition = self::DISPOSITION_ATTACHMENT
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Mailer/Data/ImageAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class ImageAttachment implements EmailAttachmentInterface
public function __construct(
string $path,
string $cid,
string $name = null,
?string $name = null,
string $encoding = self::ENCODING_BASE64,
string $type = '',
string $disposition = self::DISPOSITION_INLINE
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Mailer/Transport/PhpMailerTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class PhpMailerTransport implements MailerTransportInterface
/**
* @inheritDoc
*/
public function __construct(PHPMailer $mailer, MailerConfigInterface $config, LoggerInterface $logger = null)
public function __construct(PHPMailer $mailer, MailerConfigInterface $config, ?LoggerInterface $logger = null)
{
$this->config = $config;
$this->phpMailer = $mailer;
Expand Down
2 changes: 1 addition & 1 deletion classes/Components/Sanitizer/HtmlMailSanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getConfig()
*
* @return string
*/
public function sanitize($mailContent, SanitizerConfig $config = null)
public function sanitize($mailContent, ?SanitizerConfig $config = null)
{
$purifierConf = $config !== null ? HTMLPurifier_Config::create($config->toHtmlPurifierConfig()) : null;

Expand Down
2 changes: 1 addition & 1 deletion classes/Modules/Api/Dashboard/WidgetResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ final class WidgetResult extends AbstractResult
* @param array $data
* @param array $pagination
*/
public function __construct(array $data, array $pagination = null)
public function __construct(array $data, ?array $pagination = null)
{
$this->data = $data;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Modules/Api/Engine/ApiApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct(ApiContainer $container)
*
* @return Response
*/
public function handle(Request $request = null)
public function handle(?Request $request = null)
{
$this->request = $request ?: Request::createFromGlobals();
$this->container->add('Request', $this->request);
Expand Down
2 changes: 1 addition & 1 deletion classes/Modules/Api/Engine/ApiContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private function createService($name)
*
* @return AbstractController
*/
public function getApiController($contollerClass, Request $request = null)
public function getApiController($contollerClass, ?Request $request = null)
{
// @todo
/*$interfaces = class_implements($contollerClass, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class AuthorizationErrorException extends HttpException
{
public function __construct($message = 'Authorization error', $code = 0, Throwable $previous = null)
public function __construct($message = 'Authorization error', $code = 0, ?Throwable $previous = null)
{
parent::__construct(401, $message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Modules/Api/Exception/BadRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BadRequestException extends HttpException
public function __construct(
$message = 'Bad request',
$code = ApiError::CODE_BAD_REQUEST,
Throwable $previous = null,
?Throwable $previous = null,
array $errors = array()
) {
parent::__construct(400, $message, $code, $previous, $errors);
Expand Down
2 changes: 1 addition & 1 deletion classes/Modules/Api/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class InvalidArgumentException extends HttpException
public function __construct(
$message = 'Invalid argument',
$code = ApiError::CODE_INVALID_ARGUMENT,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct(400, $message, $code, $previous);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct(
array $allowedMethods,
$message = 'Method not allowed',
$code = ApiError::CODE_METHOD_NOT_ALLOWED,
Throwable $previous = null
?Throwable $previous = null
) {
$message = sprintf('Method is not allowed. Allowed: %s', implode(', ', $allowedMethods));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ResourceNotFoundException extends HttpException
public function __construct(
$message = 'Resource not found',
$code = ApiError::CODE_RESOURCE_NOT_FOUND,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct(404, $message, $code, $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Modules/Api/Exception/RouteNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class RouteNotFoundException extends HttpException
public function __construct(
$message = 'Route not found',
$code = ApiError::CODE_ROUTE_NOT_FOUND,
Throwable $previous = null
?Throwable $previous = null
) {
parent::__construct(404, $message, $code, $previous);
}
Expand Down
Loading