GSCPDownloadTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A download() 0 5 2
1
<?php
2
namespace GSCP;
3
4
trait GSCPDownloadTrait
5
{
6
    private $url = 'https://www.google.com/basepages/producttype/taxonomy-with-ids.%locale%.txt';
7
8 5
    private function download(): void
9
    {
10 5
        if (!file_exists($this->filename)) {
11 5
            $url = str_replace('%locale%', $this->getLocale(), $this->url);
0 ignored issues
show
Bug introduced by
It seems like getLocale() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

11
            $url = str_replace('%locale%', $this->/** @scrutinizer ignore-call */ getLocale(), $this->url);
Loading history...
12 4
            copy($url, $this->filename);
13
        }
14
    }
15
}