当前位置: 首页>>代码示例>>PHP>>正文


PHP static::instances方法代码示例

本文整理汇总了PHP中static::instances方法的典型用法代码示例。如果您正苦于以下问题:PHP static::instances方法的具体用法?PHP static::instances怎么用?PHP static::instances使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在static的用法示例。


在下文中一共展示了static::instances方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: instance

 /**
  * @return Model_Search_Stemmer_Decorator
  */
 public static function instance()
 {
     if (!isset(static::$instances)) {
         static::$instances = new static();
     }
     return static::$instances;
 }
开发者ID:ZerGabriel,项目名称:cms-1,代码行数:10,代码来源:decorator.php

示例2: create

 /**
  * 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;
 }
开发者ID:xinix-technology,项目名称:blade-theme,代码行数:15,代码来源:Pagination.php

示例3: resetInstance

 /**
  * 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]);
     }
 }
开发者ID:martynbiz,项目名称:php-mongo,代码行数:13,代码来源:Singleton.php

示例4: delete

 /**
  * 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]);
     }
 }
开发者ID:velosipedist,项目名称:event,代码行数:13,代码来源:Base.php

示例5: __callStatic

 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];
 }
开发者ID:jthemphill,项目名称:tournament,代码行数:11,代码来源:singletons.php

示例6: __callStatic

 /**
  * @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];
 }
开发者ID:jaspervdm,项目名称:pogoapi-php,代码行数:19,代码来源:Enum.php

示例7: reset

 /**
  * 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 = '';
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:14,代码来源:uri.php

示例8: reset

 /**
  * Resets all metadata instances.
  */
 public static function reset()
 {
     static::$instances = [];
 }
开发者ID:drwrf,项目名称:mismatch-model,代码行数:7,代码来源:Metadata.php

示例9: reset

 public static function reset()
 {
     static::$prophecy = [];
     static::$instances = [];
 }
开发者ID:cheppers,项目名称:robo-phpcs,代码行数:5,代码来源:Process.php

示例10: setProxyContainer

 public static function setProxyContainer(ContainerInterface $container = null)
 {
     static::$instances = [];
     static::$container = $container;
 }
开发者ID:autarky,项目名称:container,代码行数:5,代码来源:AbstractProxy.php

示例11: clearInternalCache

 /**
  * Clears the internal memory cache of model instances.
  * @return void
  */
 public static function clearInternalCache()
 {
     static::$instances = [];
 }
开发者ID:keiosweb,项目名称:october,代码行数:8,代码来源:SettingsModel.php

示例12: clear

 /**
  * Clears the registry of configuration and instances.
  *
  * @return void
  */
 public static function clear()
 {
     static::$instances = [];
 }
开发者ID:jeffersongoncalves,项目名称:elastic-search,代码行数:9,代码来源:TypeRegistry.php

示例13: clears

 /**
  * Clear all of the resolved instances.
  */
 public static function clears()
 {
     static::$instances = array();
 }
开发者ID:krisanalfa,项目名称:docolight,代码行数:7,代码来源:Facade.php

示例14: flushInstances

 /**
  * 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 = [];
     }
 }
开发者ID:giuseppe-mazzapica,项目名称:faber,代码行数:18,代码来源:Faber.php

示例15: reset

 public static function reset($name = null)
 {
     if (is_null($name)) {
         $name = static::DEFAULT_INSTANCE_NAME;
     }
     static::$instances = null;
 }
开发者ID:teodorpopa,项目名称:IoC,代码行数:7,代码来源:Container.php


注:本文中的static::instances方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。