List of content names for the given type

@param string $type Type of content to list

@return string[] Content names
166547
public function listContents($type)
    {
        $names = [];
        $files = $this->listFiles($type);

        foreach ($files as $file) {
            $names[] = static::getName($file);
        }

        return $names;
    }
243876
public static function listLibraries($type)
    {
        $home = Phing::getProperty(Phing::PHING_HOME);
        if ($home == null) {
            return [];
        }
        $currentWorkingDir = getcwd();
        chdir($home);
        exec('composer show --' . $type, $packages, $code);
        chdir($currentWorkingDir);

        return $packages;
    }
774901
protected function parseContentType($contentType) {
        $parts = explode(';', $contentType);

        foreach ($parts as $key => $value) {
            $parts[$key] = trim($value);
        }

        return $parts;
    }
843795
public function ListManagement_Get_Lists($type) {
        $ret = false;

        if (is_string($type) === true) {
            $type = rawurlencode($type);
            $ret = $this->_call_api('get', "{$this->_url}/lists/$type", array());
        }

        return $ret;
    }
700277
public function get_type( $type ) {
		$tokens = [];

		foreach ( $this->text as $index => $token ) {
			if ( $token->type === $type ) {
				$tokens[ $index ] = $token;
			}
		}

		return $tokens;
	}
1242866
public function getStructure(string $type = null): array
    {
        return [
            'email' => $this->makeField(trans('HCCore::users.label.email'))
                ->email()
                ->isRequired()
                ->toArray(),
            'password' => $this->makeField(trans('HCCore::users.label.new_password'))
                ->password()
                ->isRequired()
                ->toArray(),
            'password_confirmation' => $this->makeField(trans('HCCore::users.label.new_password_confirmation'))
                ->password()
                ->isRequired()
                ->toArray(),
            'token' => $this->makeField('')
                ->isHidden()
                ->isRequired()
                ->setValue(request()->input('token'))
                ->toArray(),
        ];
    }
571966
protected static function getRoutesToFolder($type)
    {
        $type = $type . 's';

        $url = isset(self::$unify[$type]) ? self::$unify[$type] : self::$unify;

        return ['url' => $url, 'path' => self::getPathFromUrl($url)];
    }
943085
protected function getAllAncestors($type)
    {
        if (!isset($this->superTypeConfiguration[$type])) {
            return [];
        }
        $ancestors = $this->superTypeConfiguration[$type];

        foreach ($this->superTypeConfiguration[$type] as $currentSuperType) {
            if (isset($this->types[$currentSuperType])) {
                $currentSuperTypeAncestors = $this->getAllAncestors($currentSuperType);
                $ancestors = array_merge($ancestors, $currentSuperTypeAncestors);
            }
        }

        return $ancestors;
    }
638333
public function typeAction($type)
    {
        $contentType = $this->get('opifer.content.content_type_manager')->getRepository()->find($type);

        $content = $this->get('opifer.content.content_manager')->getRepository()->findByType($contentType);

        return $this->render($this->getParameter('opifer_content.content_type_view'), [
            'content_type' => $contentType,
            'content' => $content,
        ]);
    }
23584
protected function getKeywords($type)
    {
        if (!isset($this->keywordsCache[$type])) {
            $getter = 'get' . $type . 'Keywords';
            $keywords = $this->keywords->$getter();

            if ('Step' === $type) {
                $padded = array();
                foreach (explode('|', $keywords) as $keyword) {
                    $padded[] = false !== mb_strpos($keyword, '<', 0, 'utf8')
                        ? preg_quote(mb_substr($keyword, 0, -1, 'utf8'), '/') . '\s*'
                        : preg_quote($keyword, '/') . '\s+';
                }

                $keywords = implode('|', $padded);
            }

            $this->keywordsCache[$type] = $keywords;
        }

        return $this->keywordsCache[$type];
    }
1009040
public function getComponentsByType($type)
    {
        $components = new ArrayList();
        foreach ($this->components as $component) {
            if ($component instanceof $type) {
                $components->push($component);
            }
        }
        return $components;
    }
178006
public function findComponentsByType($type)
    {
        $components = [];
        foreach ($this->components as $component) {
            if ($component->hasType($type)) {
                $components[] = $component;
            }
        }

        return $components;
    }
551267
public function getPart($type)
    {
        $parts = $this->getParts();

        foreach ($parts as $part) {
            if (0 === strpos($part->getHeaders()->get('Content-Type'), $type)) {
                return $part;
            }
        }

        throw new \InvalidArgumentException(sprintf('Unable to find part with Content-Type "%s" in parts. Got: %s', $type, implode("", array_map(function ($part) {
            return "\n- ".$part->getHeaders()->get('Content-Type');
        }, $parts))));
    }
1306494
public function lists($type = null)
    {
        $params = [
            'type' => $type,
        ];

        return $this->parseJSON('get', [self::API_LISTS, $params]);
    }
1210000
public function knownExtensions($type = null)
    {
        $extensions = [
            'images'   => static::$imageExtensions,
            'audios'    => static::$audiosExtensions,
            'archives' => static::$archivesExtensions,
            'videos'   => static::$videosExtensions,
        ];

        if ($type) {
            if (in_array($type, array_keys($extensions))) {
                return $extensions[$type];
            }

            return null;
        }

        return $extensions;
    }
1051047
protected function listFiles($type)
    {
        if (!isset($this->cache['files'][$type])) {
            $path = sprintf('%s/%s', $this->directory, $type);

            if (!$this->files->exists($path)) {
                throw new Exception(sprintf(
                    'No content directory found for type "%s" (in "%s").',
                    $type,
                    $this->directory
                ));
            }

            $finder = new Finder();

            $this->cache['files'][$type] = $finder->files()->in($path);
        }

        return clone $this->cache['files'][$type];
    }
1202323
public static function getTypeName($type = null)
    {
        $result = [
            Item::TYPE_PERMISSION => 'Permission',
            Item::TYPE_ROLE => 'Role',
        ];
        if ($type === null) {
            return $result;
        }

        return $result[$type];
    }