Check if key exist
@param array $resource Resource array
@param string $filename File name
@param string $appname App name
@return int Return if all keys existed
@throws Server500 If a key not exist
965309
private function checkIfKeyExist(array $resource, string $filename, string $appname):int
    {
        if (!isset($resource["activity"])) {
            throw new  Server500(new \ArrayObject(array("explain" => "Missing Tag 'activity' in ".
                strtoupper($filename)." routing file : ".$appname, "solution" => "Please add this tag")));
        }
        if (!isset($resource["name"])) {
            throw new  Server500(new \ArrayObject(array("explain" => "Missing Tag 'name' in ".
                strtoupper($filename)." routing file : ".$appname, "solution" => "Please add this tag")));
        }
        if (!isset($resource["path"])) {
            throw new  Server500(new \ArrayObject(array("explain" => "Missing Tag 'path' in ".
                strtoupper($filename)." routing file : ".$appname, "solution" => "Please add this tag")));
        }


        if ($resource["name"] == "") {
            throw new  Server500(new \ArrayObject(array("explain" => "Empty Tag 'name' in ".
                strtoupper($filename)." routing file : ".$appname, "solution" => "Check contain of this tag")));
        }
        if ($resource["activity"] == "") {
            throw new  Server500(new \ArrayObject(array("explain" => "Empty Tag 'activity' in ".
                strtoupper($filename)." routing file : ".$appname, "solution" => "Check contain of this tag")));
        }
        if ($resource["path"] == "") {
            throw new  Server500(new \ArrayObject(array("explain" => "Empty Tag 'path' in ".
                strtoupper($filename)." routing file : ".$appname, "solution" => "Check contain of this tag")));
        }

        if (isset($resource["visibility"]) && !in_array($resource["visibility"], $this->visibilities)) {
            throw new  Server500(new \ArrayObject(array("explain" =>
                "Tag 'visibility' is empty or parameter for 'visibility' is not recognized in ".
                strtoupper($filename)." routing file - ".$appname, "solution" =>
                "Check contain of this tag (Visibility must be private, public or disabled)")));
        }

        return (1);
    }
695900
public function loadResource($resourceName)
		{
			$resourceLocation = dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."res".DIRECTORY_SEPARATOR.$resourceName;
			$this->resourceContent = $this->readResourceToArray($resourceLocation);
		}
1008331
public function exists($filename, $directory = null)
    {
        $cache_path = $this->config->get('cache_path');

        if (is_null($directory)) {
            $path = $cache_path.$this->config->get('object_dir').$filename.'.cache';
        } else {
            $path = $cache_path.$directory.$filename.'.cache';
        }

        return (bool) file_exists($path);
    }
1353785
function exists( $filename = false )
    {
        if ( !$filename )
            $filename = $this->FileName;
        return $this->doExists( $filename );
    }
111912
public function exist(string $filename): ExistCommand
    {
        /** @var ExistCommand $command */
        $command = $this->builder->build(ExistCommand::class);
        $command->byFilename($filename);

        return $command;
    }
661851
public function contains($filename)
    {
        $this->initialize();

        try {
            $file = $this->matcher->getFile($filename);
        } catch (FileNotFoundException $e) {
            return false;
        }

        foreach ($this->files as $item) {
            if ($item->getFullPath() === $file->getFullPath()) {
                return true;
            }
        }

        return false;
    }
407977
public function hasProperty( $propertyName ) {
			
			if ( self::isProperty( $propertyName ) ) {
			
				return array_key_exists( $propertyName, $this->properties );
			
			} else {
			
				return false;
			
			}
		}
1280760
public static function key_exists($array, $key)
    {
        if (!is_array($array) and !$array instanceof ArrayAccess) {
            throw new InvalidArgumentException('First parameter must be an array or ArrayAccess object.');
        }

        is_object($key) and $key = (string) $key;

        if (!is_string($key)) {
            return false;
        }
        if (array_key_exists($key, $array)) {
            return true;
        }
        foreach (explode('.', $key) as $key_part) {
            if (($array instanceof ArrayAccess and isset($array[$key_part])) === false) {
                if (!is_array($array) or ! array_key_exists($key_part, $array)) {
                    return false;
                }
            }
            $array = $array[$key_part];
        }
        return true;
    }
300739
public static function hasFile($key) {
        if (isset($_FILES[$key]) === false || (isset($_FILES[$key]['error']) && $_FILES[$key]['error'] != 0)) {
            return false;
        }
        return true;
    }
107045
public function hasResource($resource) {

		if(null !== $resource && false === is_string($resource)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($resource)), E_USER_ERROR);
		}

		return true === array_key_exists($resource, $this -> resources);
	}
602663
protected function hasKey($key)
    {
        return ($this->mode == self::MODE_INDEXED && $key == '') || \array_key_exists($key, $this->params);
    }
240089
public static function keysExist(array $arr /*, $key1, $key2, etc...*/){
		
		for($i = 1, $l = \func_num_args() - 1; $i <= $l; ++$i){
			if(!\array_key_exists(\func_get_arg($i), $arr)){
				return false;
			}
		}
		
		return true;
		
	}
922880
public static function fileExistsInPath(string $filename) {
		$paths = explode(';', str_replace(':', ';', get_include_path()));
		foreach($paths as $v) {
			if (file_exists($v . DIRECTORY_SEPARATOR . $filename)) {
				return $v . DIRECTORY_SEPARATOR . $filename;
			}
		}
		return false;
	}
737997
public static function fileExists($fileName)
    {
        $fp = @fopen($fileName, 'r', true);
        if (is_resource($fp)) {
            fclose($fp);
            return true;
        }
        return false;
    }
951922
protected function analyseMercure($file, string $filename, string $appname):int
    {
        $start = 0;
        $end = 0;
        while ($listen = trim(fgets($file, 1024))) {
            if ($listen == "route:" || $listen == "route :") {
                $start++;
            }
            if ($listen == "endroute") {
                $end++;
            }
        }
        if ($start != $end) {
            if ($start < $end) {
                throw new Server500(new \ArrayObject(array("explain" => "Missing tag 'route' in "
                    .$filename. " Routing file : ".$appname , "solution" => "Please check your Mercure file")));
            }
            if ($end < $start) {
                throw new Server500(new \ArrayObject(array("explain" => "Missing tag 'endroute' in "
                    .$filename. " Routing file : ".$appname, "solution" => "Please check your Mercure file")));
            }
            return (0);
        }
        return (1);
    }
877663
private function loadFile(string $filename) : array
    {
        Assertion::file($filename, 'File "' . $filename . '" does not exist.');
        Assertion::readable($filename, 'File "' . $filename . '" is not readable.');

        /** @var string $fileContent */
        $fileContent = file_get_contents($filename);

        Assertion::string($fileContent);

        if (preg_match('/[^ -~\s]/', $fileContent)) {
            throw new \RuntimeException('File "' . $filename . '" contains Non-ASCII-Characters.');
        }

        $jsonParser = new JsonParser();

        try {
            return $jsonParser->parse($fileContent, JsonParser::DETECT_KEY_CONFLICTS | JsonParser::PARSE_TO_ASSOC);
        } catch (ParsingException $e) {
            throw new \RuntimeException(
                'File "' . $filename . '" had invalid JSON.',
                0,
                $e
            );
        }
    }
866003
public function getFile( $fileName )
	{
		if( !$this->numFiles )
			return NULL;
		foreach( $this->files as $key => $information )
			if( $information['name'] == $fileName )
				return $information;
	}