MessageFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the DataImporter package.
7
 *
8
 * (c) Loïc Sapone <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace IQ2i\DataImporter\Exchange;
15
16
use IQ2i\DataImporter\Reader\ReaderInterface;
17
18
final class MessageFactory
19
{
20 11
    public static function create(
21
        ReaderInterface $reader,
22
        mixed $data = null,
23
        ?string $archiveFilePath = null,
24
    ): Message {
25 11
        return new Message(
26 11
            $reader->getFile()->getFilename(),
27 11
            $reader->getFile()->getPathname(),
28 11
            $reader->index(),
29 11
            $reader->count(),
30 11
            $data,
31 11
            $archiveFilePath
32 11
        );
33
    }
34
}
35