相关搜索词.

`推荐：`

@param string $project

@return string

@farwish
763987
protected function related($project = '')
    {
        if (! $project) return;

        $related = [];
        if ( $q = parent::makeup() ) {
            $related = parent::fuzzy($q)[$project]->getRelatedQuery($q, static::$limit);
        }
        return $related;
    }
553301
public function show(string $project, array $params = [])
    {
        $path = $this->buildProjectsPath($project);

        return $this->get($path, $params);
    }
238873
public function update(string $project, array $params = [])
    {
        $path = $this->buildProjectsPath($project);

        return $this->put($path, $params);
    }
312318
public static function appProfileName($project, $instance, $appProfile)
    {
        return self::getAppProfileNameTemplate()->render([
            'project' => $project,
            'instance' => $instance,
            'app_profile' => $appProfile,
        ]);
    }
120078
public function getProject()
    {
        $key = $this->getProjectId();

        if (empty($key)) {
            return null;
        }

        $cacheKey   = 'Cache.Project.' . $key;
        $rtn        = $this->cache->get($cacheKey, null);

        if (empty($rtn)) {
            $rtn    = Factory::getStore('Project', 'PHPCI')->getById($key);
            $this->cache->set($cacheKey, $rtn);
        }

        return $rtn;
    }
134497
public static function getProjectType()
    {
        $container = self::getContainer();
        $builder = CollectionBuilder::create($container, new ProjectTasks());

        return $container->get('projectXProject')
            ->setBuilder($builder);
    }
844813
public function getProjectLabel(Project $project, $tag = 'info')
    {
        $title = $project->title;
        $pattern = strlen($title) > 0 ? '%2$s (%3$s)' : '%3$s';
        if ($tag !== false) {
            $pattern = strlen($title) > 0 ? '<%1$s>%2$s</%1$s> (%3$s)' : '<%1$s>%3$s</%1$s>';
        }

        return sprintf($pattern, $tag, $title, $project->id);
    }
668427
protected function githubCommitRequest(Project $project, array $payload)
    {
        // Github sends a payload when you close a pull request with a
        // non-existent commit. We don't want this.
        if (array_key_exists('after', $payload) && $payload['after'] === '0000000000000000000000000000000000000000') {
            return array('status' => 'ignored');
        }

        if (isset($payload['commits']) && is_array($payload['commits'])) {
            // If we have a list of commits, then add them all as builds to be tested:

            $results = array();
            $status = 'failed';
            foreach ($payload['commits'] as $commit) {
                if (!$commit['distinct']) {
                    $results[$commit['id']] = array('status' => 'ignored');
                    continue;
                }

                try {
                    $branch = str_replace('refs/heads/', '', $payload['ref']);
                    $committer = $commit['committer']['email'];
                    $results[$commit['id']] = $this->createBuild(
                        $project,
                        $commit['id'],
                        $branch,
                        $committer,
                        $commit['message']
                    );
                    $status = 'ok';
                } catch (Exception $ex) {
                    $results[$commit['id']] = array('status' => 'failed', 'error' => $ex->getMessage());
                }
            }
            return array('status' => $status, 'commits' => $results);
        }

        if (substr($payload['ref'], 0, 10) == 'refs/tags/') {
            // If we don't, but we're dealing with a tag, add that instead:
            $branch = str_replace('refs/tags/', 'Tag: ', $payload['ref']);
            $committer = $payload['pusher']['email'];
            $message = $payload['head_commit']['message'];
            return $this->createBuild($project, $payload['after'], $branch, $committer, $message);
        }

        return array('status' => 'ignored', 'message' => 'Unusable payload.');
    }
725734
public function getInjectProperty(string $property)
    {
        // '${beanName}'格式解析
        $propertyKeys = explode(".", $property);
        if (count($propertyKeys) == 1) {
            return $property;
        }

        if ($propertyKeys[0] != 'config') {
            throw new \InvalidArgumentException("properties配置引用格式不正确，key=" . $propertyKeys[0]);
        }

        // '${config.xx.yy}' 格式解析,直接key
        $propertyKey = str_replace("config.", "", $property);
        if (isset($this->properties[$propertyKey])) {
            return $this->properties[$propertyKey];
        }

        // '${config.xx.yy}' 格式解析, 层级解析
        unset($propertyKeys[0]);
        $layerProperty = empty($propertyKeys)? null: $this->properties;
        foreach ($propertyKeys as $subPropertyKey) {
            if (isset($layerProperty[$subPropertyKey])) {
                $layerProperty = $layerProperty[$subPropertyKey];
                continue;
            }

            $layerProperty  = null;
            break;
        }

        return $layerProperty;
    }
468207
public function getProjectId()
    {
        if (!isset($this->projectId)) {
            $this->projectId = $this->get('project/project-id');
        }

        return $this->projectId;
    }
1361651
public static function getProjectRootDirectory(): string
    {
        if (null === self::$projectRootDirectory) {
            $reflection                 = new \ReflectionClass(ClassLoader::class);
            self::$projectRootDirectory = \dirname((string)$reflection->getFileName(), 3);
        }

        return self::$projectRootDirectory;
    }
1322253
public function deleteLanguage(string $project, string $langCode): ResponseInterface
    {
        return $this->client->sendRequest($this->createRequest('DELETE', $this->createUri("/api/2/project/$project/language/$langCode/")));
    }
1281704
public static function documentPathName($project, $database, $documentPath)
    {
        return self::getDocumentPathNameTemplate()->render([
            'project' => $project,
            'database' => $database,
            'document_path' => $documentPath,
        ]);
    }
97266
public static function applicationName($project, $tenant, $profile, $application)
    {
        return self::getApplicationNameTemplate()->render([
            'project' => $project,
            'tenant' => $tenant,
            'profile' => $profile,
            'application' => $application,
        ]);
    }
1045221
public function getProject(int $projectId)
    {
        if ( ! $this->validateId($projectId)) {
            return false;
        }

        $result = $this->get('projects/' . $projectId);

        if (200 === $result->getStatusCode()) {
            return json_decode($result->getBody()->getContents());
        }

        return false;
    }
1259473
public function getCommit(Project $project, $sha)
    {
        $stmt = $this->db->prepare('SELECT slug, sha, author, date, build_date, message, status, output FROM `commit` WHERE slug = :slug AND sha = :sha');
        $stmt->bindValue(':slug', $project->getSlug(), \PDO::PARAM_STR);
        $stmt->bindValue(':sha', $sha, \PDO::PARAM_STR);

        if ($stmt->execute()) {
            if (false !== $result = $stmt->fetch(\PDO::FETCH_ASSOC)) {
                return $this->createCommit($project, $result);
            }
        } else {
            // @codeCoverageIgnoreStart
            throw new \RuntimeException(sprintf('Unable to retrieve commit "%s" from project "%s".', $sha, $project), 1);
            // @codeCoverageIgnoreEnd
        }

        return false;
    }
204228
public function remove(string $project, array $params = [])
    {
        $path = $this->buildProjectsPath($project);

        return $this->delete($path, $params);
    }