CheckGlobalSight::check()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 9
nc 3
nop 1
dl 0
loc 15
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
namespace Matecat\XliffParser\XliffUtils\CheckPipeline;
4
5
class CheckGlobalSight 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 ], 'globalsight' ) !== false ) {
16
                $fileType[ 'proprietary' ]            = true;
17
                $fileType[ 'proprietary_name' ]       = 'GlobalSight Download File';
18
                $fileType[ 'proprietary_short_name' ] = 'globalsight';
19
                $fileType[ 'converter_version' ]      = 'legacy';
20
21
                return $fileType;
22
            }
23
        }
24
25
        return null;
26
27
    }
28
}
29