Conditions | 5 |
Paths | 6 |
Total Lines | 17 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types=1); |
||
9 | public function __construct( |
||
10 | public string $cacheDir = '/tmp/.rssreader_cache', |
||
11 | public string $cacheIdsFile = 'cacheIds.txt', |
||
12 | private ?SplFileObject $cacheIds = null, |
||
13 | ) { |
||
14 | // Read path cache dir from env |
||
15 | if (!empty($_ENV['RSSREADER_CACHE_DIR'])) { |
||
16 | $this->cacheDir = $_ENV['RSSREADER_CACHE_DIR']; |
||
17 | } |
||
18 | |||
19 | if (!is_dir($this->cacheDir)) { |
||
20 | if (!mkdir($this->cacheDir) && !is_dir($this->cacheDir)) { |
||
21 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $this->cacheDir)); |
||
22 | } |
||
23 | } |
||
24 | |||
25 | $this->cacheIds = new SplFileObject($this->cacheDir . '/' . $this->cacheIdsFile, 'a+b'); |
||
26 | } |
||
53 |
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.