Issues (155)

src/PreTextFormatter.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace SCI;
4
5
use SMW\MediaWiki\Renderer\WikitextTemplateRenderer;
0 ignored issues
show
The type SMW\MediaWiki\Renderer\WikitextTemplateRenderer was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Parser;
0 ignored issues
show
The type Parser was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
8
/**
9
 * @license GNU GPL v2+
10
 * @since 1.0
11
 *
12
 * @author mwjames
13
 */
14
class PreTextFormatter {
15
16
	/**
17
	 * @since 1.4
18
	 *
19
	 * @return string
20
	 */
21 2
	public function getFormattedSciteFuncFrom( array $parameters ) {
22 2
		return "<pre>{{#scite:\n" . implode( "\n", $this->format( $parameters ) ) ."\n}}</pre>";
23
	}
24
25
	/**
26
	 * @since 1.4
27
	 *
28
	 * @return array
29
	 */
30 4
	public function format( array $parameters ) {
31
32 4
		$formatted = [];
33
34 4
		foreach ( $parameters as $key => $value ) {
35
36 4
			if ( $value === '' || $value[0] === '@' ) {
37 4
				continue;
38
			}
39
40 4
			if ( $value[0] === '+' ) {
41 2
				$formatted[$key-1] = $formatted[$key-1] . '|' . $value;
42 2
				continue;
43
			}
44
45 4
			$formatted[$key] = ' |' . $value;
46
		}
47
48 4
		return $formatted;
49
	}
50
51
}
52