@param DirectiveInterface $directive

@return bool
966058
public function contains(DirectiveInterface $directive)
    {
        foreach ($this->directives as $existingDirective) {
            if ($directive->equals($existingDirective)) {
                return true;
            }
        }

        return false;
    }
263931
public function handle(CommandInterface $command)
    {
        $object = $command->getParameter('data');

        if ($command->hasParameter('class')) {
            $class = $command->getParameter('class');
            if (!($object instanceof $class)) {
                return CommandResult::error('invalid_instance');
            }
        }

        try {
            $this->objectManager->flush();
        } catch (ForeignKeyConstraintViolationException $e) {
            return CommandResult::error('constraint_violation');
        }
    }
1018694
public function isScenarioMatch(ScenarioInterface $scenario)
    {
        if ($this->filterMinLine <= $scenario->getLine() && $this->filterMaxLine >= $scenario->getLine()) {
            return true;
        }

        if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
            foreach ($scenario->getExampleTable()->getLines() as $line) {
                if ($this->filterMinLine <= $line && $this->filterMaxLine >= $line) {
                    return true;
                }
            }
        }

        return false;
    }
312790
public function isGranted(DefinitionInterface $definition, $subject = null): bool
    {
        if ($this->isControlled($definition)) {
            return $this->authChecker->isGranted($this->getExpression($definition), $subject);
        }

        return true;
    }
1288955
public function isEAVFilter(FilterInterface $filter): bool
    {
        try {
            $this->getEAVAttributes($filter);

            return true;
        } catch (MissingAttributeException $e) {
            return false;
        }
    }
711471
public function appliesToContext(ContextInterface $context): bool
    {
        if (!$context instanceof TypeContext && !$context instanceof PropertyContext) {
            return false;
        }

        $type = $context->getType();
        if (!preg_match($this->regex, $type->getName())) {
            return false;
        }


        return $this->subRule->appliesToContext($context);
    }
665681
public function isSatisfiedBy(ReturnType\TypeInterface $type)
    {
        return $type->isRealType() && Types::T_BOOL == $type->getDataType();
    }
1173556
public function isInUse(AssetInterface $asset)
    {
        /** @var AssetUsageStrategyInterface $strategy */
        foreach ($this->getUsageStrategies() as $strategy) {
            if ($strategy->isInUse($asset) === true) {
                return true;
            }
        }

        return false;
    }
23443
public function getStateDirective($state, $directive)
    {
        $directive = strtolower($directive);
        if (isset($this->stateDirectives[$state][$directive])) {
            return $this->stateDirectives[$state][$directive];
        }
        return false;
    }
634139
public function get(string $directive, $default = null)
    {
        return $this->has($directive) ? $this->definition[$directive] : $default;
    }
1009798
public function isOperational($moduleName) {
    	if(!array_key_exists($moduleName, $this->modules_list)) {
    		if($module = fw\Module::getModuleByName($moduleName)) {
    			if($module instanceof DependentInterface) {
    				if($module->validatePrerequisites()) {
    					$this->modules_list[$moduleName] = TRUE;
    					return true;
    				} else {
    					// Do not cache the result,
    					// as they could change by the next call to the method
    					return false;
    				}
    			}
    			else {
    				$this->modules_list[$moduleName] = TRUE;
    				return true;
    			}
    		}
    		else {
    			$this->modules_list[$moduleName] = FALSE;
    		}
    	}
    	return $this->modules_list[$moduleName];
    	
    }
110344
public function matches(ConstraintInterface $provider)
    {
        if (false === $this->conjunctive) {
            foreach ($this->constraints as $constraint) {
                if ($constraint->matches($provider)) {
                    return true;
                }
            }

            return false;
        }

        foreach ($this->constraints as $constraint) {
            if (!$constraint->matches($provider)) {
                return false;
            }
        }

        return true;
    }
749466
public function deleteEntity(EntityInterface $entity)
    {
        $delete = $this->tableGateway->getSql()->delete();
        $delete->where->equalTo(
            $this->tableGateway->getPrimaryKey(), $entity->getIdentifier()
        );

        try {
            $this->tableGateway->deleteWith($delete);
        } catch (RuntimeException $e) {
            return false;
        }

        return true;
    }
546693
public function isParentOf($content, ContentInterface $child)
    {
        if ($child instanceof Template) {
            return false;
        }

        if (is_string($content)) {
            // Strip the dev front controller if its defined
            if (strpos($content, '/app_dev.php') !== false) {
                $content = substr($content, strlen('/app_dev.php'));
            }

            // Strip the first character if it's a slash
            if (substr($content, 0, 1) === '/') {
                $content = ltrim($content, '/');
            }

            if (substr($child->getSlug(), 0, strlen($content)) === $content) {
                return true;
            }
        } else {
            if ($child->getId() == $content->getId()) {
                return true;
            }
        }

        return false;
    }
638363
def is_specified_directive(directive: GraphQLDirective):
    """"""
    return isinstance(directive, GraphQLDirective) and any(
        specified_directive.name == directive.name
        for specified_directive in specified_directives
    )
977446
public static function isDirectiveStringValid($directiveString)
    {
        $directiveString = trim($directiveString);

        if ($directiveString === '') {
            return false;
        }

        if (!self::doesDirectiveStringContainFieldValueSeparator($directiveString)) {
            return false;
        }

        if (!self::doesDirectiveStringContainSeparatorBetweenFieldAndValue($directiveString)) {
            return false;
        }

        return true;
    }
818477
public function isSatisfiedBy(ReturnType\TypeInterface $type)
    {
        return false == $type->isRealType() && true == $type->isCollection();
    }