Passed
Push — master ( 609799...41987d )
by John
04:18
created

Crawler::__construct()   B

Complexity

Conditions 8
Paths 128

Size

Total Lines 21
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 8
eloc 13
nc 128
nop 4
dl 0
loc 21
rs 8.2111
c 0
b 0
f 0
1
<?php
2
3
namespace App\Babel\Crawler;
4
5
use App\Http\Controllers\VirtualCrawler\CodeForces\CodeForces;
6
use App\Http\Controllers\VirtualCrawler\ContestHunter\ContestHunter;
7
use App\Http\Controllers\VirtualCrawler\POJ\POJ;
8
use App\Http\Controllers\VirtualCrawler\PTA\PTA;
9
use App\Http\Controllers\VirtualCrawler\Vijos\Vijos;
10
use App\Http\Controllers\VirtualCrawler\UVa\UVa;
11
use App\Models\ProblemModel;
12
use Auth;
13
14
class Crawler
15
{
16
    public $data = null;
17
18
    /**
19
     * Initial
20
     *
21
     * @return Response
0 ignored issues
show
Bug introduced by
The type App\Babel\Crawler\Response was not found. Did you mean Response? If so, make sure to prefix the type with \.
Loading history...
22
     */
23
    public function __construct($name, $action, $con, $cached=false)
24
    {
25
        if ($name=="CodeForces") {
26
            $crawler = new CodeForces($action, $con, $cached);
27
        }
28
        if ($name=="ContestHunter") {
29
            $crawler = new ContestHunter($action, $con, $cached);
30
        }
31
        if ($name=="POJ") {
32
            $crawler = new POJ($action, $con, $cached);
33
        }
34
        if ($name=="PTA") {
35
            $crawler = new PTA($action, $con, $cached);
36
        }
37
        if ($name=="Vijos") {
38
            $crawler = new Vijos($action, $con, $cached);
39
        }
40
        if ($name=="UVa") {
41
            $crawler = new UVa($action, $con, $cached);
42
        }
43
        if (isset($crawler)) $this->data = $crawler->data;
44
    }
45
}
46