Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
45 | 3 | public function parse($userAgent, array $headers = []) |
|
46 | { |
||
47 | 3 | foreach ($this->getProviders() as $provider) { |
|
48 | /* @var $provider \UserAgentParser\Provider\AbstractProvider */ |
||
49 | |||
50 | try { |
||
51 | 2 | return $provider->parse($userAgent, $headers); |
|
52 | 1 | } catch (Exception\NoResultFoundException $ex) { |
|
53 | // just catch this and continue to the next provider |
||
54 | } |
||
55 | } |
||
56 | |||
57 | 2 | throw new Exception\NoResultFoundException('No result found for user agent: ' . $userAgent); |
|
58 | } |
||
59 | } |
||
60 |