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
2 changes: 1 addition & 1 deletion src/App/Helpers/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @return mixed
* @throws StopExecutionException
*/
function stop(Closure $closure = null, ?int $code = 0)
function stop(?Closure $closure = null, ?int $code = 0)
{
if ($closure) {
$closure();
Expand Down
2 changes: 1 addition & 1 deletion src/App/Helpers/dir.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function framework_dir(): string
* @param string|null $moduleDir
* @return string
*/
function modules_dir(string $moduleDir = null): string
function modules_dir(?string $moduleDir = null): string
{
return $moduleDir ?? App::getBaseDir() . DS . 'modules';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Traits/Request/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static function has(string $key): bool
* @param bool $raw
* @return mixed
*/
public static function get(string $key, string $default = null, bool $raw = false)
public static function get(string $key, ?string $default = null, bool $raw = false)
{
if(!self::has($key)) {
return $default;
Expand Down
10 changes: 5 additions & 5 deletions src/Http/Traits/Response/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static function has(string $key): bool
* @param string|null $default
* @return mixed
*/
public static function get(string $key, string $default = null)
public static function get(string $key, ?string $default = null)
{
return self::has($key) ? self::$__response[$key] : $default;
}
Expand Down Expand Up @@ -100,7 +100,7 @@ public static function delete(string $key)
* @param array|null $data
* @param int|null $code
*/
public static function json(array $data = null, int $code = null)
public static function json(?array $data = null, ?int $code = null)
{
self::setContentType(ContentType::JSON);

Expand All @@ -119,7 +119,7 @@ public static function json(array $data = null, int $code = null)
* @param array|null $data
* @param int|null $code
*/
public static function jsonp(string $callback, ?array $data = null, int $code = null)
public static function jsonp(string $callback, ?array $data = null, ?int $code = null)
{
self::setContentType(ContentType::JSONP);

Expand Down Expand Up @@ -149,7 +149,7 @@ public static function getJsonPData(array $data): string
* @param array|null $data
* @param int|null $code
*/
public static function xml(array $data = null, $root = '<data></data>', int $code = null)
public static function xml(?array $data = null, $root = '<data></data>', ?int $code = null)
{
self::setContentType(ContentType::XML);

Expand All @@ -169,7 +169,7 @@ public static function xml(array $data = null, $root = '<data></data>', int $cod
* @param string $html
* @param int|null $code
*/
public static function html(string $html, int $code = null)
public static function html(string $html, ?int $code = null)
{
self::setContentType(ContentType::HTML);

Expand Down
4 changes: 2 additions & 2 deletions src/Libraries/Auth/Traits/AuthTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function check(): bool
* @param array|null $customData
* @return User
*/
public function signup(array $userData, array $customData = null): User
public function signup(array $userData, ?array $customData = null): User
{
$activationToken = $this->generateToken();

Expand Down Expand Up @@ -342,7 +342,7 @@ protected function isActivated(User $user): bool
* @param string|null $val
* @return string
*/
protected function generateToken(string $val = null): string
protected function generateToken(?string $val = null): string
{
return base64_encode($this->hasher->hash($val ?: config()->get('app.key')));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/Database/Adapters/Idiorm/IdiormDbal.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class IdiormDbal implements DbalInterface, RelationalInterface
*/
public function __construct(
string $table,
string $modelName = null,
?string $modelName = null,
string $idColumn = 'id',
array $foreignKeys = [],
array $hidden = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function criterias(...$criterias): DbalInterface
* @inheritDoc
* @throws DatabaseException
*/
public function having(string $column, string $operator, string $value = null): DbalInterface
public function having(string $column, string $operator, ?string $value = null): DbalInterface
{
if (!key_exists($operator, $this->operators)) {
throw DatabaseException::operatorNotSupported($operator);
Expand Down Expand Up @@ -98,7 +98,7 @@ public function isNotNull(string $column): DbalInterface
* @param string|null $func
* @throws DatabaseException
*/
protected function addCriteria(string $column, string $operator, $value, string $func = null)
protected function addCriteria(string $column, string $operator, $value, ?string $func = null)
{
if ($operator == '#=#') {
$this->getOrmModel()->where_raw($column . ' = ' . $value);
Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/Database/Adapters/Idiorm/Statements/Join.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ trait Join
* @inheritDoc
* @throws DatabaseException
*/
public function join(string $table, array $constraint, string $tableAlias = null): DbalInterface
public function join(string $table, array $constraint, ?string $tableAlias = null): DbalInterface
{
$this->getOrmModel()->join($table, $constraint, $tableAlias);
return $this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public function destroy($id): bool
/**
* @inheritDoc
*/
#[\ReturnTypeWillChange]
public function gc($max_lifetime): bool
{
$old = time() - $max_lifetime;
Expand Down