• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

The-oGlow / ya-corapi / 20730329328

05 Jan 2026 09:54PM UTC coverage: 50.144% (+3.8%) from 46.354%
20730329328

push

github

oglowa
#3: Update files / tested

522 of 537 new or added lines in 20 files covered. (97.21%)

153 existing lines in 8 files now uncovered.

1048 of 2090 relevant lines covered (50.14%)

8.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.04
/src/Yacorapi/Store/FileStoreItem.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of ezlogging
7
 *
8
 * (c) 2024 Oliver Glowa, coding.glowa.com
9
 *
10
 * This source file is subject to the Apache-2.0 license that is bundled
11
 * with this source code in the file LICENSE.
12
 */
13

14
namespace oglowa\tools\Yacorapi\Store;
15

16
use Monolog\ConsoleLogger;
17
use Psr\Log\LoggerInterface;
18

19
class FileStoreItem extends AbstractStoreItem
20
{
21
    public const DIR  = 'DIR';
22

23
    public const FILE = 'FILE';
24

25
    public const EXT  = 'EXT';
26

27
    /** @var LoggerInterface */
28
    private $logger;
29

30
    /**
31
     * @param string $dir
32
     * @param string $file
33
     * @param string $ext
34
     *
35
     * @return IStoreItem
36
     */
37
    public static function prepareTargetFile(string $dir, string $file, string $ext = IStoreItem::EXT_TEXT): IStoreItem
3✔
38
    {
39
        return new self($dir, $file, $ext);
3✔
40
    }
41

42
    protected function __construct(string $dir, string $file, string $ext = self::EXT_TEXT)
3✔
43
    {
44
        $this->logger = new ConsoleLogger(FileStoreItem::class);
3✔
45
        $this->logger->debug("START");
3✔
46

47
        parent::__construct();
3✔
48
        $this->storeItems->put(self::DIR, $dir);
3✔
49
        $this->storeItems->put(self::FILE, $file);
3✔
50
        $this->storeItems->put(self::EXT, $ext);
3✔
51

52
        $this->logger->debug("END");
3✔
53
    }
54

UNCOV
55
    public function setDir(string $dir): IStoreItem
×
56
    {
57
        $this->storeItems->put(self::DIR, $dir);
×
58

59
        return $this;
×
60
    }
61

UNCOV
62
    public function getDir(): string
×
63
    {
64
        return $this->storeItems->get(self::DIR, '');
×
65
    }
66

UNCOV
67
    public function setFile(string $file): IStoreItem
×
68
    {
69
        $this->storeItems->put(self::FILE, $file);
×
70

71
        return $this;
×
72
    }
73

UNCOV
74
    public function getFile(): string
×
75
    {
76
        return $this->storeItems->get(self::FILE, '');
×
77
    }
78

UNCOV
79
    public function setExt(string $ext = self::EXT_TEXT): IStoreItem
×
80
    {
81
        $this->storeItems->put(self::EXT, $ext);
×
82

83
        return $this;
×
84
    }
85

UNCOV
86
    public function getExt(): string
×
87
    {
88
        return $this->storeItems->get(self::EXT, self::EXT_TEXT);
×
89
    }
90

UNCOV
91
    public function __toString()
×
92
    {
93
        return $this->getDir() . self::C_PATH_SEP . $this->getFile() . self::C_FILE_SEP . $this->getExt();
×
94
    }
95
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc