當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。