CurrenciesTrait::getByCode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace ByTIC\Payments\Models\Currencies\Traits;
4
5
use Nip\Records\Traits\AbstractTrait\RecordsTrait;
6
7
/**
8
 * Trait CurrenciesTrait
9
 * @package ByTIC\Payments\Models\Currencies\Traits
10
 */
11
trait CurrenciesTrait
12
{
13
    use RecordsTrait;
14
15
    /**
16
     * @param string $code
17
     * @return CurrencyTrait
18
     */
19
    public function getByCode($code)
20
    {
21
        return $this->findOne($code);
0 ignored issues
show
Bug introduced by
The method findOne() does not exist on ByTIC\Payments\Models\Cu...\Traits\CurrenciesTrait. Did you maybe mean findOneByQuery()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        return $this->/** @scrutinizer ignore-call */ findOne($code);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
22
    }
23
}
24