@param string $interfaceName
@param bool $includeSelf

@return bool
7645
function extendsOrImplementsInterface($interfaceName, $includeSelf) {
    $interfacesAll = $this->getAllInterfaces($includeSelf);
    return isset($interfacesAll[$interfaceName]);
  }
703110
public static function getAncestors($source,$idField,$pidField,$fieldValue,$includeSelf=true)
    {
        $returnValue=[];
        $current=null;
        foreach($source as $row){
            $idValue=Convert::getFieldValue($row, $idField,true);
            if($idValue==$fieldValue){
                $current=$row;
                if($includeSelf){
                    $returnValue[]=$current;
                }
                break;
            }
        }
        $pidValue=Convert::getFieldValue($current, $pidField,true);
        while($pidValue){
            $current=self::_getAncestors($source,$idField,$pidValue);
            if(!empty($current)){
                $returnValue[]=$current;
                $pidValue=Convert::getFieldValue($current, $pidField,true);
            }else{
                break;
            }
        }

        //echo $returnValue[1][$idField];
        return array_reverse($returnValue);
    }
722593
protected function isSameHost(RequestInterface $request, UriInterface $serverOrigin): bool
	{
		$hostUrl = $request->getUri();

		return $hostUrl->getPort() === $serverOrigin->getPort() &&
			$hostUrl->getHost() === $serverOrigin->getHost();
	}
896247
public function getEntityPostfixByInterfaceName($entityInterfaceName)
    {
        if (false === $this->hasEntityPostfixByInterfaceName($entityInterfaceName)) {
            $errMsg = sprintf('Error build entity postfix for %s', $entityInterfaceName);
            throw new Exception\ErrorBuildEntityPostfixException($errMsg);
        }

        return $this->interfaceNameToEntityPostfix[$entityInterfaceName];
    }
1039910
public static boolean hasInterface(Class intf, Class cls) {
    boolean	result;
    String	key;

    key = intf.getName() + "-" + cls.getName();
    if (m_CheckInterface.containsKey(key))
      return m_CheckInterface.get(key);

    result = intf.isAssignableFrom(cls);
    m_CheckInterface.put(key, result);

    return result;
  }
419144
private static boolean isInternal(String clsName) {
        boolean internal = false;
        for (String internalPackage : internalPackages) {
            if (clsName.startsWith(internalPackage)) {
                internal = true;
                break;
            }
        }

        if (internal) {
            for (String externalPackage : externalPackages) {
                if (clsName.startsWith(externalPackage)) {
                    internal = false;
                    break;
                }
            }
        }

        return internal;
    }
1008036
private synchronized boolean isIncluded(String _clazzName) {
        if (includes.size() > 0) {
            for (String include : includes) {
                if (_clazzName.startsWith(include)) {
                    return true;

                }
            }
        } // if we dont have a list, we include nothing (to prevent circular classloader dependencies)
        return false;
    }
737716
final protected function assertInterfaceSatisfiesSpecification(callable $specification, string $interfaceName, string $message = ''): void
    {
        $this->assertInterfaceExists($interfaceName);

        self::assertTrue($specification($interfaceName), \sprintf(
            '' !== $message ? $message : 'Failed asserting that interface "%s" satisfies a specification.',
            $interfaceName
        ));
    }
680729
public static function make(string $interfaceName)
    {
        if (self::$container === null) {
            throw new \Exception("Undefined DI Container");
        }

        try {
            return self::$container->get($interfaceName);
        } catch (\Exception $ex) {
            echo "Unable to find Interface inside container " . $ex->getMessage();
        }
    }
733022
public function hasDimension( $contextRef, $dimension, $includeDefault = false )
	{
		if ( ! isset( $this->contexts[ $contextRef ] ) )
		{
			return false;
		}

		$paths = array(
			array( 'entity', 'segment' ),
			array( 'scenario' ),
			array( 'entity', 'scenario' ),
			array( 'segment' ),
		);

		foreach ( $paths as $path )
		{
			$context = $this->contexts[ $contextRef ];
			foreach ( $path as $element )
			{
				if ( ! isset( $context[ $element ] ) ) continue 2;
				$context = $context[ $element ];
			}

			if ( isset( $context['explicitMember'] ) )
			{
				foreach ( $context['explicitMember'] as $dimensionDefinition )
				{
					if ( $dimensionDefinition['dimension'] == $dimension ) return true;
				}
			}

			if ( isset( $context['typedMember'] ) )
			{
				foreach ( $context['typedMember'] as $dimensionDefinition )
				{
					if ( $dimensionDefinition['dimension'] == $dimension ) return true;
				}
			}
		}

		return false;
	}
208138
public function hasArguments($includeBase = true)
    {
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        if (count($this->arguments) > 0) {
            return true;
        }

        if ($includeBase && $this->baseFormat) {
            return $this->baseFormat->hasArguments();
        }

        return false;
    }
424492
public function getAncestors($includeSelf = false)
    {
        $ancestors = new ArrayList();
        $object = $this->owner;

        if ($includeSelf) {
            $ancestors->push($object);
        }
        while ($object = $object->getParent()) {
            $ancestors->push($object);
        }

        return $ancestors;
    }
449104
public void addInterface(String interfaceName) {
        if (!mInterfaceSet.contains(interfaceName)) {
            mInterfaces.add(mCp.addConstantClass(interfaceName));
            mInterfaceSet.add(interfaceName);
        }
    }
1174012
public static function delete(string $dir, bool $isIncludeSelf = false):bool
    {
        if (!is_dir($dir)) {
            return false;
        }
        $handle = opendir($dir);
        while ($file = readdir($handle)) {
            if ($file != '.' && $file != '..') {
                $realPath = realpath($dir . '/' . $file);
                if (is_dir($realPath)) {
                    static::delete($realPath, true);
                } else {
                    unlink($realPath);
                }
            }
        }
        closedir($handle);
        if ($isIncludeSelf) {
            return rmdir($dir);
        }
        return true;
    }
160326
public static function ofInterface($fullName)
    {
        $result = self::of($fullName);
        if (!($result instanceof InterfaceType))
            throw new InvalidArgumentException("Argument 'fullName' does not describe an interface.");
        return $result;
    }
441177
public function hasMultiValuedArgument($includeBase = true)
    {
        Assert::boolean($includeBase, 'The parameter $includeBase must be a boolean. Got: %s');

        if ($this->hasMultiValuedArg) {
            return true;
        }

        if ($includeBase && $this->baseFormat) {
            return $this->baseFormat->hasMultiValuedArgument();
        }

        return false;
    }
494109
public function get_parent_context_ids($includeself = false) {
        if (empty($this->_path)) {
            return array();
        }

        $parentcontexts = trim($this->_path, '/'); // kill leading slash
        $parentcontexts = explode('/', $parentcontexts);
        if (!$includeself) {
            array_pop($parentcontexts); // and remove its own id
        }

        return array_reverse($parentcontexts);
    }