Skip to content

Commit

Permalink
Fix implicit nullables
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Dec 28, 2024
1 parent e94355a commit efb50f9
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/GaletteObjectsLend/Entity/LendCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class LendCategory
* @param Db $zdb Database instance
* @param Plugins $plugins Plugins instance
* @param int|ArrayObject<string,int|string>|null $args Maybe null, an RS object or an id from database
* @param array<string,bool> $deps Dependencies configuration, see LendCategory::$deps
* @param ?array<string,bool> $deps Dependencies configuration, see LendCategory::$deps
*/
public function __construct(Db $zdb, Plugins $plugins, int|ArrayObject $args = null, array $deps = null)
public function __construct(Db $zdb, Plugins $plugins, int|ArrayObject|null $args = null, ?array $deps = null)
{
$this->zdb = $zdb;
$this->plugins = $plugins;
Expand Down
4 changes: 2 additions & 2 deletions lib/GaletteObjectsLend/Entity/LendObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ class LendObject
* @param Db $zdb Database instance
* @param Plugins $plugins Plugins instance
* @param int|ArrayObject<string,int|string>|null $args Maybe null, an RS object or an id from database
* @param array<string,bool> $deps Dependencies configuration, see LendOb::$deps
* @param ?array<string,bool> $deps Dependencies configuration, see LendOb::$deps
*/
public function __construct(Db $zdb, Plugins $plugins, int|ArrayObject $args = null, array $deps = null)
public function __construct(Db $zdb, Plugins $plugins, int|ArrayObject|null $args = null, ?array $deps = null)
{
$this->zdb = $zdb;
$this->plugins = $plugins;
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteObjectsLend/Entity/LendRent.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class LendRent
*
* @param int|ArrayObject<string,int|string>|null $args Either an int with rent id, null, or a resultset row
*/
public function __construct(int|ArrayObject $args = null)
public function __construct(int|ArrayObject|null $args = null)
{
global $zdb;

Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteObjectsLend/Entity/LendStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class LendStatus
* @param Db $zdb Database instance
* @param int|ArrayObject<string,int|string>|null $args Can be null, an ID or a database row
*/
public function __construct(Db $zdb, int|ArrayObject $args = null)
public function __construct(Db $zdb, int|ArrayObject|null $args = null)
{
$this->zdb = $zdb;

Expand Down
12 changes: 6 additions & 6 deletions lib/GaletteObjectsLend/Entity/Picture.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ public function displayThumb(Response $response, Preferences $prefs): Response
* Create thumbnail image
* @see \Galette\Core\Picture::resizeImage()
*
* @param string $source the source image
* @param string $ext file's extension
* @param string $dest the destination image.
* If null, we'll use the source image. Defaults to null
* @param string $source the source image
* @param string $ext file's extension
* @param ?string $dest the destination image.
* If null, we'll use the source image. Defaults to null
*
* @return bool
*/
private function createThumb(string $source, string $ext, string $dest = null): bool
private function createThumb(string $source, string $ext, ?string $dest = null): bool
{
$class = get_class($this);

Expand Down Expand Up @@ -260,7 +260,7 @@ public function delete(bool $transaction = true): bool
*
* @return bool|int
*/
public function store(array $file, bool $ajax = false, array $cropping = null): bool|int
public function store(array $file, bool $ajax = false, ?array $cropping = null): bool|int
{
$ext = pathinfo($this->file_path, PATHINFO_EXTENSION);
$filename = substr($this->file_path, 0, strlen($this->file_path) - strlen($ext) - 1);
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteObjectsLend/Repository/Categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Categories
* @param Plugins $plugins Plugins instance
* @param ?CategoriesList $filters Filtering
*/
public function __construct(Db $zdb, Login $login, Plugins $plugins, CategoriesList $filters = null)
public function __construct(Db $zdb, Login $login, Plugins $plugins, ?CategoriesList $filters = null)
{
$this->zdb = $zdb;
$this->login = $login;
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteObjectsLend/Repository/Objects.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Objects
* @param Preferences $lprefs Lends preferences instance
* @param ?ObjectsList $filters Filtering
*/
public function __construct(Db $zdb, Plugins $plugins, Preferences $lprefs, ObjectsList $filters = null)
public function __construct(Db $zdb, Plugins $plugins, Preferences $lprefs, ?ObjectsList $filters = null)
{
$this->zdb = $zdb;
$this->plugins = $plugins;
Expand Down
2 changes: 1 addition & 1 deletion lib/GaletteObjectsLend/Repository/Status.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Status
* @param Login $login Logged in instance
* @param ?StatusList $filters Filtering
*/
public function __construct(Db $zdb, Login $login, StatusList $filters = null)
public function __construct(Db $zdb, Login $login, ?StatusList $filters = null)
{
$this->zdb = $zdb;
$this->login = $login;
Expand Down

0 comments on commit efb50f9

Please sign in to comment.