Platformsh\Cli\Command\CompletionCommand::getProject PHP Method

getProject() protected method

The project is either defined by an ID that the user has specified in the command (via the 'id' argument of 'get', or the '--project' option), or it is determined from the current path.
protected getProject ( ) : Platformsh\Client\Model\Project | false
return Platformsh\Client\Model\Project | false
    protected function getProject()
    {
        if (!$this->projects) {
            return false;
        }
        $commandLine = $this->handler->getContext()->getCommandLine();
        $currentProjectId = $this->getProjectIdFromCommandLine($commandLine);
        if (!$currentProjectId && ($currentProject = $this->welcomeCommand->getCurrentProject())) {
            return $currentProject;
        } elseif (isset($this->projects[$currentProjectId])) {
            return $this->projects[$currentProjectId];
        }
        return false;
    }