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


PHP static::factory方法代码示例

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


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

示例1: setup

 public static function setup()
 {
     if (!static::$factory) {
         static::$factory = new \Illuminate\Validation\Factory(new \Symfony\Component\Translation\Translator(get_locale()));
     }
     return static::$factory;
 }
开发者ID:bruno-barros,项目名称:wordpress-packages,代码行数:7,代码来源:Validator.php

示例2: getFactory

 public static function getFactory()
 {
     if (!static::$factory) {
         static::$factory = new DataExtractorFactory();
     }
     return static::$factory;
 }
开发者ID:knyga,项目名称:webextractor,代码行数:7,代码来源:DataExtractorFactory.php

示例3: __construct

 private function __construct($target)
 {
     if (!isset(static::$factory)) {
         static::$factory = new ReflectionFactory();
     }
     $this->reflection = static::$factory->produce($target);
 }
开发者ID:respect,项目名称:test,代码行数:7,代码来源:Reflect.php

示例4: get

 /**
  * Get a stream factory.
  *
  * @throws \RuntimeException if no factory is set.
  *
  * @return callable
  */
 public static function get()
 {
     if (static::$factory === null) {
         static::$factory = static::autodetectFactory();
     }
     return static::$factory;
 }
开发者ID:schnittstabil,项目名称:psr7-csrf-middleware,代码行数:14,代码来源:StreamFactory.php

示例5: getFactory

 public static function getFactory()
 {
     if (!static::$factory) {
         $featureSet = new FeatureSet(Uuid::class, static::class);
         static::$factory = new PeclUuidFactory(new UuidFactory($featureSet));
     }
     return self::$factory;
 }
开发者ID:lorenzomar,项目名称:valueobject,代码行数:8,代码来源:DegradedUuid.php

示例6: instance

 public static function instance()
 {
     if (!static::$factory) {
         $translator = new Translator("en");
         static::$factory = new Factory($translator);
     }
     return static::$factory;
 }
开发者ID:ozanmuyes,项目名称:laravel5cart,代码行数:8,代码来源:Validator.php

示例7: getFactory

 public static function getFactory()
 {
     if (!static::$factory) {
         $featureSet = new FeatureSet(static::class, DegradedUuid::class);
         static::$factory = new UuidFactory($featureSet);
     }
     return self::$factory;
 }
开发者ID:valueobjects,项目名称:uuid,代码行数:8,代码来源:Uuid.php

示例8: instance

 public static function instance()
 {
     if (!static::$factory) {
         $translator = new Translator('en');
         static::$factory = new \Illuminate\Validation\Factory($translator);
         static::$factory->setPresenceVerifier(new DatabasePresenceVerifier(Eloquent::getConnectionResolver()));
     }
     return static::$factory;
 }
开发者ID:silvertipsoftware,项目名称:laravel-test-helpers,代码行数:9,代码来源:ValidatorHelper.php

示例9: setFactory

 public static function setFactory($callable)
 {
     if (is_object($callable) === false || method_exists($callable, '__invoke') === false) {
         throw new InvalidArgumentException('Callback is not a Closure or invokable object.');
     }
     static::$factory = $callable;
 }
开发者ID:prabhatse,项目名称:olx_hack,代码行数:7,代码来源:FileInfo.php

示例10: setFactory

 /**
  * Set the gateway factory
  *
  * @param GatewayFactory $factory A GatewayFactory instance
  */
 public static function setFactory(GatewayFactory $factory = null)
 {
     static::$factory = $factory;
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:9,代码来源:Omnipay.php

示例11: setAsGlobal

 /**
  * @return \Wandu\Validator\ValidatorFactory
  */
 public function setAsGlobal()
 {
     $oldFactory = static::$factory;
     static::$factory = $this;
     return $oldFactory;
 }
开发者ID:wandu,项目名称:framework,代码行数:9,代码来源:ValidatorFactory.php

示例12: factory

 /**
  * Set user factory
  *
  * @param \Closure $factory
  */
 public static function factory(\Closure $factory)
 {
     static::$factory = $factory;
 }
开发者ID:colorium,项目名称:stateful,代码行数:9,代码来源:Auth.php

示例13: __construct

 public function __construct()
 {
     if (static::$factory === null) {
         static::$factory = new \Plop\RecordFactory(new \Plop\Interpolator\Psr3());
     }
 }
开发者ID:erebot,项目名称:plop,代码行数:6,代码来源:Psr3Logger.php

示例14: create

 public static function create(LoopInterface $loop, $params)
 {
     if (null === static::$factory or !static::$factory instanceof Factory) {
         static::$factory = new Factory($loop);
     }
     return (new static(static::$factory->createClient($params)))->setLoop($loop);
 }
开发者ID:alexeytihomirov,项目名称:epic-queue,代码行数:7,代码来源:Queue.php

示例15: setFactory

 private static function setFactory(Factory $factory = null)
 {
     static::$factory = $factory;
 }
开发者ID:alexbowers,项目名称:GitAbstraction,代码行数:4,代码来源:GitAbstraction.php


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