Generate a nested list of deletion model dependencies.

@param array $list
@param array $exclude
@return string
976618
public function loopDependencies($list, &$exclude = array()) {
        if (!$list) {
            return null;
        }

        $output = '';

        foreach ($list as $dependent) {
            if (in_array($dependent['model'], $exclude)) {
                continue;
            }

            $exclude[] = $dependent['model'];

            $output .= sprintf('<li>%s (%s) %s</li>',
                $dependent['model'],
                $dependent['alias'],
                $this->loopDependencies($dependent['dependencies'], $exclude));
        }

        return $this->Html->tag('ul', $output);
    }
958553
public function addToExclusions($path, $exclude)
    {
        collect($exclude)->each(function ($folder) use ($path) {
            $this->exclusions[] = $excluded = make_path([$path, $folder]);

            $this->showProgress("EXCLUDED: {$excluded}");
        });
    }
464721
public function get($name, array $exclude = [])
    {
        $dependency = $this->getProvider($name)->getDependency();
        $value = $dependency->getValue();
        if (!($value instanceof Closure)) {
            return $value;
        }

        $exclude[] = $name;
        $function = new FunctionWrapper($value);
        $this->dependenciesParams[$name] = array_map(function (ReflectionParameter $param) {
            return $param->name;
        }, $function->getParameters());

        $cacheKey = spl_object_hash($value).'_'.$name;

        if (!isset($this->cache[$cacheKey])) {
            $callee = function () use ($cacheKey) {
                return call_user_func_array($this->cache[$cacheKey], func_get_args());
            };
            $arguments = array_map(function ($dependencyName) use ($exclude, $callee) {
                return in_array($dependencyName, $exclude)
                    ? $callee
                    : $this->get($dependencyName, $exclude);
            }, $dependency->getDependencies());

            $this->cache[$cacheKey] = call_user_func_array($value, $arguments);
        }

        return $this->cache[$cacheKey];
    }
460922
public static function getPathSegments(array $exclude = array()): array
    {
        $exclude = array_merge($exclude, array(
            INDEX_FILE,
            CHAR_SPACE,
            ''
        ));
        
        $exclude[] = "";
        
        $requestUri = self::getServerVariable('REQUEST_URI', '');
        $requestUri = substr($requestUri, 0, (strpos($requestUri, "?") !== false) ? strpos($requestUri, "?") : strlen($requestUri));
        $requestUri = preg_replace("#/+#", "/", $requestUri);
        
        $pathInfo = explode(CHAR_SLASH, $requestUri);
        return array_values(array_diff(array_merge($pathInfo, $exclude), $exclude));
    }
1096352
protected function getFilteredFieldNames(array $exclude)
    {
        $fieldNames = $this->getFieldNames(true);
        $result     = [];
        foreach ($fieldNames as $fieldName) {
            if (!in_array($fieldName, $exclude)) {
                $result[] = $fieldName;
            }
        }
        return $result;
    }
419401
public function except(array $list)
    {
        foreach ($list as $field)
        {
            if(property_exists($this->obj,$field))
                unset($this->obj->$field);
        }

        return $this;
    }
955012
public void setExcludeList(List<String> excludeList) {
		log.debug("New Exclude list: " + excludeList);
		defaultFetchFilter.setExcludeRegexes(excludeList);
	}
1369764
public function getList($list)
	{
		$filteredList = [];

		foreach (explode(',', $list) as $item)
		{
			if ($item != '')
			{
				$filteredList[] = $item;
			}
		}

		return $filteredList;
	}
1217285
public function mset(array $list)
    {
        return $this->getFactory()->getRedisClient()->mset(
            $this->getFactory()->createListConverter()->convertToList($list)
        );
    }
1013621
public static function getDbPropertyNames(array $exclude = [])
    {
        $dbPropertyNames = array_keys(static::$dbProperties);

        return $exclude ? array_diff($dbPropertyNames, $exclude) : $dbPropertyNames;
    }
