CurrencyContextHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A serializeToJson() 0 4 1
1
<?php
2
3
/**
4
 * @author Rafał Muszyński <[email protected]>
5
 * @copyright 2015 Sourcefabric z.ú.
6
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
7
 */
8
9
namespace Newscoop\PaywallBundle\Serializer;
10
11
use JMS\Serializer\JsonSerializationVisitor;
12
use Newscoop\PaywallBundle\Currency\Context\CurrencyContextInterface;
13
14
/**
15
 * Currency handler. Handles currency conversion.
16
 */
17
class CurrencyContextHandler
18
{
19
    private $context;
20
21
    /**
22
     * Construct.
23
     *
24
     * @param CurrencyConverter $converter
0 ignored issues
show
Bug introduced by
There is no parameter named $converter. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
25
     */
26
    public function __construct(CurrencyContextInterface $context)
27
    {
28
        $this->context = $context;
29
    }
30
31
    public function serializeToJson(JsonSerializationVisitor $visitor, $object, $type)
0 ignored issues
show
Unused Code introduced by
The parameter $visitor is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $object is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $type is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
    {
33
        return $this->context->getCurrency();
34
    }
35
}
36