Code Duplication    Length = 12-12 lines in 3 locations

src/Resources/CompanyProperties.php 1 location

@@ 146-157 (lines=12) @@
143
     *
144
     * @return \SevenShores\Hubspot\Http\Response
145
     */
146
    function getAllGroups($includeProperties = false)
147
    {
148
        $endpoint = 'https://api.hubapi.com/companies/v2/groups/';
149
150
        if($includeProperties){
151
            $queryString = build_query_string(['includeProperties' => 'true']);
152
153
            return $this->client->request('get', $endpoint, [], $queryString);
154
        }
155
156
        return $this->client->request('get', $endpoint);
157
    }
158
}
159

src/Resources/DealProperties.php 2 locations

@@ 152-163 (lines=12) @@
149
     *
150
     * @return \Psr\Http\Message\ResponseInterface|\SevenShores\Hubspot\Http\Response
151
     */
152
    public function getGroup($groupName, $includeProperties = false)
153
    {
154
        $endpoint = "https://api.hubapi.com/properties/v1/deals/groups/named/{$groupName}";
155
156
        if($includeProperties){
157
            $queryString = build_query_string(['includeProperties' => 'true']);
158
159
            return $this->client->request('get', $endpoint, [], $queryString);
160
        }
161
162
        return $this->client->request('get', $endpoint);
163
    }
164
165
    /**
166
     * Returns all of the deal property groups for a given portal.
@@ 173-184 (lines=12) @@
170
     *
171
     * @return \SevenShores\Hubspot\Http\Response
172
     */
173
    function getAllGroups($includeProperties = false)
174
    {
175
        $endpoint = 'https://api.hubapi.com/properties/v1/deals/groups';
176
177
        if($includeProperties){
178
            $queryString = build_query_string(['includeProperties' => 'true']);
179
180
            return $this->client->request('get', $endpoint, [], $queryString);
181
        }
182
183
        return $this->client->request('get', $endpoint);
184
    }
185
}
186