public static function setup() { if (!static::$factory) { static::$factory = new \Illuminate\Validation\Factory(new \Symfony\Component\Translation\Translator(get_locale())); } return static::$factory; }
public static function getFactory() { if (!static::$factory) { static::$factory = new DataExtractorFactory(); } return static::$factory; }
private function __construct($target) { if (!isset(static::$factory)) { static::$factory = new ReflectionFactory(); } $this->reflection = static::$factory->produce($target); }
/** * 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; }
public static function getFactory() { if (!static::$factory) { $featureSet = new FeatureSet(Uuid::class, static::class); static::$factory = new PeclUuidFactory(new UuidFactory($featureSet)); } return self::$factory; }
public static function instance() { if (!static::$factory) { $translator = new Translator("en"); static::$factory = new Factory($translator); } return static::$factory; }
public static function getFactory() { if (!static::$factory) { $featureSet = new FeatureSet(static::class, DegradedUuid::class); static::$factory = new UuidFactory($featureSet); } return self::$factory; }
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; }
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; }
/** * Set the gateway factory * * @param GatewayFactory $factory A GatewayFactory instance */ public static function setFactory(GatewayFactory $factory = null) { static::$factory = $factory; }
/** * @return \Wandu\Validator\ValidatorFactory */ public function setAsGlobal() { $oldFactory = static::$factory; static::$factory = $this; return $oldFactory; }
/** * Set user factory * * @param \Closure $factory */ public static function factory(\Closure $factory) { static::$factory = $factory; }
public function __construct() { if (static::$factory === null) { static::$factory = new \Plop\RecordFactory(new \Plop\Interpolator\Psr3()); } }
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); }
private static function setFactory(Factory $factory = null) { static::$factory = $factory; }
protected static function load() { /** @var Gantry $instance */ $instance = new static(); $instance->register(new ConfigServiceProvider()); $instance->register(new StreamsServiceProvider()); $instance['request'] = function ($c) { return new Request(); }; $instance['events'] = function ($c) { return new EventDispatcher(); }; $instance['platform'] = function ($c) { return new Platform($c); }; $instance['translator'] = function ($c) { return new Translator(); }; $instance['site'] = function ($c) { return new Site(); }; $instance['menu'] = function ($c) { return new Menu(); }; $instance['messages'] = function ($c) { return new Messages(); }; $instance['page'] = function ($c) { return new Page($c); }; // Make sure that nobody modifies the original collection by making it a factory. $instance['configurations'] = $instance->factory(function ($c) { static $collection; if (!$collection) { $collection = (new Outlines($c))->load(); } return $collection->copy(); }); $instance['positions'] = $instance->factory(function ($c) { static $collection; if (!$collection) { $collection = (new Positions($c))->load(); } return $collection->copy(); }); $instance['global'] = function ($c) { $data = $c->loadGlobal() + ['debug' => false, 'production' => false, 'asset_timestamps' => true, 'asset_timestamps_period' => 7]; return new Config($data); }; return $instance; }
public static function setFactory(FactoryInterface $factory) { static::$factory = $factory; }
protected static function load() { /** @var Gantry $instance */ $instance = new static(); $instance->register(new ConfigServiceProvider()); $instance->register(new StreamsServiceProvider()); $instance['request'] = function ($c) { return new Request(); }; $instance['events'] = function ($c) { return new EventDispatcher(); }; $instance['platform'] = function ($c) { return new Platform($c); }; $instance['translator'] = function ($c) { return new Translator(); }; // Make sure that nobody modifies the original collection by making it a factory. $instance['configurations'] = $instance->factory(function ($c) { static $collection; if (!$collection) { $collection = (new Configurations($c))->load(); } return $collection->copy(); }); return $instance; }
/** * @param Factory $factory * * @return null */ public static function setFactory($factory) { static::$factory = $factory; }
/** * Set the Facade Factory * * @param FacadeFactory $factory */ public static function setFactory(FacadeFactory $factory = null) { static::$factory = $factory; }