1098349
public static function findAllEntitiesByCriteria(array $criteria = [], array $exclude = []): array
    {
        $class = static::class;

        /** @var EntityRepository $obj_collection */
        $obj_collection = new $class();

        foreach ($criteria as $k => $v) {
            $obj_collection->addSimpleWhereField($k, $v);
        }

        foreach ($exclude as $k => $v) {
            $obj_collection->addWhereFieldIsNot($k, $v);
        }

        return $obj_collection->getAsArrayOfObjects();
    }
407638
protected function normalizeListing(array $listing, $prefix = '', $filter = '.', $exclude = array('.svn', '.git', 'CVS', '.DS_Store', '__MACOSX'))
	{
		$base = $prefix;

		$result  = array();
		$listing = $this->removeDotDirectories($listing);

		while ($item = array_shift($listing))
		{
			if (preg_match('#^.*:$#', $item))
			{
				$base = trim($item, ':');
				continue;
			}

			$file = $this->normalizeObject($item, $base);

			$name = basename($file['path']);

			if (preg_match("/$filter/", $name) && !in_array($name, $exclude))
			{
				$result[] = $file;
			}
		}

		return $this->sortListing($result);
	}
817218
protected function checkDependenciesListModule(array &$list)
    {
        $this->validateDependencies($list);
        $list = $this->graph->build($list);
    }
820035
public function getReport($exclude = [])
    {
        $finder = new Finder();
        $iter = new ClassIterator($finder->in('.'));
        $iter->enableAutoloading();

        $result = $this->getBackendAuditManager()->checkGeneral();
        /** @var ReflectionClass $class */
        foreach ($iter->type('yii\db\ActiveRecord') as $name => $class) {
            if (in_array($name, $exclude)) {
                continue;
            }
            $result[$name] = $this->getBackendAuditManager()->checkModel(new $name);
        }

        return $result;
    }
51093
public static function getList($excluded = ['core_desktop'])
    {
        $result = [];
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        if (empty($excluded)) {
            $rs = $db->executeQuery('select btsID from BlockTypeSets order by btsDisplayOrder asc');
        } else {
            $rs = $db->executeQuery('select btsID from BlockTypeSets where btsHandle not in (?) order by btsDisplayOrder asc',
                [$excluded],
                [Connection::PARAM_STR_ARRAY]
            );
        }
        while (($btsID = $rs->fetchColumn()) !== false) {
            $result[] = static::getByID($btsID);
        }

        return $result;
    }
435827
public static function remove($list, $path = null) {
		if (empty($path)) {
			return $list;
		}
		if (!is_array($path)) {
			$path = explode('.', $path);
		}
		$_list =& $list;

		foreach ($path as $i => $key) {
			if (is_numeric($key) && (integer) $key > 0 || $key === '0') {
				$key = (integer) $key;
			}
			if ($i === count($path) - 1) {
				unset($_list[$key]);
			} else {
				if (!isset($_list[$key])) {
					return $list;
				}
				$_list =& $_list[$key];
			}
		}
		return $list;
	}
483620
public function getOutdatedPackages(array $excluded = [])
    {
        // Get all installed and required packages.
        $installed = $this->composer->getInstalledPackages();
        $required = $this->composer->getRequiredPackages();

        $outdated = [];

        // Get the installed version number of the required packages.
        $packages = array_intersect_key($installed, $required);

        foreach ($packages as $package) {
            $name = $package['name'];
            $version = Version::normalize($package['version']);
            $prettyVersion = $required[$name]['version'];
            $devDependency = $package['devDependency'];

            if (in_array($name, $excluded)) {
                continue;
            }

            $package = new Package($name, $version, $prettyVersion, $devDependency);

            if ($package->isOutdated()) {
                $outdated[] = $package;
            }
        }

        return $outdated;
    }