Completed
Push — master ( ea0e5d...10ff2a )
by mw
02:37
created

formats/ploticus/SRF_PloticusVBar.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 31 and the first side effect is on line 20.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * A query printer using Ploticus drawing vertical bars.
4
 * loosely based on the Ploticus Extension by Flavien Scheurer
5
 * and CSV result printer
6
 *
7
 * @note AUTOLOADED
8
 * @author Joel Natividad
9
 * @author Denny Vrandecic
10
 */
11
12
/**
13
 * Result printer using Ploticus to plot vertical bars.
14
 * TODO: Create expanded doxygen comments
15
 *
16
 * @ingroup SMWQuery
17
 */
18
19
if ( !defined( 'MEDIAWIKI' ) ) {
20
	die( 'Not an entry point.' );
21
}
22
23
include_once("SRF_Ploticus.php");
24
25
/**
26
 * This class only specifies the the SRFPloticus superclass. Since the
27
 * current working of the SRFPloticus class is unsafe, this specialization
28
 * filters out this unsecure parameter passing (and the power of Ploticus)
29
 * and allows only for vertical bars.
30
 */
31
class SRFPloticusVBar extends SRFPloticus {
32
33
	protected function readParameters( $params, $outputmode ) {
34
		parent::readParameters( $params, $outputmode );
35
36
		// All other options will be simply ignored;
37
		$this->m_ploticusmode === 'prefab';
38
		$this->m_ploticusparams = "-prefab vbars x=1 y=2";
39
	}
40
41
}