Gets all use statements.

@param string $namespaceName The namespace name of the reflected class.

@return array A list with all found use statements.
169671
public function parseUseStatements($namespaceName)
    {
        $statements = [];
        while (($token = $this->next())) {
            if ($token[0] === T_USE) {
                $statements = array_merge($statements, $this->parseUseStatement());
                continue;
            }
            if ($token[0] !== T_NAMESPACE || $this->parseNamespace() != $namespaceName) {
                continue;
            }

            // Get fresh array for new namespace. This is to prevent the parser to collect the use statements
            // for a previous namespace with the same name. This is the case if a namespace is defined twice
            // or if a namespace with the same name is commented out.
            $statements = [];
        }

        return $statements;
    }
240802
protected function getClassNamesInNamespace($namespace)
    {
        $affectedViewHelperClassNames = array();

        $allViewHelperClassNames = $this->reflectionService->getAllSubClassNamesForClass(\TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::class);
        foreach ($allViewHelperClassNames as $viewHelperClassName) {
            if ($this->reflectionService->isClassAbstract($viewHelperClassName)) {
                continue;
            }
            if (strncmp($namespace, $viewHelperClassName, strlen($namespace)) === 0) {
                $affectedViewHelperClassNames[] = $viewHelperClassName;
            }
        }
        sort($affectedViewHelperClassNames);
        return $affectedViewHelperClassNames;
    }
896297
public function AllNamespaces()
	{
		// In PHP 7.0 $this is passed to closure functions automatically but not in earlier versions
		$contexts = &$this->contexts;
		$instance = &$this->instance;

		$result = array_reduce( array_keys( $this->contexts ), function( $carry, $context ) use( &$contexts, &$instance ) {

			// The context may be invalid in which case exclude
			if ( ! isset( $contexts[ $context ]['entity']['segment']['explicitMember'] ) || count( $contexts[ $context ]['entity']['segment']['explicitMember'] ) == 0 )
				return $carry;

			// Each context may have more than one segment.  If the filter matches any one segment the context will be included.
			$context_segments = $instance->getElementsForContext( $context, true );

			foreach ( $context_segments as $key => $segment )
			{
				if ( ! isset( $segment['dimension']['namespace'] ) || isset( $carry[ $segment['dimension']['namespace'] ] ) ) continue;
				$carry[ $segment['dimension']['namespace'] ] = 1;

				if ( ! isset( $segment['member']['namespace'] ) || isset( $carry[ $segment['dimension']['namespace'] ] ) ) continue;
				$carry[ $segment['member']['namespace'] ] = 1;
			}

			return $carry;

		}, array() );

			return array_keys( $result );
	}
474546
public function getNamespace($namespace)
    {
        $classes = [];
        $definitions = $this->classes->extract();

        foreach (array_keys($definitions) as $class) {
            if (strpos($class, $namespace, 0) === 0) {
                $classes[$class] = $this->get($class);
            }
        }

        return $classes;
    }
653744
function getFormattedNamespaces() {
		$ns = $this->getNamespaces();
		foreach ( $ns as $k => $v ) {
			$ns[$k] = strtr( $v, '_', ' ' );
		}
		return $ns;
	}
910686
protected function _getUsedTasks($name) {
		$plugin = $this->getConfig(static::CONFIG_PLUGIN);
		if (substr($name, -4) === 'Task') {
			$className = App::className(($plugin ? $plugin . '.' : '') . $name, 'Shell/Task');
		} else {
			$className = App::className(($plugin ? $plugin . '.' : '') . $name, 'Shell');
		}
		if (!$className) {
			throw new Exception($name);
		}

		$reflection = new ReflectionClass($className);
		if ($reflection->isAbstract()) {
			return [];
		}

		try {
			/** @var \Cake\Console\Shell $object */
			$object = new $className();
			$object->loadTasks();
		} catch (Exception $e) {
			if ($this->getConfig(static::CONFIG_VERBOSE)) {
				$this->_io->warn('   Skipping shell task annotations: ' . $e->getMessage());
			}
			return [];
		} catch (\Throwable $e) {
			if ($this->getConfig(static::CONFIG_VERBOSE)) {
				$this->_io->warn('   Skipping shell task annotations: ' . $e->getMessage());
			}
			return [];
		}

		$map = $this->_invokeProperty($object, '_taskMap');
		if (!$map) {
			return [];
		}
		foreach ($map as $alias => $row) {
			$fullClass = App::className($row['class'], 'Shell/Task', 'Task');
			if (!$fullClass) {
				$this->_io->warn('   Skipping invalid task ' . $alias . ': ' . $row['class']);
				unset($map[$alias]);
				continue;
			}
			$map[$alias]['fullClass'] = $fullClass;
		}

		return $map;
	}
