Skip to content

Commit

Permalink
[TASK] Adjust static variable invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
ohader committed Aug 26, 2018
1 parent 2ce4572 commit 7c342a5
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class Manager implements Assertable
{
/**
* @var static
* @var self
*/
private static $instance;

Expand All @@ -26,13 +26,13 @@ class Manager implements Assertable

/**
* @param Behavior $behaviour
* @return Manager
* @return self
*/
public static function initialize(Behavior $behaviour): self
{
if (static::$instance === null) {
static::$instance = new static($behaviour);
return static::$instance;
if (self::$instance === null) {
self::$instance = new self($behaviour);
return self::$instance;
}
throw new \LogicException(
'Manager can only be initialized once',
Expand All @@ -41,12 +41,12 @@ public static function initialize(Behavior $behaviour): self
}

/**
* @return static
* @return self
*/
public static function instance(): self
{
if (static::$instance !== null) {
return static::$instance;
if (self::$instance !== null) {
return self::$instance;
}
throw new \LogicException(
'Manager needs to be initialized first',
Expand All @@ -56,8 +56,8 @@ public static function instance(): self

public static function destroy()
{
if (static::$instance !== null) {
static::$instance = null;
if (self::$instance !== null) {
self::$instance = null;
return;
}
throw new \LogicException(
Expand Down

0 comments on commit 7c342a5

Please sign in to comment.