1 | <?php |
||
18 | class LibraryFactory { |
||
19 | |||
20 | /** |
||
21 | *@var Store |
||
22 | */ |
||
23 | private $store; |
||
24 | |||
25 | /** |
||
26 | * @since 1.0 |
||
27 | * |
||
28 | * @param Store $store |
||
29 | */ |
||
30 | 21 | public function __construct( Store $store ) { |
|
33 | |||
34 | /** |
||
35 | * Creates a new SMWQueryResult from passed arguments, |
||
36 | * utilizing the {@see SMWQueryProcessor} |
||
37 | * |
||
38 | * @since 1.0 |
||
39 | * |
||
40 | * @param array $rawParameters |
||
41 | * |
||
42 | * @return \SMWQueryResult |
||
43 | */ |
||
44 | 7 | public function newQueryResultFrom( $rawParameters ) { |
|
45 | |||
46 | 7 | list( $queryString, $parameters, $printouts ) = QueryProcessor::getComponentsFromFunctionParams( |
|
47 | 7 | $rawParameters, |
|
48 | 7 | false |
|
49 | ); |
||
50 | |||
51 | 7 | QueryProcessor::addThisPrintout( $printouts, $parameters ); |
|
52 | |||
53 | 7 | $query = QueryProcessor::createQuery( |
|
54 | 7 | $queryString, |
|
55 | 7 | QueryProcessor::getProcessedParams( $parameters, $printouts ), |
|
56 | 7 | QueryProcessor::SPECIAL_PAGE, |
|
57 | 7 | '', |
|
58 | 7 | $printouts |
|
59 | ); |
||
60 | |||
61 | 7 | if ( defined( 'SMWQuery::PROC_CONTEXT' ) ) { |
|
62 | 7 | $query->setOption( Query::PROC_CONTEXT, 'SSC.LibraryFactory' ); |
|
63 | } |
||
64 | |||
65 | 7 | return $this->store->getQueryResult( $query ); |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * @since 1.0 |
||
70 | * |
||
71 | * @param \SMWQueryResult|string $queryResult |
||
72 | * |
||
73 | * @return LuaAskResultProcessor |
||
74 | */ |
||
75 | 4 | public function newLuaAskResultProcessor( $queryResult ) { |
|
78 | |||
79 | /** |
||
80 | * Creates a new ParserParameterProcessor from passed arguments |
||
81 | * |
||
82 | * @since 1.0 |
||
83 | * |
||
84 | * @param array $arguments |
||
85 | * |
||
86 | * @return \SMW\ParserParameterProcessor |
||
87 | */ |
||
88 | 10 | public function newParserParameterProcessorFrom( $arguments ) { |
|
91 | |||
92 | /** |
||
93 | * Creates a new SetParserFunction utilizing a Parser |
||
94 | * |
||
95 | * @since 1.0 |
||
96 | * |
||
97 | * @param Parser $parser |
||
98 | * |
||
99 | * @return \SMW\ParserFunctions\SetParserFunction |
||
100 | */ |
||
101 | 8 | public function newSetParserFunction( Parser $parser ) { |
|
104 | |||
105 | /** |
||
106 | * Creates a new SubobjectParserFunction utilizing a Parser |
||
107 | * |
||
108 | * @since 1.0 |
||
109 | * |
||
110 | * @param Parser $parser |
||
111 | * |
||
112 | * @return \SMW\SubobjectParserFunction |
||
113 | */ |
||
114 | 3 | public function newSubobjectParserFunction( Parser $parser ) { |
|
117 | } |
||
118 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.