1362072
public function getAll()
    {
        $this->_validate();
        if (array_key_exists($this->_namespaceName, $_SESSION[$this->publicStorage]['store'])) {
            return $_SESSION[$this->publicStorage]['store'][$this->_namespaceName];
        }
        return false;
    }
552545
public function takeAll($namespace = 'default')
    {
        if ($this->state !== static::STATE_ACTIVE && $this->state !== static::STATE_EXPIRED) {
            if ($this->debug) {
                throw new \RuntimeException('Session is not active.');
            }

            return false;
        }

        $bag = $this->getBag($namespace);
        $all = $bag->all();

        $this->clean($namespace);

        return $all;
    }
434836
public function getNamespaces()
    {
        $result = [];
        foreach ($this->registry[NamespaceExtension::class] as $extension) {
            foreach ($extension->getNamespaces() as $prefix => $namespace) {
                $result[$prefix] = $namespace;
            }
        }

        return $result;
    }
1145641
public static function getNamespace($tokens)
    {
        $count = count($tokens);
        $i = 0;
        $namespace = '';
        $namespace_ok = false;
        while ($i < $count) {
            $token = $tokens[$i];
            if (is_array($token) && $token[0] === T_NAMESPACE) {
                // Found namespace declaration
                while (++$i < $count) {
                    if ($tokens[$i] === ';') {
                        $namespace_ok = true;
                        $namespace = trim($namespace);
                        break;
                    }
                    $namespace .= is_array($tokens[$i]) ? $tokens[$i][1] : $tokens[$i];
                }
                break;
            }
            $i++;
        }
        if (!$namespace_ok) {
            return null;
        } else {
            return $namespace;
        }
    }
613820
public function resolveMethod(string $namespace, string $method) : array
    {
        $class = $this->reflection->setClass($namespace)->getReflectionClass();

        if (!method_exists($namespace, $method)) {
            throw new \RuntimeException("Method $method doesn't exists in $namespace class");
        }
        $arguments = $class->getMethod($method)->getParameters();
        $methodArgs = $this->createMethodArgument($arguments);

        return array_filter($methodArgs);
    }
312700
public function getNamespaceAliases()
    {
        if (!isset($this->fileNamespaceAliases)) {
            $this->fileNamespaceAliases = $this->findNamespaceAliases();
        }

        return $this->fileNamespaceAliases;
    }
151927
public function getNamespacesInScope( $scope = XmlNamespaceScope::All )
	{
		$namespaces = $this->namespaces;

		if ( $scope == XmlNamespaceScope::ExcludeXml )
		{
			// Make sure http://www.w3.org/XML/1998/namespace is not included
			if ( ( $prefix = $this->lookupPrefix( "http://www.w3.org/XML/1998/namespace" ) ) )
			{
				unset( $namespaces[ $prefix ] );
			}
		}
		return $namespaces;
	}
1218499
public function getAll($namespace = 'default')
    {
        if ($this->state !== static::STATE_ACTIVE && $this->state !== static::STATE_EXPIRED) {
            if ($this->debug) {
                throw new \RuntimeException('Session is not active.');
            }

            return [];
        }

        return $this->getBag($namespace)->all();
    }
1019017
protected static function _namespaceIsset($namespace, $name = null)
    {
        if (self::$_readable === false) {
            /**
             * @see Zend_Session_Exception
             */
            require_once 'Zend/Session/Exception.php';
            throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
        }

        if ($name === null) {
            return ( isset($_SESSION[$namespace]) || isset(self::$_expiringData[$namespace]) );
        } else {
            return ( isset($_SESSION[$namespace][$name]) || isset(self::$_expiringData[$namespace][$name]) );
        }
    }
110691
protected function retrieveNamespaces() {
		if ( is_array( $this->namespaces ) ) {
			return;
		}
		$params = [ 'meta' => 'siteinfo', 'siprop' => 'namespaces' ];
		$namespaces = $this->api->getRequest( new SimpleRequest( 'query', $params ) );
		if ( isset( $namespaces['query']['namespaces'] ) ) {
			$this->namespaces = $namespaces['query']['namespaces'];
		}
	}
229386
protected function findExtensions($namespace)
    {
        $this->initializeNamespaces();
        $files = [];
        $old = [];
        $namespaces = [$namespace, 'Staq\Core\Ground'];
        while (array_diff($namespaces, $old)) {
            $extensions = $this->formatExtensionsFromNamespaces($namespaces);
            foreach ($extensions as $extension) {
                $files[] = $extension . '/setting/Application.ini';
            }
            $ini = (new \Pixel418\Iniliq\IniParser)->parse(array_reverse($files));
            $old = $namespaces;
            $namespaces = array_reverse($ini->getAsArray('extension.list'));
            $namespaces = \UArray::reverseMergeUnique($old, $namespaces);
        }
        return $this->formatExtensionsFromNamespaces($namespaces);
    }