1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace SCI; |
4
|
|
|
|
5
|
|
|
use SMW\Services\ServicesFactory as ApplicationFactory; |
|
|
|
|
6
|
|
|
use SMW\NamespaceExaminer; |
|
|
|
|
7
|
|
|
use SMW\ParameterProcessorFactory; |
|
|
|
|
8
|
|
|
use SCI\Bibtex\BibtexProcessor; |
9
|
|
|
use SCI\Bibtex\BibtexParser; |
10
|
|
|
use SCI\Bibtex\BibtexAuthorListParser; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @license GNU GPL v2+ |
14
|
|
|
* @since 1.0 |
15
|
|
|
* |
16
|
|
|
* @author mwjames |
17
|
|
|
*/ |
18
|
|
|
class ParserFunctionFactory { |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* {{#scite:}} |
22
|
|
|
* |
23
|
|
|
* @since 1.0 |
24
|
|
|
* |
25
|
|
|
* @param NamespaceExaminer $namespaceExaminer |
26
|
|
|
* @param Options $options |
27
|
|
|
* |
28
|
|
|
* @return array |
29
|
|
|
*/ |
30
|
|
|
public function newSciteParserFunctionDefinition( NamespaceExaminer $namespaceExaminer, Options $options ) { |
31
|
|
|
|
32
|
15 |
|
$sciteParserFunctionDefinition = function( $parser ) use( $namespaceExaminer, $options ) { |
33
|
|
|
|
34
|
15 |
|
$parserData = ApplicationFactory::getInstance()->newParserData( |
35
|
15 |
|
$parser->getTitle(), |
36
|
15 |
|
$parser->getOutput() |
37
|
|
|
); |
38
|
|
|
|
39
|
15 |
|
$mwCollaboratorFactory = ApplicationFactory::getInstance()->newMwCollaboratorFactory(); |
40
|
|
|
|
41
|
15 |
|
$citationTextTemplateRenderer = new CitationTextTemplateRenderer( |
42
|
15 |
|
$mwCollaboratorFactory->newWikitextTemplateRenderer(), |
43
|
15 |
|
$parser |
44
|
|
|
); |
45
|
|
|
|
46
|
15 |
|
$mediaWikiNsContentMapper = new MediaWikiNsContentMapper( |
47
|
15 |
|
$mwCollaboratorFactory->newMediaWikiNsContentReader() |
48
|
|
|
); |
49
|
|
|
|
50
|
15 |
|
$sciteParserFunction = new SciteParserFunction( |
51
|
15 |
|
$parserData, |
52
|
15 |
|
$namespaceExaminer, |
53
|
15 |
|
$citationTextTemplateRenderer, |
54
|
15 |
|
$mediaWikiNsContentMapper, |
55
|
15 |
|
new BibtexProcessor( new BibtexParser(), new BibtexAuthorListParser() ) |
56
|
|
|
); |
57
|
|
|
|
58
|
15 |
|
$sciteParserFunction->setStrictParserValidationState( |
59
|
15 |
|
$options->get( 'enabledStrictParserValidation' ) |
|
|
|
|
60
|
|
|
); |
61
|
|
|
|
62
|
15 |
|
return $sciteParserFunction->doProcess( |
63
|
15 |
|
ParameterProcessorFactory::newFromArray( func_get_args() ), |
64
|
15 |
|
new PreTextFormatter() |
65
|
|
|
); |
66
|
1 |
|
}; |
67
|
|
|
|
68
|
1 |
|
return [ 'scite', $sciteParserFunctionDefinition, 0 ]; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* {{#referencelist:}} |
73
|
|
|
* |
74
|
|
|
* @since 1.0 |
75
|
|
|
* |
76
|
|
|
* @return array |
77
|
|
|
*/ |
78
|
|
|
public function newReferenceListParserFunctionDefinition() { |
79
|
|
|
|
80
|
5 |
|
$referenceListParserFunctionDefinition = function( $parser ) { |
81
|
|
|
|
82
|
5 |
|
$parserData = ApplicationFactory::getInstance()->newParserData( |
83
|
5 |
|
$parser->getTitle(), |
84
|
5 |
|
$parser->getOutput() |
85
|
|
|
); |
86
|
|
|
|
87
|
5 |
|
$referenceListParserFunction = new ReferenceListParserFunction( $parserData ); |
88
|
|
|
|
89
|
5 |
|
return $referenceListParserFunction->doProcess( |
90
|
5 |
|
ParameterProcessorFactory::newFromArray( func_get_args() ) |
91
|
|
|
); |
92
|
|
|
}; |
93
|
|
|
|
94
|
|
|
return [ 'referencelist', $referenceListParserFunctionDefinition, 0 ]; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
} |
98
|
|
|
|
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