Code Duplication    Length = 12-12 lines in 3 locations

src/Service.php 1 location

@@ 68-79 (lines=12) @@
65
     * @return string
66
     * @throws WebhookManagerException
67
     */
68
    public function getEvent(): string
69
    {
70
        if (empty($this->headers)) {
71
            $this->getHeaders();
72
        }
73
74
        if (!isset($this->headers['X-Event-Key'])) {
75
            throw new WebhookManagerException("No event specified.");
76
        }
77
78
        return $this->headers['X-Event-Key'];
79
    }
80
81
    /**
82
     * @return mixed

src/Services/BitbucketService.php 1 location

@@ 93-104 (lines=12) @@
90
     * @return string
91
     * @throws WebhookManagerException
92
     */
93
    public function getEvent(): string
94
    {
95
        if (empty($this->headers)) {
96
            $this->getHeaders();
97
        }
98
99
        if (!isset($this->headers['X-Event-Key'])) {
100
            throw new WebhookManagerException("No event specified.");
101
        }
102
103
        return $this->headers['X-Event-Key'];
104
    }
105
106
    /**
107
     * @return mixed

src/Services/GithubService.php 1 location

@@ 118-129 (lines=12) @@
115
     * @return string
116
     * @throws WebhookManagerException
117
     */
118
    public function getEvent(): string
119
    {
120
        if (empty($this->headers)) {
121
            $this->getHeaders();
122
        }
123
124
        if (!isset($this->headers['X-GitHub-Event'])) {
125
            throw new WebhookManagerException("No event specified.");
126
        }
127
128
        return $this->headers['X-GitHub-Event'];
129
    }
130
131
    /**
132
     * @return mixed