@param array<PhpNameOccurance>

@return array<PhpNameOccurance>
320639
public function filter(array $phpNames)
    {
        $fileUseOccurances = array_flip(
            array_map(
                function ($useOccurance) {
                    return $useOccurance->name()->fullyQualifiedName();
                },
                array_filter(
                    $phpNames,
                    function ($occurance) {
                        return $occurance->name()->type() === PhpName::TYPE_USE;
                    }
                )
            )
        );

        return array_filter(
            $phpNames,
            function ($occurance) use ($fileUseOccurances) {
                return (
                    $occurance->name()->type() !== PhpName::TYPE_USAGE ||
                    !isset($fileUseOccurances[$occurance->name()->fullyQualifiedName()])
                );
            }
        );
    }
950484
public function getNames()
    {
        $enums = [];

        foreach (static::toArray() as $name => $value) {
            if ($this->has($value)) {
                $enums[] = $name;
            }
        }

        return $enums;
    }
397530
public function getNames(): array
    {
        $enumeration = $this->enumeration;
        $names       = [];
        foreach ($this->getOrdinals() as $ord) {
            $names[] = $enumeration::byOrdinal($ord)->getName();
        }
        return $names;
    }
84647
public static function expandDotNotationKeys(Array $array)
    {
        $result = [];

        foreach ($array as $key => $value) {
          array_set($result, $key, $value);
        }

        return $result;
    }
600641
public function getArrayKeys()
    {
        $returnValue = [];

        foreach (array_keys($this->getArrayCopy()) as $key) {
            if ($key != '_type') {
                $returnValue[] = $key;
            }
        }

        return $returnValue;
    }
338685
public static function generateIndexName(array $key)
    {
        $nameParts = [];
        foreach ($key as $fieldName => $direction) {
            $nameParts[] = $fieldName;
            $nameParts[] = (string) $direction;
        }

        return implode('_', $nameParts);
    }
1035574
public static function typeCast(array $array)
    {
        $return = [];
        
        foreach ($array as $k => $v) {
            if (is_numeric($v)) {
                $return[$k] = StringHelper::typeCastNumeric($v);
            } elseif (is_array($v)) {
                $return[$k] = self::typeCast($v);
            } else {
                $return[$k] = $v;
            }
        }
        
        return $return;
    }
527191
public static function array_filter_keys($array, $params = null)
    {

        $array = self::toArray($array);

        $isMultidimensionnal = self::is_multi($array);

        if (is_string($params)) {
            $params = array('with' => $params);
        }

        if (isset($params['with'])) {
            $data = array();

            if (!$isMultidimensionnal) {
                foreach ($array as $key => $value) {
                    if (preg_match('/' . $params['with'] . '/i', $key)) {
                        $data[] = $value;
                    }
                }
            } else {
                foreach ($array as $v1) {
                    foreach ($v1 as $key => $value) {
                        if (preg_match('/' . $params['with'] . '/i', $key)) {
                            $data[] = $value;
                        }
                    }
                }
            }

            return $data;
        }

        return array_filter($array);

    }
22733
public function getFieldDatabaseNameArray()
    {
        $fields = [];
        foreach ($this->fields as $field) {
            $fields[] = $field->toSelectString();
        }
        return $fields;
    }
989254
public function toArray()
	{
		$result = array( 'localname' => $this->localName );
		if ( isset( $this->prefix ) ) array( 'prefix' => $this->prefix );
		if ( isset( $this->namespaceURI ) ) array( 'namespace' => $this->namespaceURI );
		return $result;
	}
641410
private function getScanNamespaceFromProperties(string $name)
    {
        $properties = $this->properties;

        if (!isset($properties[$name]) || !\is_array($properties[$name])) {
            return [];
        }

        return $properties[$name];
    }
342022
public static function filter_suffixed($array, $suffix, $remove_suffix = true)
    {
        $return = [];
        foreach ($array as $key => $val) {
            if (preg_match('/'.$suffix.'$/', $key)) {
                if ($remove_suffix === true) {
                    $key = preg_replace('/'.$suffix.'$/', '', $key);
                }
                $return[$key] = $val;
            }
        }
        return $return;
    }
1056887
static private function &sessionArray()
    {
        if ( self::$namespace !== null )
        {
            if ( !isset( $_SESSION[self::$namespace] ) )
                $_SESSION[self::$namespace] = array();
            return $_SESSION[self::$namespace];
        }
        return $_SESSION;
    }
745502
public function getPropertyNames() {
    return array_map(function (ClassMemberNode $property) {
      return ltrim($property->getName(), '$');
    }, $this->getProperties()->toArray());
  }
1240880
public function getMultipleByName(array $permissions): array
    {
        if ($this->permissions === null) {
            $this->getAll();
        }

        $results = [];

        foreach ($permissions as $permission) {
            if (isset($this->names[$permission])) {
                $results[] = $this->permissions[$this->names[$permission]];
            }
        }

        return $results;
    }
1114422
public function toArray(): array
    {
        $data = ReflectionUtil::objToSnakeArray($this, static::blacklist());
        foreach ($this->renamed as $name => $newName) {
            if (!array_key_exists($name, $data)) {
                continue;
            }
            $data[$newName] = $data[$name];
            unset($data[$name]);
        }

        return $data;
    }
157441
public static function expand($array)
    {
        $multiArray = [];

        foreach ($array as $key=>&$value)
        {
            $keys = explode('.', $key);
            $lastKey = array_pop($keys);
            $currentPointer = &$multiArray;

            foreach ($keys as $currentKey)
            {
                if (!isset($currentPointer[$currentKey]))
                {
                    $currentPointer[$currentKey] = [];
                }

                $currentPointer = &$currentPointer[$currentKey];
            }

            $currentPointer[$lastKey] = $value;
        }

        return $multiArray;
    }