7
7
class Parser
8
8
{
9
9
/** @var ConfigReaderInterface */
10
- private $ configReader ;
10
+ protected $ configReader ;
11
11
12
12
/**
13
13
* @var string[]
14
14
*/
15
- private $ internalHosts = [];
15
+ protected $ internalHosts = [];
16
16
17
17
public function __construct (ConfigReaderInterface $ configReader = null , array $ internalHosts = [])
18
18
{
@@ -59,7 +59,7 @@ public function parse($refererUrl, $pageUrl = null)
59
59
return Referer::createKnown ($ referer ['medium ' ], $ referer ['source ' ], $ searchTerm );
60
60
}
61
61
62
- private static function parseUrl ($ url )
62
+ protected static function parseUrl ($ url )
63
63
{
64
64
if ($ url === null ) {
65
65
return null ;
@@ -73,7 +73,7 @@ private static function parseUrl($url)
73
73
return array_merge (['query ' => null , 'path ' => '/ ' ], $ parts );
74
74
}
75
75
76
- private function lookup ($ host , $ path )
76
+ protected function lookup ($ host , $ path )
77
77
{
78
78
$ referer = $ this ->lookupPath ($ host , $ path );
79
79
@@ -84,7 +84,7 @@ private function lookup($host, $path)
84
84
return $ this ->lookupHost ($ host );
85
85
}
86
86
87
- private function lookupPath ($ host , $ path )
87
+ protected function lookupPath ($ host , $ path )
88
88
{
89
89
$ referer = $ this ->lookupHost ($ host , $ path );
90
90
@@ -101,7 +101,7 @@ private function lookupPath($host, $path)
101
101
return $ this ->lookupPath ($ host , $ path );
102
102
}
103
103
104
- private function lookupHost ($ host , $ path = null )
104
+ protected function lookupHost ($ host , $ path = null )
105
105
{
106
106
do {
107
107
$ referer = $ this ->configReader ->lookup ($ host . $ path );
@@ -111,7 +111,7 @@ private function lookupHost($host, $path = null)
111
111
return $ referer ;
112
112
}
113
113
114
- private static function createDefaultConfigReader ()
114
+ protected static function createDefaultConfigReader ()
115
115
{
116
116
return new JsonConfigReader (__DIR__ . '/../../../data/referers.json ' );
117
117
}
0 commit comments