ShopEndpoint   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A findOne() 0 4 1
1
<?php
2
namespace CodeCloud\Bundle\ShopifyBundle\Api\Endpoint;
3
4
use CodeCloud\Bundle\ShopifyBundle\Api\Request\GetJson;
5
use CodeCloud\Bundle\ShopifyBundle\Api\GenericResource;
6
7
class ShopEndpoint extends AbstractEndpoint
8
{
9
    /**
10
     * @return GenericResource
11
     */
12
    public function findOne()
13
    {
14
        $response = $this->send(new GetJson('/admin/shop.json'));
15
        return $this->createEntity($response->get('shop'));
0 ignored issues
show
Bug introduced by
It seems like $response->get('shop') can also be of type string; however, parameter $data of CodeCloud\Bundle\Shopify...ndpoint::createEntity() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

15
        return $this->createEntity(/** @scrutinizer ignore-type */ $response->get('shop'));
Loading history...
16
    }
17
}
18