Filter out IdP which are not in SAML2 Scoping attribute list (SAML2 feature)
@param $list
@return array of idps
353219
protected function scoping($list)
    {
        if (!empty($this->scopedIDPList)) {
            foreach ($list as $entityId => $idp) {
                if (!in_array($entityId, $this->scopedIDPList)) {
                    unset($list[$entityId]);
                }
            }
        }
        //SimpleSAML\Logger::debug(
        //'perun.Disco.filterList: Idps after SAML2 Scoping: ' . var_export(array_keys($list), true)
        //);
        return $list;
    }
15804
private function getOptions(array $list)
    {
        // To be returned
        $elements = array();

        foreach ($list as $value => $text) {
            array_push($elements, $this->createOptionNode($value, $text));
        }

        return $elements;
    }
1016795
public function getProps($list = null)
    {
        if ($list && is_array($list)) {
            $result = array();
            foreach ($list as $key) {
                $result[$key] = $this->get($key);
            }

            return $result;
        }

        return $this->props;
    }
1157856
protected function parseAccessControlList($list)
    {
        $permissions = [];

        // Matches between two parenthesis.
        preg_match_all('/\((.*?)\)/', $list, $matches);

        // Make sure we have resulting matches.
        if (is_array($matches) && count($matches) > 0) {
            // Matches inside the first key will have parenthesis
            // already removed, so we need to verify it exists.
            if (array_key_exists(1, $matches) && is_array($matches[1])) {
                // We'll go through each match and see if the ACE
                // exists inside the permissions definition list.
                foreach ($matches[1] as $definition) {
                    // We'll merge the permissions list so we have a flat array
                    // of all of the rights for the current account.
                    $permissions = array_merge($permissions, $this->parseDefinitionRights($definition));
                }
            }
        }

        return $permissions;
    }
701499
public static function detectDebugMode($list = NULL): bool
    {
        $addr = isset($_SERVER['REMOTE_ADDR'])
            ? $_SERVER['REMOTE_ADDR']
            : php_uname('n');
        $secret = isset($_COOKIE[self::COOKIE_SECRET]) && is_string($_COOKIE[self::COOKIE_SECRET])
            ? $_COOKIE[self::COOKIE_SECRET]
            : NULL;
        $list = is_string($list)
            ? preg_split('#[,\s]+#', $list)
            : (array) $list;
        if (!isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $list[] = '127.0.0.1';
            $list[] = '::1';
        }
        return in_array($addr, $list, TRUE) || in_array("$secret@$addr", $list, TRUE);
    }
785066
public static function filterRolesIdentities(array $sids)
    {
        $roles = [];

        foreach ($sids as $sid) {
            if ($sid instanceof RoleSecurityIdentity && false === strpos($sid->getIdentifier(), 'IS_')) {
                $roles[] = OrganizationalUtil::format($sid->getIdentifier());
            }
        }

        return array_values(array_unique($roles));
    }
615028
public function getNoCache($sFilterValue) : array
    {
        if (empty($sFilterValue)) {
            return [];
        }

        $this->sValue = $sFilterValue;
        $arElementIDList = $this->getIDListFromDB();

        return $arElementIDList;
    }
530398
public function contains(array $list)
    {
        phpCAS::traceBegin();
        $count = 0;
        foreach ($this->_chains as $chain) {
            phpCAS::trace("Checking chain ". $count++);
            if ($chain->matches($list)) {
                phpCAS::traceEnd(true);
                return true;
            }
        }
        phpCAS::trace("No proxy chain matches.");
        phpCAS::traceEnd(false);
        return false;
    }
794099
private function parseList($list)
    {
        if(null === $this->fields)
        {
            return $list;
        }
        $result = [];
        foreach($list as $item)
        {
            if(is_object($item))
            {
                $item = clone $item;
            }
            ObjectArrayHelper::filter($item, $this->fields, $this->mode);
            $result[] = $item;
        }
        return $result;
    }
230073
protected function getEnabledItems(array $list): array
	{
		$items = [];

		foreach ($list as $item => $enabled) {
			if ($enabled === true) {
				$items[] = $item;
			}
		}

		return $items;
	}
699711
protected static function expandClosures( $list ) {
		return array_map( function ( $value ) {
			if ( is_object( $value ) && $value instanceof Closure ) {
				// If $value is a Closure, call it.
				return $value();
			} else {
				return $value;
			}
		}, $list );
	}
