Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2.0078 |
Changes | 0 |
1 | <?php namespace Lbc\Crawler; |
||
10 | 6 | public function getNbAds() |
|
11 | { |
||
12 | 6 | $nbAds = $this->crawler |
|
13 | 6 | ->filter('a.tabsSwitch span.tabsSwitchNumbers') |
|
14 | 6 | ->first(); |
|
15 | |||
16 | 6 | if ($nbAds->count()) { |
|
17 | 6 | $nbAds = preg_replace('/\s+/', '', $nbAds->text()); |
|
18 | 6 | return (int) $nbAds; |
|
19 | } |
||
20 | |||
21 | return 0; |
||
22 | } |
||
23 | |||
83 |