Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
DuplicateFilesException
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getFiles
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace FileImporter\Exceptions;
4
5use File;
6
7/**
8 * @license GPL-2.0-or-later
9 * @author Addshore
10 */
11class DuplicateFilesException extends ImportException {
12
13    private const ERROR_CODE = 'duplicateFiles';
14
15    /** @var File[] */
16    private array $files;
17
18    /**
19     * @param File[] $duplicateFiles
20     */
21    public function __construct( array $duplicateFiles ) {
22        $this->files = $duplicateFiles;
23
24        parent::__construct( 'File already on wiki', self::ERROR_CODE );
25    }
26
27    /**
28     * @return File[]
29     */
30    public function getFiles() {
31        return $this->files;
32    }
33
34}