Self static accessor

Inside a final class or anonymous class self should be preferred to static.
This commit is contained in:
MathiasReker 2022-06-16 21:10:57 +02:00
parent 7b24e1185a
commit 40a46455bd

View File

@ -15,11 +15,11 @@ final class Singleton
*/
public static function getInstance(): Singleton
{
if (static::$instance === null) {
static::$instance = new static();
if (self::$instance === null) {
self::$instance = new self();
}
return static::$instance;
return self::$instance;
}
/**