Code Duplication    Length = 7-8 lines in 2 locations

src/TwitterAds/Resource.php 2 locations

@@ 87-94 (lines=8) @@
84
     *
85
     * @return Resource
86
     */
87
    public function load($id, $params = [])
88
    {
89
        $resource = str_replace(static::RESOURCE_REPLACE, $this->getTwitterAds()->getAccountId(), static::RESOURCE);
90
        $resource = str_replace(static::RESOURCE_ID_REPLACE, $id, $resource);
91
        $response = $this->getTwitterAds()->get($resource, $params);
92
93
        return $this->fromResponse($response->getBody()->data);
94
    }
95
96
    /**
97
     * Reloads all attributes for the current object instance from the API.
@@ 215-221 (lines=7) @@
212
     * Deletes the current object instance depending on the
213
     * presence of `object->getId()`.
214
     */
215
    public function delete()
216
    {
217
        $resource = str_replace(static::RESOURCE_REPLACE, $this->getTwitterAds()->getAccountId(), static::RESOURCE);
218
        $resource = str_replace(static::RESOURCE_ID_REPLACE, $this->getId(), $resource);
219
        $response = $this->getTwitterAds()->delete($resource);
220
        $this->fromResponse($response->getBody()->data);
221
    }
222
223
    /**
224
     * @return array