Creation method

@param string $reportType
@param array  $options

@return \LeanPHP\Behat\CodeCoverage\Common\ReportInterface|null
353337
public function create($reportType, array $options)
    {
        if (in_array($reportType, array('clover', 'crap4j', 'html', 'php', 'text', 'xml'))) {
            $className = '\LeanPHP\Behat\CodeCoverage\Common\Report\\'.ucfirst($reportType);

            return new $className($options);
        }

        return null;
    }
1207171
protected function createValidator($type, array $options)
    {
        return \marvin255\serviform\helpers\FactoryValidators::initElement(
            $type,
            $options
        );
    }
772173
public function createForm($data = null, array $options = [])
    {
        return $this->formFactory->create(NodeFormType::class, $data, $options);
    }
4023
public function createForm($type, $data = null, array $options = [])
    {
        return $this->application['form.factory']->create($type, $data, $options);
    }
1303156
public function instance($type = null, $options = array())
	{
		$type = $type ?: $this->getType();

		$signature = serialize(array($type, $options));

		// If the given type has not been created before, we will create the instances
		// here and cache it so we can return it next time very quickly. If there is
		// already a type created by this name, we'll just return that instance.
		if (!isset($this->types[$signature]))
		{
			try
			{
				$document = $this->createType($type, $options);
			}
			catch (Exception $e)
			{
				$document = $this->createType('html', $options);
			}

			$this->types[$signature] = $document;
		}

		return $this->types[$signature];
	}
1289137
public function create($type = null, $data = null, array $options = [])
    {
        if ($type instanceof ResourceInterface) {
            $type = $this->parameterResolver->resolveForm($type);
        }

        $validationGroups = $this->parameterResolver->resolveValidationGroups();
        $translationDomain = $this->parameterResolver->resolveTranslationDomain();

        if (!empty($validationGroups)) {
            $options['validation_groups'] = $validationGroups;
        }

        if (!empty($translationDomain)) {
            $options['translation_domain'] = $translationDomain;
        }

        if ($this->parameterResolver->resolveApi()) {
            $options['csrf_protection'] = false;
        }

        return $this->factory->create($type, $data, $options);
    }
1181461
public static function create(array $meets, bool $shouldEndInputHandler, array $fails = null, string $reports = null, int $maximumInvocations = null, int $triggerTimeMilliseconds = null): self
    {
        $event = new self();

        $event->meets                   = $meets;
        $event->shouldEndInputHandler   = $shouldEndInputHandler;
        $event->fails                   = $fails;
        $event->reports                 = $reports;
        $event->maximumInvocations      = $maximumInvocations;
        $event->triggerTimeMilliseconds = $triggerTimeMilliseconds;

        return $event;
    }
833611
public function createFormBuilder($data = null, array $options = array())
    {
        return $this->getFormFactory()->createBuilder(FormType::class, $data, $options);
    }
