make

@param array $dados

@return GenericContract
487961
public static function make($dados)
    {

        $behavior = array_key_exists(
            'behavior',
            $dados
        ) ? $dados['behavior'] : [];

        switch ($dados['type']) {
            case 'int':
                return new IntegerBehavior($behavior);
        }

        return new GenericBehavior($behavior);
    }
346567
public function make($records, $adapter = null, $config = array())
    {
        $config = array_merge($this->getConfig(), $config);
        $this->setConfig($config);
        $configHelper = new ConfigHelper($this->getConfig());

        if ($adapter) {
            $this->setAdapter($adapter);
        }

        $recordSet = $this->generate($records,$configHelper);
        $infiniteScroll = new InfiniteScroll(new ViewLoader(), $configHelper);

        $linkCreator = new LinkCreator($configHelper, $infiniteScroll);
        $links = $linkCreator->createLinks($recordSet->total());
        $recordSet->setLinks($links);
        return $recordSet;
    }
853237
public function make(array $rules, AppliesToResource $resource=null)
    {
        $validator = call_user_func($this->factory, $rules, $resource);
        return $this->configureAndReturn($validator, $rules, $resource);
    }
1354035
public function make(array $config)
    {
        Arr::requires($config, ['endpoint']);

        $client = new Client();

        return new WebhookGateway($client, $config);
    }
281425
public function make($class, $wsdl, array $config = [])
    {
        $reflectionClass = new ReflectionClass($class);

        /** @var SoapClient $client */
        $client = $reflectionClass->newInstanceArgs([ $wsdl, $config ]);

        return $client;
    }
548253
public function make(array $attributes = [])
    {
        $instance = $this->related->newInstance($attributes);
        $this->setForeignAttributesForCreate($instance);
        return $instance;
    }
858370
private function prepareDateTime(string $dado)
    {
        $dado = " ".strip_tags(trim($dado))." ";

        if(preg_match("/\D(\d{1,2})*\W*(jan|fev|feb|mar|abr|apr|mai|may|jun|jul|ago|aug|set|sep|out|oct|nov|dez|dec)(eiro|uary|ereiro|bruary|ço|ch|ho|e|y|sto|ust|embro|termber|ubro|ober|ember)*\D/i", $dado, $diaMes)){
            $this->setMes($diaMes[2], true);
            if(!empty($diaMes[1]))
                $this->setDia($diaMes[1]);
        }

        if(preg_match("/\D((20|19)\d{2})\D/i", $dado, $ano))
            $this->setAno($ano[1], true);

        if(preg_match('/ (\d{1,2}),/i', $dado, $dia))
            $this->setDia($dia[1], true);

        if(preg_match("/\D(\d{1,4})[-\/,._;\\\](\d{1,2})[-\/,._;\\\](\d{1,4})\D/i", $dado, $dateTime)){

            if(!(strlen($dateTime[3]) > 2 && strlen($dateTime[1]) > 2)) {
                $ano = date('y');
                if (strlen($dateTime[3]) < 3 && (($dateTime[1] > 31 && $dateTime[3] < 32 && $dateTime[3] > 0) || (strlen($dateTime[3]) === 1 && strlen($dateTime[1]) > 1) ||
                        (strlen($dateTime[3]) === 2 && strlen($dateTime[1]) === 2 &&
                            ($dateTime[1] === $ano && $dateTime[3] !== $ano)
                            || ($dateTime[1] > ($ano - 3) && $dateTime[1] < ($ano + 2) && ($dateTime[3] > ($ano + 1) || $dateTime[3] < ($ano - 2)))))) {

                    $this->setAno($dateTime[1], true);
                    $this->setMes($dateTime[2], true);
                    $this->setDia($dateTime[3], true);
                } else {
                    $this->setAno($dateTime[3], $dateTime[3] > 31 && $dateTime[1] < 32);
                    $this->setMes($dateTime[2], true);
                    $this->setDia($dateTime[1], $dateTime[3] > 31 && $dateTime[1] < 32);
                }
            }
        }

        if(preg_match("/\D(\d{1,2})\W*h(r|s|our|ora|ours|oras)*[^a-zA-Z]/i", $dado, $hora)){
            $this->setHora($hora[1], true);
        }

        if(preg_match("/\D(\d{1,2})\W*m(i|in|inuto|inutos|inute|inutes)*[^a-zA-Z]/i", $dado, $minuto)){
            $this->setMinuto($minuto[1], true);
        }

        if(preg_match("/\D(\d{1,2})\W*s(e|eg|egundo|egundos|econd|econds)*[^a-zA-Z]/i", $dado, $segundo)){
            $this->setSegundo($segundo[1]);
        }

        if(preg_match("/\D(\d{1,2}):(\d{1,2})(:(\d{1,2}))*\D/i", $dado, $tempo)){
            $this->setHora($tempo[1], isset($tempo[4]));
            $this->setMinuto($tempo[2], isset($tempo[4]));
            if(isset($tempo[4])) {
                $this->setSegundo($tempo[4], true);
            }
        }
    }
