/** * @return Model_Search_Stemmer_Decorator */ public static function instance() { if (!isset(static::$instances)) { static::$instances = new static(); } return static::$instances; }
/** * Create new instance of Xinix\Theme\Components\Pagination via static method * * @param Norm\Cursor $entries Entries that we want to page * * @return Xinix\Theme\Components\Pagination New instance of Pagination class */ public static function create(Cursor $entries) { $Class = get_called_class(); if (is_null(static::$instances[$Class])) { static::$instances = new $Class($entries); } return static::$instances; }
/** * As this is a singleton instance, we wanna be able to re-instatiate (e.g. during * tests as the same instance will be used for unit and integrated tests) * @return void */ public function resetInstance($name = null) { if (is_null($name)) { static::$instances = array(); } else { unset(static::$instances[$name]); } }
/** * Delete an instance from the facade. * * @param mixed $name instance name or true for all */ public static function delete($name) { if ($name === true) { static::$instances = array(); } elseif (isset(static::$instances[$name])) { unset(static::$instances[$name]); } }
public static function __callStatic($name, $arguments) { static $bindings = ['A' => 'Auth', 'C' => 'Config', 'D' => 'Db', 'L' => 'Log', 'R' => 'Redirect', 'S' => 'Session', 'T' => 'Template', 'U' => 'Url']; if (!is_array(static::$instances)) { static::$instances = []; } if (!isset(static::$instances[$name])) { static::$instances[$name] = new $bindings[$name](); } return static::$instances[$name]; }
/** * @param $name * @param $arguments * @return static * @throws Exception */ public static function __callStatic($name, $arguments) { if (!defined("static::" . $name)) { throw new Exception("Unknown enum '" . $name . "'"); } if (!is_array(static::$instances)) { static::$instances = []; } if (!isset(static::$instances[$name])) { static::$instances[$name] = new static($name, constant("static::" . $name)); } return static::$instances[$name]; }
/** * Method to reset class static members for testing and other various issues. * * @return void * * @since 11.1 */ public static function reset() { static::$instances = array(); static::$base = array(); static::$root = array(); static::$current = ''; }
/** * Resets all metadata instances. */ public static function reset() { static::$instances = []; }
public static function reset() { static::$prophecy = []; static::$instances = []; }
public static function setProxyContainer(ContainerInterface $container = null) { static::$instances = []; static::$container = $container; }
/** * Clears the internal memory cache of model instances. * @return void */ public static function clearInternalCache() { static::$instances = []; }
/** * Clears the registry of configuration and instances. * * @return void */ public static function clear() { static::$instances = []; }
/** * Clear all of the resolved instances. */ public static function clears() { static::$instances = array(); }
/** * Remove saved instances * * @param array $ids Array of instance ids to unset. If omitted all saved instances are removed * @return void */ static function flushInstances(array $ids = []) { if (!empty($ids)) { foreach ($ids as $id) { if (is_string($id) && isset(static::$instances[$id])) { unset(static::$instances[$id]); } } } else { static::$instances = []; } }
public static function reset($name = null) { if (is_null($name)) { $name = static::DEFAULT_INSTANCE_NAME; } static::$instances = null; }
/** * Removes all map classes and instances */ public static function removeAll() { static::$classAliases = static::$classNames = static::$instances = []; }