188548
public static function create($options) {
        if (!is_array($options)) {
            $options = array();
        }

        $flags = isset($options['flags']) ? $options['flags'] : static::FLAG_BESTPERFORMANCE;

        $context = array(
            'flags' => array(
                'errorlog' => $flags & static::FLAG_ERROR_LOG,
                'exception' => $flags & static::FLAG_ERROR_EXCEPTION,
                'skippartial' => $flags & static::FLAG_ERROR_SKIPPARTIAL,
                'standalone' => $flags & static::FLAG_STANDALONEPHP,
                'noesc' => $flags & static::FLAG_NOESCAPE,
                'jstrue' => $flags & static::FLAG_JSTRUE,
                'jsobj' => $flags & static::FLAG_JSOBJECT,
                'jslen' => $flags & static::FLAG_JSLENGTH,
                'hbesc' => $flags & static::FLAG_HBESCAPE,
                'this' => $flags & static::FLAG_THIS,
                'nohbh' => $flags & static::FLAG_NOHBHELPERS,
                'parent' => $flags & static::FLAG_PARENT,
                'echo' => $flags & static::FLAG_ECHO,
                'advar' => $flags & static::FLAG_ADVARNAME,
                'namev' => $flags & static::FLAG_NAMEDARG,
                'spvar' => $flags & static::FLAG_SPVARS,
                'slash' => $flags & static::FLAG_SLASH,
                'else' => $flags & static::FLAG_ELSE,
                'exhlp' => $flags & static::FLAG_EXTHELPER,
                'lambda' => $flags & static::FLAG_HANDLEBARSLAMBDA,
                'mustlok' => $flags & static::FLAG_MUSTACHELOOKUP,
                'mustlam' => $flags & static::FLAG_MUSTACHELAMBDA,
                'mustsec' => $flags & static::FLAG_MUSTACHESECTION,
                'noind' => $flags & static::FLAG_PREVENTINDENT,
                'debug' => $flags & static::FLAG_RENDER_DEBUG,
                'prop' => $flags & static::FLAG_PROPERTY,
                'method' => $flags & static::FLAG_METHOD,
                'runpart' => $flags & static::FLAG_RUNTIMEPARTIAL,
                'rawblock' => $flags & static::FLAG_RAWBLOCK,
                'partnc' => $flags & static::FLAG_PARTIALNEWCONTEXT,
                'nostd' => $flags & static::FLAG_IGNORESTANDALONE,
                'strpar' => $flags & static::FLAG_STRINGPARAMS,
                'knohlp' => $flags & static::FLAG_KNOWNHELPERSONLY,
            ),
            'delimiters' => array(
                isset($options['delimiters'][0]) ? $options['delimiters'][0] : '{{',
                isset($options['delimiters'][1]) ? $options['delimiters'][1] : '}}',
            ),
            'level' => 0,
            'stack' => array(),
            'currentToken' => null,
            'error' => array(),
            'elselvl' => array(),
            'elsechain' => false,
            'tokens' => array(
                'standalone' => true,
                'ahead' => false,
                'current' => 0,
                'count' => 0,
                'partialind' => '',
            ),
            'usedPartial' => array(),
            'partialStack' => array(),
            'partialCode' => array(),
            'usedFeature' => array(
                'rootthis' => 0,
                'enc' => 0,
                'raw' => 0,
                'sec' => 0,
                'isec' => 0,
                'if' => 0,
                'else' => 0,
                'unless' => 0,
                'each' => 0,
                'this' => 0,
                'parent' => 0,
                'with' => 0,
                'comment' => 0,
                'partial' => 0,
                'dynpartial' => 0,
                'inlpartial' => 0,
                'helper' => 0,
                'delimiter' => 0,
                'subexp' => 0,
                'rawblock' => 0,
                'pblock' => 0,
                'lookup' => 0,
                'log' => 0,
            ),
            'usedCount' => array(
                'var' => array(),
                'helpers' => array(),
                'runtime' => array(),
            ),
            'compile' => false,
            'parsed' => array(),
            'partials' => (isset($options['partials']) && is_array($options['partials'])) ? $options['partials'] : array(),
            'partialblock' => array(),
            'inlinepartial' => array(),
            'helpers' => array(),
            'renderex' => isset($options['renderex']) ? $options['renderex'] : '',
            'prepartial' => (isset($options['prepartial']) && is_callable($options['prepartial'])) ? $options['prepartial'] : false,
            'helperresolver' => (isset($options['helperresolver']) && is_callable($options['helperresolver'])) ? $options['helperresolver'] : false,
            'partialresolver' => (isset($options['partialresolver']) && is_callable($options['partialresolver'])) ? $options['partialresolver'] : false,
            'runtime' => isset($options['runtime']) ? $options['runtime'] : '\\LightnCandy\\Runtime',
            'runtimealias' => 'LR',
            'safestring' => '\\LightnCandy\\SafeString',
            'safestringalias' => isset($options['safestring']) ? $options['safestring'] : 'LS',
            'rawblock' => false,
            'funcprefix' => uniqid('lcr'),
        );

        $context['ops'] = $context['flags']['echo'] ? array(
            'seperator' => ',',
            'f_start' => 'echo ',
            'f_end' => ';',
            'op_start' => 'ob_start();echo ',
            'op_end' => ';return ob_get_clean();',
            'cnd_start' => ';if ',
            'cnd_then' => '{echo ',
            'cnd_else' => ';}else{echo ',
            'cnd_end' => ';}echo ',
            'cnd_nend' => ';}',
        ) : array(
            'seperator' => '.',
            'f_start' => 'return ',
            'f_end' => ';',
            'op_start' => 'return ',
            'op_end' => ';',
            'cnd_start' => '.(',
            'cnd_then' => ' ? ',
            'cnd_else' => ' : ',
            'cnd_end' => ').',
            'cnd_nend' => ')',
        );

        $context['ops']['enc'] = $context['flags']['hbesc'] ? 'encq' : 'enc';
        $context['ops']['array_check'] = '$inary=is_array($in);';
        static::updateHelperTable($context, $options);

        if ($context['flags']['partnc'] && ($context['flags']['runpart'] == 0)) {
            $context['error'][] = 'The FLAG_PARTIALNEWCONTEXT requires FLAG_RUNTIMEPARTIAL! Fix your compile options please';
        }

        return $context;
    }
212691
public function create(array $options = [])
    {
        foreach (['host', 'port', 'username', 'secret'] as $key) {
            $options[$key] = Arr::get($options, $key, null);
        }
        $promise = $this->connector->create($options['host'], $options['port'])->then(function (Stream $stream) {
            return new Client($stream, new Parser());
        });
        if (!is_null($options['username'])) {
            $promise = $promise->then(function (Client $client) use ($options) {
                $sender = new ActionSender($client);

                return $sender->login($options['username'], $options['secret'])->then(
                    function () use ($client) {
                        return $client;
                    },
                    function ($error) use ($client) {
                        $client->close();
                        throw $error;
                    }
                );
            }, function ($error) {
                throw $error;
            });
        }

        return $promise;
    }
