Use strict typing

This commit is contained in:
Sebastian Meyer 2023-10-08 21:57:28 +02:00
parent c248a6047c
commit 9653d7872e
3 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* Useful PHP Traits * Useful PHP Traits
* Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com> * Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
@ -69,7 +69,8 @@ trait Getter
$value = $this->__get($property); $value = $this->__get($property);
} catch (\InvalidArgumentException) { } catch (\InvalidArgumentException) {
$value = null; $value = null;
} finally {
return !empty($value);
} }
return !empty($value);
} }
} }

View File

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* Useful PHP Traits * Useful PHP Traits
* Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com> * Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>

View File

@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* Useful PHP Traits * Useful PHP Traits
* Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com> * Copyright (C) 2023 Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
@ -69,8 +69,10 @@ trait Singleton
* This is a singleton class, thus cloning is prohibited. * This is a singleton class, thus cloning is prohibited.
* *
* @access private * @access private
*
* @return void
*/ */
final private function __clone() final private function __clone(): void
{ {
} }
} }