675029
static function clearByID( $idList, $cacheList = false )
    {
        if ( !$cacheList )
            $cacheList = eZCache::fetchList();

        $cacheItems = array();
        if ( !is_array( $idList ) )
            $idList = array( $idList );
        foreach ( $cacheList as $cacheItem )
        {
            if ( in_array( $cacheItem['id'], $idList ) )
                $cacheItems[] = $cacheItem;
        }
        foreach ( $cacheItems as $cacheItem )
        {
            eZCache::clearItem( $cacheItem );
        }
        return true;
    }
37009
public function fromArray( array $list )
	{
		$unknown = array();
		$list = parent::fromArray( $list );

		foreach( $list as $key => $value )
		{
			switch( $key )
			{
				case $this->_prefix . 'salutation': $this->setSalutation( $value ); break;
				case $this->_prefix . 'company': $this->setCompany( $value ); break;
				case $this->_prefix . 'vatid': $this->setVatID( $value ); break;
				case $this->_prefix . 'title': $this->setTitle( $value ); break;
				case $this->_prefix . 'firstname': $this->setFirstname( $value ); break;
				case $this->_prefix . 'lastname': $this->setLastname( $value ); break;
				case $this->_prefix . 'address1': $this->setAddress1( $value ); break;
				case $this->_prefix . 'address2': $this->setAddress2( $value ); break;
				case $this->_prefix . 'address3': $this->setAddress3( $value ); break;
				case $this->_prefix . 'postal': $this->setPostal( $value ); break;
				case $this->_prefix . 'city': $this->setCity( $value ); break;
				case $this->_prefix . 'state': $this->setState( $value ); break;
				case $this->_prefix . 'countryid': $this->setCountryId( $value ); break;
				case $this->_prefix . 'languageid': $this->setLanguageId( $value ); break;
				case $this->_prefix . 'telephone': $this->setTelephone( $value ); break;
				case $this->_prefix . 'telefax': $this->setTelefax( $value ); break;
				case $this->_prefix . 'email': $this->setEmail( $value ); break;
				case $this->_prefix . 'website': $this->setWebsite( $value ); break;
				case $this->_prefix . 'flag': $this->setFlag( $value ); break;
				default: $unknown[$key] = $value;
			}
		}

		return $unknown;
	}
1094781
public function fromArray( array $list )
	{
		if( array_key_exists( $this->_prefix . 'id', $list ) )
		{
			$this->setId( $list[$this->_prefix . 'id'] );
			unset( $list[$this->_prefix . 'id'] );
		}

		unset( $list[$this->_prefix . 'siteid'] );
		unset( $list[$this->_prefix . 'ctime'] );
		unset( $list[$this->_prefix . 'mtime'] );
		unset( $list[$this->_prefix . 'editor'] );

		return $list;
	}
734502
private function sortableResetArray($list)
    {
        $removedKeys = array_keys($this->baseConcreteData);
        foreach ($list as $index => $value) {
            $this[$index] = $value;
            if (($key = array_search($index, $removedKeys)) !== false) {
                unset($removedKeys[$key]);
            }
        }
        unset($list);
        foreach ($removedKeys as $index) {
            unset($this[$index]);
        }
        if (method_exists($this, 'rewind')) {
            $this->rewind();
        }
    }
720949
protected function cleanSrcList($list)
    {
        $dirs = array_get($list, 'directories');
        $files = array_get($list, 'files');
        $path = array_get($list, 'path');
        $node = array_get($list, 'node');

        foreach ($dirs as $key => $dir) {
            $dirs[$key] = [
                'name' => $dir,
                'path' => $path,
                'type' => 'dir',
                'node' => $node
            ];
        }

        foreach ($files as $key => $file) {
            $name = array_get($file, 'path');
            $files[$key]['name'] = $name;
            $files[$key]['type'] = 'file';
            $files[$key]['node'] = $node;
        }

        return array_merge($dirs, $files);
    }
80764
protected function parse(array $list)
    {
        $parsed = array();

        foreach ($list as $item) {
            $item = explode(';', trim($item));

            $entry = array(
                'encoding' => array_shift($item),
                'q' => 1
            );

            foreach ($item as $param) {
                $param = explode('=', $param);

                // ignore malformed params
                if (count($param) != 2) {
                    continue;
                }

                $entry[$param[0]] = $param[1];
            }

            $parsed[] = $entry;
        }

        return $parsed;
    }