989081
public function createForm(array $options = array())
    {
        $options = array_merge(array('validation_groups' => $this->validationGroups), $options);
        
        return $this->formFactory->createNamed($this->name, $this->type, null, $options);
    }
191657
public function createForm($name, $type = "form", array $data = array(), array $options = array())
    {
        if (empty($name)) {
            $name = static::EMPTY_FORM_NAME;
        }

        return $this->getTheliaFormFactory()->createForm($name, $type, $data, $options);
    }
166113
public function createType($type, array $options = [])
    {
        $class = isset($this->mappingTypeList[$type]) ? $this->mappingTypeList[$type] : $type;
        if (!class_exists($class)) {
            throw new DataTypeNotFoundException($type, $class);
        }

        return new MetadataType($class, $options);
    }
1096622
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $service = new ReportCollector();

        /** @var Service\Report $reportService */
        $reportService = $serviceLocator->get('KmbPuppetDb\Service\Report');
        $service->setReportService($reportService);

        /** @var QueryBuilderInterface $reportsEnvironmentsQueryBuilder */
        $reportsEnvironmentsQueryBuilder = $serviceLocator->get('KmbPuppetDb\Query\ReportsEnvironmentsQueryBuilder');
        $service->setReportsEnvironmentsQueryBuilder($reportsEnvironmentsQueryBuilder);

        /** @var EnvironmentInterface $permissionEnvironmentService */
        $permissionEnvironmentService = $serviceLocator->get('KmbPermission\Service\Environment');
        $service->setPermissionEnvironmentService($permissionEnvironmentService);

        return $service;
    }
84272
public function Create($reportRequest, $idempotencyKey = null)
    {
        $type = $reportRequest->ReportType;

        if (is_null($type) || strlen($type) == 0)
            throw new Libraries\Exception('Report type property is required when create a report request.');

        switch ($type) {
            case ReportType::Transactions:
                return $this->CreateObject('reports_transactions_create', $reportRequest, '\MangoPay\ReportRequest', $type, null, $idempotencyKey);
            case ReportType::Wallets:
                return $this->CreateObject('reports_wallets_create', $reportRequest, '\MangoPay\ReportRequest', $type, null, $idempotencyKey);
            default:
                throw new Libraries\Exception('Unexpected Report type. Wrong ReportType value.');
        }
    }
300491
private function request(ReportRequest $reportRequest, array $options = [])
    {
        $reportDefinition = $reportRequest->getDefinition();

        if (empty($reportDefinition)) {
            throw new ReportDefinitionException(sprintf(
                'The report definition cannot be empty. Was expected XML document. You can build it with builder %s.',
                ReportDefinitionBuilder::class
            ));
        }

        $request = new Request(
            'POST',
            $this->user->resolveWsdl(self::ENDPOINT),
            $this->buildRequestHeaders($reportRequest),
            $reportDefinition
        );
        $invoker = $this->user->getInvoker();

        return $invoker(function () use ($request, $options, $reportRequest) {
            $this->lastRequest = $request;

            $event = new PreCallEvent('Reports:request', [$reportRequest], $this->user);
            $this->dispatcher->dispatch(Events::BEFORE_REQUEST, $event);

            $response = $this->httpClient->send($request, $options + [
                RequestOptions::HTTP_ERRORS => false,
            ]);
            $this->lastResponse = $response;

            if ($response->getStatusCode() >= 200 && $response->getStatusCode() <= 202) {
                $event = new PostCallEvent(
                    'Reports:request',
                    [$reportRequest],
                    $this->user,
                    $this,
                    $response->getBody()
                );
                $this->dispatcher->dispatch(Events::AFTER_REQUEST, $event);

                return $response;
            }

            $exception = $this->createException($response);

            $event = new FailCallEvent('Reports:request', [$reportRequest], $this->user, $this, $exception);
            $this->dispatcher->dispatch(Events::FAIL_REQUEST, $event);

            throw $exception;
        });
    }
279373
public function runExport(array $options, OutputInterface $output)
    {
        $options = $this->validate($options);

        $options['contentTypeIds'] = Text::getIdListFromString($options['contentTypeIdList']);
        $chunkDir = $this->fileSystemHelper->createChunkDir();

        $languages = $this->getLanguages($options);
        $options['languages'] = $languages;

        try {
            $this->fileSystemHelper->lock();
            $urls = $this->generateFiles($languages, $chunkDir, $options, $output);
            $this->fileSystemHelper->unlock();

            $credentials = $this->authenticator->getCredentials();
            $securedDirCredentials = $this->fileSystemHelper->secureDir($chunkDir, $credentials);

            $response = $this->exportNotifier->sendRecommendationResponse($urls, $options, $securedDirCredentials);
            $this->logger->info(sprintf('eZ Recommendation Response: %s', $response));
            $output->writeln('Done');
        } catch (Exception $e) {
            $this->logger->error(sprintf('Error while generating export: %s', $e->getMessage()));
            $this->fileSystemHelper->unlock();

            throw $e;
        }
    }