• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mborne / remote-git / 23622402787

26 Mar 2026 11:05PM UTC coverage: 91.473% (-1.4%) from 92.857%
23622402787

push

github

web-flow
Merge pull request #46 from mborne/upgrade_test

Improve tests

1 of 1 new or added line in 1 file covered. (100.0%)

10 existing lines in 3 files now uncovered.

354 of 387 relevant lines covered (91.47%)

2.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.22
/src/Gitlab/GitlabProject.php
1
<?php
2

3
namespace MBO\RemoteGit\Gitlab;
4

5
use MBO\RemoteGit\ProjectInterface;
6
use MBO\RemoteGit\ProjectVisibility;
7
use RuntimeException;
8

9
/**
10
 * Common project properties between different git project host (gitlab, github, etc.).
11
 *
12
 * @author mborne
13
 */
14
class GitlabProject implements ProjectInterface
15
{
16
    /**
17
     * @param array<string,mixed> $rawMetadata
18
     */
19
    public function __construct(private array $rawMetadata)
20
    {
21
    }
11✔
22

23
    public function getId(): string
24
    {
25
        return $this->rawMetadata['id'];
4✔
26
    }
27

28
    public function getName(): string
29
    {
30
        return $this->rawMetadata['path_with_namespace'];
4✔
31
    }
32

33
    public function getDescription(): string
34
    {
35
        return $this->rawMetadata['description'];
2✔
36
    }
37

38
    public function getDefaultBranch(): ?string
39
    {
40
        if (!isset($this->rawMetadata['default_branch'])) {
4✔
41
            return null;
1✔
42
        }
43

44
        return $this->rawMetadata['default_branch'];
4✔
45
    }
46

47
    public function getHttpUrl(): string
48
    {
49
        return $this->rawMetadata['http_url_to_repo'];
3✔
50
    }
51

52
    public function isArchived(): bool
53
    {
54
        return $this->rawMetadata['archived'] ?? false;
3✔
55
    }
56

57
    public function getVisibility(): ?ProjectVisibility
58
    {
59
        $visibility = $this->rawMetadata['visibility'] ?? 'public';
3✔
60
        switch ($visibility) {
61
            case 'public':
3✔
62
                return ProjectVisibility::PUBLIC;
3✔
63
            case 'private':
×
64
                return ProjectVisibility::PRIVATE;
×
65
            case 'internal':
×
UNCOV
66
                return ProjectVisibility::INTERNAL;
×
67
            default:
UNCOV
68
                throw new RuntimeException("Unknown visibility: {$this->rawMetadata['visibility']}");
×
69
        }
70
    }
71

72
    public function getRawMetadata(): array
73
    {
74
        return $this->rawMetadata;
3✔
75
    }
76
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc