Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Commit

Permalink
Allows resolved components clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeymakinen committed Oct 3, 2016
1 parent 6d80cc1 commit 7f2b1a2
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions Facade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ abstract class Facade
*
* @var array
*/
private static $_accessors;
private static $_accessors = [];

/**
* The facaded application.
Expand All @@ -36,7 +36,27 @@ abstract class Facade
*
* @var object[]
*/
private static $_components;
private static $_components = [];

/**
* Clears a resolved facade component.
*
* @param string $id
*/
public static function clearResolvedFacadeComponent($id)
{
unset(self::$_accessors[$id]);
unset(self::$_components[$id]);
}

/**
* Clears all resolved facade components.
*/
public static function clearResolvedFacadeComponents()
{
self::$_accessors = [];
self::$_components = [];
}

/**
* Returns a component ID being facaded.
Expand Down Expand Up @@ -83,6 +103,7 @@ public static function getFacadeApplication()
public static function setFacadeApplication(Application $value)
{
self::$_app = $value;
self::clearResolvedFacadeComponents();
}

/**
Expand Down

0 comments on commit 7f2b1a2

Please sign in to comment.