1 | <?php |
||
33 | class BibTexFileExportPrinter extends FileExportPrinter { |
||
34 | |||
35 | /** |
||
36 | * @see ResultPrinter::getName |
||
37 | * |
||
38 | * {@inheritDoc} |
||
39 | */ |
||
40 | public function getName() { |
||
43 | |||
44 | /** |
||
45 | * @see FileExportPrinter::getMimeType |
||
46 | * |
||
47 | * @since 1.8 |
||
48 | * |
||
49 | * {@inheritDoc} |
||
50 | */ |
||
51 | 1 | public function getMimeType( QueryResult $queryResult ) { |
|
54 | |||
55 | /** |
||
56 | * @see FileExportPrinter::getFileName |
||
57 | * |
||
58 | * @since 1.8 |
||
59 | * |
||
60 | * {@inheritDoc} |
||
61 | */ |
||
62 | 6 | public function getFileName( QueryResult $queryResult ) { |
|
63 | |||
64 | 6 | if ( $this->params['filename'] !== '' ) { |
|
65 | |||
66 | 4 | if ( strpos( $this->params['filename'], '.bib' ) === false ) { |
|
67 | 1 | $this->params['filename'] .= '.bib'; |
|
68 | } |
||
69 | |||
70 | 4 | return str_replace( ' ', '_', $this->params['filename'] ); |
|
71 | 2 | } elseif ( $this->getSearchLabel( SMW_OUTPUT_WIKI ) != '' ) { |
|
72 | 1 | return str_replace( ' ', '_', $this->getSearchLabel( SMW_OUTPUT_WIKI ) ) . '.bib'; |
|
73 | } |
||
74 | |||
75 | 1 | return 'BibTeX.bib'; |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * @see ResultPrinter::getParamDefinitions |
||
80 | * |
||
81 | * @since 1.8 |
||
82 | * |
||
83 | * {@inheritDoc} |
||
84 | */ |
||
85 | 1 | public function getParamDefinitions( array $definitions ) { |
|
95 | |||
96 | /** |
||
97 | * @since 3.1 |
||
98 | * |
||
99 | * @param array $list |
||
|
|||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | 1 | public function getFormattedList( $key, array $values ) { |
|
106 | |||
107 | /** |
||
108 | * @see ResultPrinter::getResultText |
||
109 | * |
||
110 | * {@inheritDoc} |
||
111 | */ |
||
112 | 2 | protected function getResultText( QueryResult $res, $outputMode ) { |
|
113 | |||
114 | 2 | if ( $outputMode !== SMW_OUTPUT_FILE ) { |
|
115 | 1 | return $this->getBibTexLink( $res, $outputMode ); |
|
116 | } |
||
117 | |||
118 | 1 | $items = []; |
|
119 | |||
120 | 1 | while ( $row = $res->getNext() ) { |
|
121 | 1 | $items[] = $this->newItem( $row )->text(); |
|
122 | } |
||
123 | |||
124 | 1 | return implode( "\r\n\r\n", $items ); |
|
125 | } |
||
126 | |||
127 | 1 | private function getBibTexLink( QueryResult $res, $outputMode ) { |
|
128 | |||
129 | // Can be viewed as HTML if requested, no more parsing needed |
||
130 | 1 | $this->isHTML = $outputMode == SMW_OUTPUT_HTML; |
|
131 | |||
132 | 1 | $link = $this->getLink( |
|
133 | 1 | $res, |
|
134 | 1 | $outputMode |
|
135 | ); |
||
136 | |||
137 | 1 | return $link->getText( $outputMode, $this->mLinker ); |
|
138 | } |
||
139 | |||
140 | /** |
||
141 | * @since 3.1 |
||
142 | * |
||
143 | * @param $row array of SMWResultArray |
||
144 | * |
||
145 | * @return bibTexItem |
||
146 | */ |
||
147 | 1 | private function newItem( array /* of SMWResultArray */ $row ) { |
|
189 | |||
190 | } |
||
191 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.