|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace SCI\FilteredMetadata; |
|
4
|
|
|
|
|
5
|
|
|
use Onoi\HttpRequest\HttpRequest; |
|
6
|
|
|
use Onoi\Remi\FilteredHttpResponseParserFactory; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* @license GNU GPL v2+ |
|
10
|
|
|
* @since 1.0 |
|
11
|
|
|
* |
|
12
|
|
|
* @author mwjames |
|
13
|
|
|
*/ |
|
14
|
|
|
class HttpResponseParserFactory { |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* @var HttpRequest |
|
18
|
|
|
*/ |
|
19
|
|
|
private $httpRequest; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* @since 1.0 |
|
23
|
|
|
* |
|
24
|
|
|
* @param HttpRequest $httpRequest |
|
25
|
|
|
*/ |
|
26
|
15 |
|
public function __construct( HttpRequest $httpRequest ) { |
|
27
|
15 |
|
$this->httpRequest = $httpRequest; |
|
28
|
15 |
|
} |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @since 1.0 |
|
32
|
|
|
* |
|
33
|
|
|
* @param string $type |
|
34
|
|
|
* |
|
35
|
|
|
* @return ResponseParser |
|
|
|
|
|
|
36
|
|
|
*/ |
|
37
|
14 |
|
public function newResponseParserForType( $type ) { |
|
38
|
|
|
|
|
39
|
14 |
|
$bibliographicFilteredRecord = new BibliographicFilteredRecord(); |
|
40
|
|
|
|
|
41
|
14 |
|
$filteredHttpResponseParserFactory = new FilteredHttpResponseParserFactory( |
|
42
|
14 |
|
$this->httpRequest |
|
43
|
|
|
); |
|
44
|
|
|
|
|
45
|
14 |
|
switch ( strtolower( $type ) ) { |
|
46
|
14 |
|
case 'doi': |
|
47
|
2 |
|
$responseParser = new CrossRefResponseParser( |
|
48
|
2 |
|
$filteredHttpResponseParserFactory->newCrossRefFilteredHttpResponseParser( |
|
49
|
2 |
|
$bibliographicFilteredRecord |
|
50
|
|
|
) |
|
51
|
|
|
); |
|
52
|
2 |
|
break; |
|
53
|
12 |
|
case 'viaf': |
|
54
|
2 |
|
$responseParser = new ViafResponseParser( |
|
55
|
2 |
|
$filteredHttpResponseParserFactory->newViafFilteredHttpResponseParser( |
|
56
|
2 |
|
$bibliographicFilteredRecord |
|
57
|
|
|
) |
|
58
|
|
|
); |
|
59
|
2 |
|
break; |
|
60
|
10 |
|
case 'pubmed': |
|
61
|
1 |
|
$responseParser = new NcbiPubMedResponseParser( |
|
62
|
1 |
|
$filteredHttpResponseParserFactory->newNcbiPubMedFilteredHttpResponseParser( |
|
63
|
1 |
|
$bibliographicFilteredRecord |
|
64
|
|
|
) |
|
65
|
|
|
); |
|
66
|
1 |
|
break; |
|
67
|
9 |
|
case 'pmc': |
|
68
|
2 |
|
$responseParser = new NcbiPubMedResponseParser( |
|
69
|
2 |
|
$filteredHttpResponseParserFactory->newNcbiPubMedCentralFilteredHttpResponseParser( |
|
70
|
2 |
|
$bibliographicFilteredRecord |
|
71
|
|
|
) |
|
72
|
|
|
); |
|
73
|
2 |
|
break; |
|
74
|
7 |
|
case 'oclc': |
|
75
|
3 |
|
$responseParser = new OclcResponseParser( |
|
76
|
3 |
|
$filteredHttpResponseParserFactory->newOclcFilteredHttpResponseParser( |
|
77
|
3 |
|
$bibliographicFilteredRecord |
|
78
|
|
|
) |
|
79
|
|
|
); |
|
80
|
3 |
|
break; |
|
81
|
4 |
|
case 'ol': |
|
82
|
3 |
|
$responseParser = new OLResponseParser( |
|
83
|
3 |
|
$filteredHttpResponseParserFactory->newOLFilteredHttpResponseParser( |
|
84
|
3 |
|
$bibliographicFilteredRecord |
|
85
|
|
|
) |
|
86
|
|
|
); |
|
87
|
3 |
|
break; |
|
88
|
|
|
default: |
|
89
|
1 |
|
$responseParser = $filteredHttpResponseParserFactory->newNullResponseParser( |
|
90
|
1 |
|
$bibliographicFilteredRecord |
|
91
|
|
|
); |
|
92
|
1 |
|
break; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
14 |
|
return $responseParser; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
} |
|
99
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths