protected function fetchProject($projectId, $expectedType)
    {
        $project = $this->projectStore->getById($projectId);

        if (empty($project)) {
            throw new Exception('Project does not exist: ' . $projectId);
        }

        if (is_array($expectedType)
            ? !in_array($project->getType(), $expectedType)
            : $project->getType() !== $expectedType
        ) {
            throw new Exception('Wrong project type: ' . $project->getType());
        }

        return $project;
    }
protected function fetchProject($projectId, $expectedType)
    {
        $project = $this->projectStore->getById($projectId);

        if (empty($project)) {
            throw new Exception('Project does not exist: ' . $projectId);
        }

        if (is_array($expectedType)
            ? !in_array($project->getType(), $expectedType)
            : $project->getType() !== $expectedType
        ) {
            throw new Exception('Wrong project type: ' . $project->getType());
        }

        return $project;
    }
protected function fetchProject ( $ projectId , $ expectedType ) { $ project = $ this -> projectStore -> getById ( $ projectId ) ; if ( empty ( $ project ) ) { throw new Exception ( 'Project does not exist: ' . $ projectId ) ; } if ( is_array ( $ expectedType ) ? ! in_array ( $ project -> getType ( ) , $ expectedType ) : $ project -> getType ( ) !== $ expectedType ) { throw new Exception ( 'Wrong project type: ' . $ project -> getType ( ) ) ; } return $ project ; }
Fetch a project and check its type.

@param int $projectId
@param array|string $expectedType

@return Project

@throws Exception If the project does not exist or is not of the expected type.
Fetch a project and check its type .