PolicyEndpoint::findAll()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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