PolicyEndpoint   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A findAll() 0 5 1
1
<?php
2
namespace CodeCloud\Bundle\ShopifyBundle\Api\Endpoint;
3
4
use CodeCloud\Bundle\ShopifyBundle\Api\Request\GetJson;
5
6
class PolicyEndpoint extends AbstractEndpoint
7
{
8
    /**
9
     * @param array $query
10
     * @return array|GenericEntity[]
11
     */
12
    public function findAll(array $query = array())
13
    {
14
        $request = new GetJson('/admin/policies.json', $query);
15
        $response = $this->send($request);
16
        return $this->createCollection($response->get('policies'));
0 ignored issues
show
Bug introduced by
It seems like $response->get('policies') can also be of type string; however, parameter $items of CodeCloud\Bundle\Shopify...int::createCollection() 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

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