Test Failed
Push — master ( fe7900...79d767 )
by Attila
11:12
created

ReadsManifestFile::manifest()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Contains the ReadsManifestFile trait.
7
 *
8
 * @copyright   Copyright (c) 2021 Attila Fulop
9
 * @author      Attila Fulop
10
 * @license     MIT
11
 * @since       2021-11-18
12
 *
13
 */
14
15
namespace Konekt\Concord\Concerns;
16
17
use Konekt\Concord\Contracts\Convention;
18
use Konekt\Concord\Module\ManifestFile;
19
20
trait ReadsManifestFile
21
{
22
    private ?ManifestFile $manifestFile = null;
23
24
    protected function manifest(Convention $convention): ManifestFile
25
    {
26
        if (null === $this->manifestFile) {
27
            $this->manifestFile = ManifestFile::read($this->getBasePath() . '/' . $convention->manifestFile());
0 ignored issues
show
Bug introduced by
It seems like getBasePath() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

27
            $this->manifestFile = ManifestFile::read($this->/** @scrutinizer ignore-call */ getBasePath() . '/' . $convention->manifestFile());
Loading history...
28
        }
29
30
        return $this->manifestFile;
31
    }
32
}
33