Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark nullable parameters as nullable #156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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/EasyStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public function __toString(): string
* EasyStatement constructor.
* @param EasyStatement|null $parent
*/
protected function __construct(EasyStatement $parent = null)
protected function __construct(?EasyStatement $parent = null)
{
$this->parent = $parent;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/MustBeArrayOrEasyStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use ParagonIE\Corner\CornerInterface;
use ParagonIE\Corner\CornerTrait;
use Throwable;

/**
* Class MustBeArrayOrEasyStatement
Expand All @@ -13,7 +14,7 @@ class MustBeArrayOrEasyStatement extends EasyDBException
{
use CornerTrait;

public function __construct(string $message = "", int $code = 0, \Throwable $previous = null)
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->supportLink = 'https://github.com/paragonie/easydb';
Expand Down
3 changes: 2 additions & 1 deletion src/Exception/MustBeEmpty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

use ParagonIE\Corner\CornerInterface;
use ParagonIE\Corner\CornerTrait;
use Throwable;

class MustBeEmpty extends EasyDBException
{
use CornerTrait;

public function __construct(string $message = "", int $code = 0, \Throwable $previous = null)
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->supportLink = 'https://github.com/paragonie/easydb';
Expand Down
5 changes: 2 additions & 3 deletions src/Exception/MustBeNonEmpty.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use ParagonIE\Corner\CornerInterface;
use ParagonIE\Corner\CornerTrait;
use Throwable;

/**
* Class MustBeNonEmpty
Expand All @@ -13,7 +14,7 @@ class MustBeNonEmpty extends EasyDBException
{
use CornerTrait;

public function __construct(string $message = "", int $code = 0, \Throwable $previous = null)
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->supportLink = 'https://github.com/paragonie/easydb';
Expand All @@ -29,7 +30,5 @@ public function __construct(string $message = "", int $code = 0, \Throwable $pre
Note that an empty IN statement yields an empty result. If you want it to fail
open (a.k.a. discard the IN() statement entirely), you'll need to implement
your own application logic to handle this behavior.";


}
}
2 changes: 1 addition & 1 deletion src/Exception/MustBeOneDimensionalArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MustBeOneDimensionalArray extends EasyDBException
{
use CornerTrait;

public function __construct(string $message = "", int $code = 0, Throwable $previous = null)
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->supportLink = 'https://github.com/paragonie/easydb#only-one-dimensional-arrays-are-allowed';
Expand Down
4 changes: 2 additions & 2 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ abstract class Factory
*/
public static function create(
string $dsn,
string $username = null,
string $password = null,
?string $username = null,
?string $password = null,
array $options = []
): EasyDB {
return static::fromArray([$dsn, $username, $password, $options]);
Expand Down
Loading