Create provider instance

@param string $type Provider typ to initialize
@param mixed $data Provider data

return \Phrozn\Provider
779263
public function create($type, $data)
    {
        // try to see if we have user defined plugin
        $class = 'PhroznPlugin\\Provider\\' . ucfirst($type);
        if (!class_exists($class)) {
            $class = 'Phrozn\\Provider\\' . ucfirst($type);
            if (!class_exists($class)) {
                throw new \RuntimeException("Provider of type '{$type}' not found..");
            }
        }
        $object = new $class;
        $object->setConfig($data);
        return $object;
    }
149448
public function make($data)
    {
        $driver = $this->instance ?? $this->createDriver();

        return $driver->init($data);
    }
1229842
public function create($data)
    {
        $descriptor = new MethodDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setMethodName($data->getMethodName());
        $descriptor->setStatic($data->isStatic());

        $response = new ReturnDescriptor('return');
        $response->setType($data->getReturnType());
        $descriptor->setResponse($response);

        foreach ($data->getArguments() as $argument) {
            if (array_key_exists('name', $argument) && array_key_exists('type', $argument)) {
                $argumentDescriptor = $this->createArgumentDescriptorForMagicMethod(
                    $argument['name'],
                    $argument['type']
                );
                $descriptor->getArguments()->set($argumentDescriptor->getName(), $argumentDescriptor);
            }
        }

        return $descriptor;
    }
1269425
public function pack(string $type, array $data): string
    {
        return $this->getPacker()->pack($type, $data);
    }
1165327
public static function create($data)
    {
        if (!$data) {
            return new self(self::COLLECTION_NAME);
        }

        $type = null;
        if (isset($data[self::COLLECTION_NAME])) {
            $type = self::COLLECTION_NAME;
        } elseif (isset($data[self::CONDITION_NAME])) {
            $type = self::CONDITION_NAME;
        }
        if (null === $type) {
            throw new ContainerException(
                sprintf('Invalid container type. Use %s', implode(' or ', self::ALLOWED_TYPES))
            );
        }
        if (!is_array($data[$type])) {
            throw new ContainerException(sprintf('Parameter "%s" must be array', $type));
        }
        /** @var Container $mainContainer */
        $mainContainer = new self($type);
        if (isset($data[self::AND_OR_OPERATOR_NAME])) {
            $mainContainer->setAndOr($data[self::AND_OR_OPERATOR_NAME]);
        }
        if (self::COLLECTION_NAME === $type) {
            foreach ($data[$type] as $datum) {
                $mainContainer->addToCollection(self::create($datum));
            }
        } elseif (self::CONDITION_NAME === $type) {
            $mainContainer->getCondition()->setData($data[$type]);
        }

        return $mainContainer;
    }
510080
protected function create($type)
	{
		if ( !isset($this->browserConfigurations[$type]) ) {
			throw new \InvalidArgumentException('Browser configuration type "' . $type . '" not registered');
		}

		return clone $this->browserConfigurations[$type];
	}
50030
public function create(string $type) : ?Controller
    {
        if (\class_exists($type) === false) {
            return $this->fallthrough($type);
        }

        $ref = new \ReflectionClass($type);
        $ctor = $ref->getConstructor();
        if ($ctor === null || $ctor->getNumberOfParameters() === 0) {
            return new $type();
        }

        return $this->fallthrough($type);
    }
448479
public static function create($type)
	{
		if (strtolower($type) === 'javascript')
		{
			$type = 'js';
		}

		$class = sprintf(__NAMESPACE__ . '\%sMinifier', ucfirst($type));

		if (!class_exists($class))
		{
			throw new \DomainException(sprintf('Class %s not found.', $class));
		}

		return new $class;
	}
43581
public static function createPrepareFields(array &$data, string $type = 'insert') : string
    {
        $string = '';
        $dataTmp = [];
        switch ($type) {
            case 'insert':
                if (isset($data[0]) && \is_array($data[0])) {
                    foreach ($data as $index => &$value) {
                        $tmp = '';
                        foreach ($value as $k => &$v) {
                            $tmp .= ":$k$index,";
                            $dataTmp[$k . $index] = $v;
                        }

                        unset($v);

                        $string .= '(' . trim($tmp, ',') . '),';
                    }

                    unset($value);

                    $string = trim($string, ',');
                    $data = $dataTmp;
                    unset($dataTmp, $tmp, $value);
                } else {
                    $string = '(:' . implode(',:', array_keys($data)) . ')';
                }

                break;

            case 'update':
                $dataTmp = array_map(static function($item) {
                    return "$item = :$item";
                }, array_keys($data));

                $string = implode(', ', $dataTmp);

                break;
        }

        return $string;
    }
1097615
public function createNew($type = OrderTypes::TYPE_ORDER)
    {
        $order = parent::createNew();
        $order->setType($type);

        return $order;
    }
48233
public function encode(string $data, int $type = Protocol::TYPE_TEXT, bool $masked = false)
    {
        $this->frames = [];

        $frame = $this->getFrame();
        array_push($this->frames, $frame);

        $frame->encode($data, $type, $masked);

        return $this;
    }
899015
public function create($data)
    {
        $methodDescriptor = new MethodDescriptor();
        $methodDescriptor->setNamespace(
            substr(
                (string) $data->getFqsen(),
                0,
                -strlen($data->getName()) - 4
            )
        );
        $this->mapReflectorToDescriptor($data, $methodDescriptor);

        $this->assembleDocBlock($data->getDocBlock(), $methodDescriptor);
        $this->addArguments($data, $methodDescriptor);
        $this->addVariadicArgument($data, $methodDescriptor);

        return $methodDescriptor;
    }
1197364
public static function createFromData(array $data)
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::REQUIRED_METHOD);
        }

        if (!in_array($data['method'], self::$availableMethods, true)) {
            throw new DomainException(
                sprintf(self::UNSUPPORTED_METHOD, implode(',', self::$availableMethods))
            );
        }

        return parent::createFromData($data);
    }
1085833
public function create($data)
    {
        $descriptor = new VarDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setVariableName($data->getVariableName());

        $types = $this->builder->buildDescriptor(
            new Collection($data->getVariableName() == '$this' ? array('$this') : $data->getTypes())
        );
        $descriptor->setTypes($types);

        return $descriptor;
    }
1354629
public function createDefaultContainer($type = null, array $data = [], EM\ContentInterface $content = null)
    {
        return $this->getContainerManager()->create($content, $type, $data);
    }
870221
public static function data($data, $type = null)
    {
        $type === null && $type = MongoBinData::BYTE_ARRAY;

        return new MongoBinData($data, $type);
    }
343773
public function newObject($type, array $data = [])
    {
        $type = $this->getFullType($type);
        if (class_exists($type)) {
            $table = $type::getCollection();
            return new $type($data, $this->mongodb->$table, $this->cache);
        }
        return null;
    }