Completed
Push — master ( 5a4f08...7c4035 )
by Daniel
02:20
created

ShopifyStore::shopifyStore()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 6
c 1
b 0
f 0
nc 3
nop 0
dl 0
loc 13
rs 9.4285
1
<?php
2
namespace CodeCloud\Bundle\ShopifyBundle\Twig\Extension;
3
4
use CodeCloud\Bundle\ShopifyBundle\Security\HmacSignature;
5
6
class ShopifyStore extends \Twig_Extension
0 ignored issues
show
Bug introduced by
The type Twig_Extension was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
{
8
    /**
9
     * @var HmacSignature
10
     */
11
    private $hmac;
12
13
    /**
14
     * @param HmacSignature $hmac
15
     */
16
    public function __construct(HmacSignature $hmac)
17
    {
18
        $this->hmac = $hmac;
19
    }
20
21
    /**
22
     * @return array
23
     */
24
    public function getFunctions()
25
    {
26
        return [
27
            new \Twig_SimpleFunction('embedded_link', [$this, 'embeddedLink']),
0 ignored issues
show
Bug introduced by
The type Twig_SimpleFunction was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
28
        ];
29
    }
30
31
    public function embeddedLink($storeName, $uri, $uriParams = [])
32
    {
33
        $authParams = $this->hmac->generateParams($storeName);
34
35
        return '/embedded/' . $uri . '?' . http_build_query(
36
            array_merge($authParams, $uriParams)
37
        );
38
    }
39
}
40