ImportResult   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 43
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A reset() 0 4 1
1
<?php
2
3
namespace App\Core\Result;
4
5
/**
6
 * {@inheritDoc}
7
 *
8
 * Import result class
9
 */
10
class ImportResult extends Result
11
{
12
    /**
13
     * File name
14
     *
15
     * @var string
16
     */
17
    public $filename;
18
19
    /**
20
     * Constructor
21
     *
22
     * @param string $filename the filename
23
     * @param int $created the counter of created objects
24
     * @param int $updated the counter of updated objects
25
     * @param int $errors the counter of errors (not created)
26
     * @param string $info the info message
27
     * @param string $warn the warn message
28
     * @param string $error the error message
29
     * @return void
30
     */
31
    public function __construct(
32
        $filename = '',
33
        $created = 0,
34
        $updated = 0,
35
        $errors = 0,
36
        $info = '',
37
        $warn = '',
38
        $error = ''
39
    ) {
40
        parent::__construct($created, $updated, $errors, $info, $warn, $error);
41
        $this->filename = $filename;
42
    }
43
44
    /**
45
     * Reset attributes
46
     *
47
     * @return void
48
     */
49
    public function reset(): void
50
    {
51
        $this->filename = $this->info = $this->warn = $this->error = '';
52
        $this->created = $this->updated = $this->errors = 0;
53
    }
54
}
55