CheckSDL   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 16 3
1
<?php
2
3
namespace Matecat\XliffParser\XliffUtils\CheckPipeline;
4
5
class CheckSDL implements CheckInterface {
6
    /**
7
     * @param array|null $tmp
8
     *
9
     * @return array|null
10
     */
11
    public function check( ?array $tmp = [] ): ?array {
12
        $fileType = [];
13
14
        if ( isset( $tmp[ 0 ] ) ) {
15
            if ( stripos( $tmp[ 0 ], 'sdl:version' ) !== false ) {
16
                //little trick, we consider not proprietary Sdlxliff files because we can handle them
17
                $fileType[ 'proprietary' ]            = false;
18
                $fileType[ 'proprietary_name' ]       = 'SDL Studio ';
19
                $fileType[ 'proprietary_short_name' ] = 'trados';
20
                $fileType[ 'converter_version' ]      = 'legacy';
21
22
                return $fileType;
23
            }
24
        }
25
26
        return null;
27
    }
28
}
29