GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: /var/www/admin.fixgini.com/vendor/pestphp/pest/src/Configuration/Project.php
<?php

declare(strict_types=1);

namespace Pest\Configuration;

/**
 * @internal
 */
final class Project
{
    /**
     * The assignees link.
     *
     * @internal
     */
    public string $assignees = '';

    /**
     * The issues link.
     *
     * @internal
     */
    public string $issues = '';

    /**
     * The PRs link.
     *
     * @internal
     */
    public string $prs = '';

    /**
     * The singleton instance.
     */
    private static ?self $instance = null;

    /**
     * Creates a new instance of the project.
     */
    public static function getInstance(): self
    {
        return self::$instance ??= new self;
    }

    /**
     * Sets the test project to GitHub.
     */
    public function github(string $project): self
    {
        $this->issues = "https://github.com/{$project}/issues/%s";
        $this->prs = "https://github.com/{$project}/pull/%s";

        $this->assignees = 'https://github.com/%s';

        return $this;
    }

    /**
     * Sets the test project to GitLab.
     */
    public function gitlab(string $project): self
    {
        $this->issues = "https://gitlab.com/{$project}/issues/%s";
        $this->prs = "https://gitlab.com/{$project}/merge_requests/%s";

        $this->assignees = 'https://gitlab.com/%s';

        return $this;
    }

    /**
     * Sets the test project to Bitbucket.
     */
    public function bitbucket(string $project): self
    {
        $this->issues = "https://bitbucket.org/{$project}/issues/%s";
        $this->prs = "https://bitbucket.org/{$project}/pull-requests/%s";

        $this->assignees = 'https://bitbucket.org/%s';

        return $this;
    }

    /**
     * Sets the test project to Jira.
     */
    public function jira(string $namespace, string $project): self
    {
        $this->issues = "https://{$namespace}.atlassian.net/browse/{$project}-%s";

        $this->assignees = "https://{$namespace}.atlassian.net/secure/ViewProfile.jspa?name=%s";

        return $this;
    }

    /**
     * Sets the test project to custom.
     */
    public function custom(string $issues, string $prs, string $assignees): self
    {
        $this->issues = $issues;
        $this->prs = $prs;

        $this->assignees = $assignees;

        return $this;
    }
}