1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
14 | class RefererTracker |
||
15 | { |
||
16 | /* ------------------------------------------------------------------------------------------------ |
||
17 | | Properties |
||
18 | | ------------------------------------------------------------------------------------------------ |
||
19 | */ |
||
20 | /** |
||
21 | * The referer parser. |
||
22 | * |
||
23 | * @var \Arcanedev\LaravelTracker\Contracts\Parsers\RefererParser |
||
24 | */ |
||
25 | protected $parser; |
||
26 | |||
27 | /* ------------------------------------------------------------------------------------------------ |
||
28 | | Constructor |
||
29 | | ------------------------------------------------------------------------------------------------ |
||
30 | */ |
||
31 | public function __construct() |
||
35 | |||
36 | /* ------------------------------------------------------------------------------------------------ |
||
37 | | Main Functions |
||
38 | | ------------------------------------------------------------------------------------------------ |
||
39 | */ |
||
40 | /** |
||
41 | * Track the referer and return the id. |
||
42 | * |
||
43 | * @param string $refererUrl |
||
44 | * @param string $pageUrl |
||
45 | * |
||
46 | * @return int|null |
||
47 | */ |
||
48 | public function track($refererUrl, $pageUrl) |
||
85 | |||
86 | /** |
||
87 | * Get the domain id. |
||
88 | * |
||
89 | * @param string $name |
||
90 | * |
||
91 | * @return int |
||
92 | */ |
||
93 | private function getDomainId($name) |
||
99 | |||
100 | /** |
||
101 | * Store the referer's search terms. |
||
102 | * |
||
103 | * @param int $refererId |
||
104 | * @param string $searchTerms |
||
105 | */ |
||
106 | private function storeSearchTerms($refererId, $searchTerms) |
||
117 | } |
||
118 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.