788330
public static function make($attributes = [])
    {
        $jobset = new static();

        // make jobset model
        $model = $jobset->makeModel($attributes);
        // update local model
        $jobset->setModel($model);
        // make job models and init job instances
        $jobset->makeJobs();
        // set jobset try at
        $jobsetTryAt = $jobset->getJobsEarliestTryAt();
        $jobset->model->setTryAt($jobsetTryAt);
        $jobset->model->persist();

        return $jobset;
    }
160672
private function createManifest(array $dados)
    {
        //Cria Tamanhos de Ícones
        $this->createFaviconSizes($dados);

        //Create Manifest
        $theme = explode("}", explode(".theme{", file_get_contents(PATH_HOME . "public/assets/theme.min.css"))[1])[0];
        $themeBack = explode("!important", explode("background-color:", $theme)[1])[0];
        $themeColor = explode("!important", explode("color:", $theme)[1])[0];
        $faviconName = pathinfo($dados['favicon'], PATHINFO_FILENAME);
        $faviconExt = pathinfo($dados['favicon'], PATHINFO_EXTENSION);
        $content = str_replace(['{$sitename}', '{$faviconName}', '{$faviconExt}', '{$theme}', '{$themeColor}'], [$dados['sitename'], $faviconName, $faviconExt, $themeBack, $themeColor], file_get_contents(PATH_HOME . VENDOR . "config/public/installTemplates/manifest.txt"));

        $fp = fopen(PATH_HOME . "manifest.json", "w");
        fwrite($fp, $content);
        fclose($fp);
    }
1356384
public function make( $options ) {
		if ( is_string( $options ) ) {
			return $this->makeFromUrl( $options );
		}

		if ( is_array( $options ) ) {
			return $this->makeFromArray( $options );
		}

		if ( $options instanceof Closure ) {
			return $this->makeFromClosure( $options );
		}

		throw new ConfigurationException( 'Invalid condition options supplied.' );
	}
435373
public function make(array $storage)
    {
        return new Slice(
            $this->helper,
            $storage,
            $this->withParameters ? $this->parameters : null
        );
    }
840387
public function make($driver, array $config = [])
    {
        switch ($driver) {
            case '/dev/null':
                return new DevNullPubSubAdapter();
            case 'local':
                return new LocalPubSubAdapter();
            case 'redis':
                return $this->makeRedisAdapter($config);
            case 'kafka':
                return $this->makeKafkaAdapter($config);
            case 'gcloud':
                return $this->makeGoogleCloudAdapter($config);
            case 'http':
                return $this->makeHTTPAdapter($config);
        }

        throw new InvalidArgumentException(sprintf('The driver [%s] is not supported.', $driver));
    }
175347
public function make(array $rules, AppliesToResource $resource=null)
    {

        if (!$rules) {
            return null;
        }

        $validator = $this->createObject(GenericValidator::class)->setRules($rules);
        return $this->configureAndReturn($validator, $rules, $resource);
    }
231873
public static function create($source)
    {
        if (is_array($source)) {
            $source = new Collection($source);
        }

        return parent::create($source);
    }
702566
public function make(array $rules, AppliesToResource $resource=null)
    {

        if (!$resource) {
            $validator = $this->firstNotNullResultOrFail('make', $rules, $resource);
            return $this->configureAndReturn($validator, $rules, $resource);
        }

        $resourceName = $resource->resourceName();

        if (!isset($this->resourceFactories[$resourceName])) {
            return $this->firstNotNullResultOrFail('make', $rules, $resource);
        }

        $validator = call_user_func($this->resourceFactories[$resourceName]);

        return $this->configureAndReturn($validator, $rules, $resource);

    }
1058583
public function make(array $config)
    {
        Arr::requires($config, ['token']);

        $client = new Client();

        return new GitterGateway($client, $config);
    }
663490
public function make($abstract, $args = [])
    {
        $abstract = isset($this->aliases[$abstract]) ? $this->aliases[$abstract] : $abstract;

        if (isset($this->instances[$abstract])) {
            return $this->instances[$abstract];
        }

        $concrete = isset($this->bindings[$abstract]) ? $this->bindings[$abstract]['concrete'] : $abstract;

        if ($abstract == $concrete || $concrete instanceof Closure) {
            $object = $this->build($concrete, $args);
        } else {
            $object = $this->make($concrete, $args);
        }

        if ($this->isShared($abstract)) {
            $this->instances[$abstract] = $object;
        }

        return $object;
    }