PdfLetter::getIssueDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ByTIC\DocumentGenerator\Tests\Fixtures\Models\PdfLetters;
4
5
use ByTIC\DocumentGenerator\PdfLetters\Models\PdfLetters\PdfLetterTrait;
6
use ByTIC\MediaLibrary\Collections\Collection;
7
use ByTIC\MediaLibrary\HasMedia\Interfaces\HasMedia;
8
use ByTIC\MediaLibrary\Loaders\Filesystem;
9
use ByTIC\MediaLibrary\MediaRepository\MediaRepository;
10
use DateTime;
11
use Nip\Filesystem\FileDisk;
12
use League\Flysystem\Adapter\Local as LocalAdapter;
13
use Nip\Records\Record;
14
use Nip\Records\Traits\AbstractTrait\RecordTrait as AbstractRecordTrait;
15
16
/**
17
 * Class PdfLetter
18
 * @package ByTIC\DocumentGenerator\Tests\Fixtures\Models\PdfLetters
19
 */
20
class PdfLetter extends Record implements HasMedia
21
{
22
    use PdfLetterTrait;
0 ignored issues
show
Bug introduced by
The trait ByTIC\DocumentGenerator\...fLetters\PdfLetterTrait requires the property $violations which is not provided by ByTIC\DocumentGenerator\...ls\PdfLetters\PdfLetter.
Loading history...
23
24
    /**
25
     * @return FileDisk
26
     */
27
    public function getMediaFilesystemDisk()
28
    {
29
        if (!isset($this->disk)) {
30
            $this->disk = new FileDisk(
0 ignored issues
show
Bug Best Practice introduced by
The property disk does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
31
                new LocalAdapter(
32
                    TEST_FIXTURE_PATH
33
                )
34
            );
35
        }
36
        return $this->disk;
37
    }
38
39
    public function getItemsManager()
40
    {
41
    }
42
43
    /**
44
     * @param MediaRepository $mediaCollection
45
     */
46
    public function registerMediaCollections($mediaRepository)
47
    {
48
        $mediaRepository->getCollection('files')->setLoaderClass(Filesystem::class);
49
    }
50
51
    /**
52
     * @return AbstractRecordTrait
53
     */
54
    public function getModelExample()
55
    {
56
    }
57
58
    public function getIssueDate(): DateTime
59
    {
60
        return $this->issueDate;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->issueDate could return the type null which is incompatible with the type-hinted return DateTime. Consider adding an additional type-check to rule them out.
Loading history...
Bug Best Practice introduced by
The property issueDate does not exist on ByTIC\DocumentGenerator\...ls\PdfLetters\PdfLetter. Since you implemented __get, consider adding a @property annotation.
Loading history...
61
    }
62
}
63