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

mborne / remote-git / 14753195534

30 Apr 2025 11:11AM UTC coverage: 80.124% (-1.5%) from 81.624%
14753195534

push

github

web-flow
Merge pull request #33 from mborne/31-visibility

add getVisibility method

6 of 16 new or added lines in 4 files covered. (37.5%)

387 of 483 relevant lines covered (80.12%)

2.63 hits per line

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

0.0
/src/Gogs/GogsProject.php
1
<?php
2

3
namespace MBO\RemoteGit\Gogs;
4

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

8
/**
9
 * Project implementation for github.
10
 *
11
 * @author mborne
12
 */
13
class GogsProject implements ProjectInterface
14
{
15
    /**
16
     * @param array<string,mixed> $rawMetadata
17
     */
18
    public function __construct(private array $rawMetadata)
19
    {
20
    }
×
21

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

27
    public function getName(): string
28
    {
29
        return $this->rawMetadata['full_name'];
×
30
    }
31

32
    public function getDefaultBranch(): ?string
33
    {
34
        return $this->rawMetadata['default_branch'];
×
35
    }
36

37
    public function getHttpUrl(): string
38
    {
39
        return $this->rawMetadata['clone_url'];
×
40
    }
41

42
    public function isArchived(): bool
43
    {
44
        return $this->rawMetadata['archived'];
×
45
    }
46

47
    public function getVisibility(): ?ProjectVisibility
48
    {
NEW
49
        if ($this->rawMetadata['private']) {
×
NEW
50
            return ProjectVisibility::PRIVATE;
×
NEW
51
        } elseif ($this->rawMetadata['internal']) {
×
NEW
52
            return ProjectVisibility::INTERNAL;
×
53
        } else {
NEW
54
            return ProjectVisibility::PUBLIC;
×
55
        }
56
    }
57

58
    public function getRawMetadata(): array
59
    {
60
        return $this->rawMetadata;
×
61
    }
62
}
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