| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 22 | public function __construct(X509Certificate $certificate, XMLSecurityKey $privateKey = null) |
|
| 26 | { |
||
| 27 | 22 | parent::__construct(); |
|
| 28 | 22 | $this->certificate = $certificate; |
|
| 29 | |||
| 30 | 22 | $this->setPublicKey(KeyHelper::createPublicKey($certificate)); |
|
| 31 | |||
| 32 | 22 | $this->setKeyNames(array($this->getCertificate()->getName())); |
|
|
|
|||
| 33 | |||
| 34 | 22 | if ($privateKey) { |
|
| 35 | 21 | $this->setPrivateKey($privateKey); |
|
| 36 | } |
||
| 37 | 22 | } |
|
| 38 | |||
| 47 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: