@param string                                       $name
@param \LaravelRocket\Generator\Objects\Definitions $json

@return bool
331041
public function generate(string $name, $json): bool
    {
        $this->json = $json;
        $this->name = $this->normalizeName($name);

        if (!$this->canGenerate()) {
            return false;
        }

        $view      = $this->getView();
        $variables = $this->getVariables();

        $path = $this->getPath();
        if (file_exists($path)) {
            unlink($path);
        }
        $this->fileService->render($view, $path, $variables);

        return true;
    }
341970
public static function directiveHasArgument(DirectiveNode $directiveDefinition, string $name): bool
    {
        return (new Collection($directiveDefinition->arguments))
            ->contains(function (ArgumentNode $argumentNode) use ($name): bool {
                return $argumentNode->name->value === $name;
            });
    }
167097
public function has(string $name): bool
    {
        foreach ($this->elements as $element) {
            if ($element instanceof NamedInterface && $element->getName() == $name) {
                return true;
            }
        }

        return false;
    }
869524
public static function hasTask($name)
    {
        if (!self::$tasks) {
            return false;
        }
        if (isset(self::$tasks[$name])) {
            return true;
        }

        return false;
    }
75184
public static function hasDirectiveDefinition(Node $definitionNode, string $name): bool
    {
        return (new Collection($definitionNode->directives))
            ->contains(function (DirectiveNode $directiveDefinitionNode) use ($name): bool {
                return $directiveDefinitionNode->name->value === $name;
            });
    }
310376
public function hasConcreteMethod($name) {
    if (!array_key_exists($name,$this->methods)) {
      return FALSE;
    }
    $method = $this->getMethod($name);
    
    return !$method->getDeclaringClass()->isInterface();
  }
1355014
public function hasRoutes(string $name): bool{
        return (isset($this->routes[$name]) && !empty($this->routes[$name]));
    }
743438
public function dontSeeResponseContainsJson($json = [])
    {
        $jsonResponseArray = new JsonArray($this->connectionModule->_getResponseContent());
        $this->assertFalse(
            $jsonResponseArray->containsArray($json),
            "Response JSON contains provided JSON\n"
            . "- <info>" . var_export($json, true) . "</info>\n"
            . "+ " . var_export($jsonResponseArray->toArray(), true)
        );
    }
384226
private function processFieldHierarchyRecursive($name, $data)
    {
        // array field
        if (isset($data["\x00array"])) {
            return new JsonDefinitionArray(
                $name,
                $this->processFieldHierarchyRecursive($name, $data["\x00array"])
            );
        }

        // simple field
        if (array_keys($data) === ["\x00field"]) {
            return $this->processSimpleField($name, $data["\x00field"]);
        }


        // hash field
        $fields = [];
        $definition = null;
        foreach ($data as $subname => $subdata) {
            if ($subname === "\x00field") {
                $definition = $subdata;
            } else {
                $fields[$subname] = $this->processFieldHierarchyRecursive($subname, $subdata);
            }
        }
        return new JsonDefinitionHash($name, $this, $fields, $definition);
    }
22965
public function hasExtension($name)
    {
        return isset($this->extensions[$name]) || isset($this->extensionsByNs[$name]);
    }
834777
public static function addRepository($alias, $json)
	{
		$config = self::_getConfig();
		$configSource = $config->getConfigSource();
		$value = JsonFile::parseJson($json);
		$configSource->addRepository($alias, $value);
	}
1295136
public function createGroup($name){
        if (!$this->access_token && !$this->checkAuth()) return false;
        $data = array(
                'group'=>array('name'=>$name)
        );
        $result = $this->http_post(self::API_URL_PREFIX.self::GROUP_CREATE_URL.'access_token='.$this->access_token,self::json_encode($data));
        if ($result)
        {
            $json = json_decode($result,true);
            if (!$json || !empty($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            return $json;
        }
        return false;
    }
659049
public static function has($name)
    {
        //convert FQN into type,
        //allowing the use of FQN for GraphQL scalar types
        if (class_exists($name) || interface_exists($name)) {
            if (\in_array($name, self::$typesMap, true)) {
                $name = array_flip(self::$typesMap)[$name];
            }
        }

        if (!array_key_exists($name, self::$types) && array_key_exists($name, self::$typesMap)) {
            static::create($name);
        }

        return array_key_exists($name, self::$types);
    }
225874
public function procedureFromArray(string $name, array $json)
    {
        $description = 'No description found';
        $parsedCommands = [];

        if(isset($json['description'])) {
            $description = $json['description'];
        }

        if(isset($json['commands'])) {
            $parsedCommands = $this->parseCommands($json['commands'], $name);
        }

        return new Procedure($name, $description, $parsedCommands);
    }
530019
public function has($name)
    {
        $names = is_array($name) ? $name : func_get_args();

        foreach ($names as $value) {
            if (! $this->routes->hasNamedRoute($value)) {
                return false;
            }
        }

        return true;
    }
697849
public function parseRelationship(string $index, string $name, array $jsonData): bool
    {
        $this->resetAggregators();

        $isFoundInToOne  = array_key_exists($name, $this->getSerializer()::readRulesIndexes($this->getToOneRules()));
        $isFoundInToMany = $isFoundInToOne === false &&
            array_key_exists($name, $this->getSerializer()::readRulesIndexes($this->getToManyRules()));

        if ($isFoundInToOne === false && $isFoundInToMany === false) {
            $title   = $this->formatMessage(Messages::INVALID_VALUE);
            $details = $this->formatMessage(Messages::UNKNOWN_RELATIONSHIP);
            $status  = JsonApiResponse::HTTP_UNPROCESSABLE_ENTITY;
            $this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, (string)$status);
            $this->addErrorStatus($status);
        } else {
            assert($isFoundInToOne xor $isFoundInToMany);
            $ruleIndexes = $this->getSerializer()::readSingleRuleIndexes(
                $isFoundInToOne === true ? $this->getToOneRules() : $this->getToManyRules(),
                $name
            );

            // now execute validation rules
            $this->executeStarts($this->getSerializer()::readRuleStartIndexes($ruleIndexes));
            $ruleIndex = $this->getSerializer()::readRuleIndex($ruleIndexes);
            $isFoundInToOne === true ?
                $this->validateAsToOneRelationship($ruleIndex, $name, $jsonData) :
                $this->validateAsToManyRelationship($ruleIndex, $name, $jsonData);
            $this->executeEnds($this->getSerializer()::readRuleEndIndexes($ruleIndexes));

            if (count($this->getErrorAggregator()) > 0) {
                $status  = JsonApiResponse::HTTP_CONFLICT;
                foreach ($this->getErrorAggregator()->get() as $error) {
                    $this->getJsonApiErrorCollection()->addValidationRelationshipError($error, $status);
                    $this->addErrorStatus($status);
                }
                $this->getErrorAggregator()->clear();
            }
        }

        $hasNoErrors = count($this->getJsonApiErrorCollection()) <= 0;

        return $hasNoErrors;
    }
337332
public function generate($table, $tables, $json): bool
    {
        $this->json = $json;

        $this->setTargetTable($table, $tables);

        if (!$this->canGenerate()) {
            return false;
        }

        $view      = $this->getView();
        $variables = $this->getVariables();

        $path = $this->getPath();
        if (file_exists($path)) {
            unlink($path);
        }
        $this->fileService->render($view, $path, $variables);

        return true;
    }