Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Branch master (dd22e2)
by Der Mundschenk
02:57
created
src/fixes/node-fixes/class-smart-diacritics-fix.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,24 +45,24 @@
 block discarded – undo
45 45
 	 * @param Settings $settings Required.
46 46
 	 * @param bool     $is_title Optional. Default false.
47 47
 	 */
48
-	public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
49
-		if ( empty( $settings['smartDiacritics'] ) ) {
48
+	public function apply(\DOMText $textnode, Settings $settings, $is_title = false) {
49
+		if (empty($settings['smartDiacritics'])) {
50 50
 			return; // abort.
51 51
 		}
52 52
 
53
-		if ( ! empty( $settings['diacriticReplacement'] ) &&
54
-			 ! empty( $settings['diacriticReplacement']['patterns'] ) &&
55
-			 ! empty( $settings['diacriticReplacement']['replacements'] ) ) {
53
+		if ( ! empty($settings['diacriticReplacement']) &&
54
+			 ! empty($settings['diacriticReplacement']['patterns']) &&
55
+			 ! empty($settings['diacriticReplacement']['replacements'])) {
56 56
 
57 57
 			// Uses "word" => "replacement" pairs from an array to make fast preg_* replacements.
58 58
 			$replacements = $settings['diacriticReplacement']['replacements'];
59
-			$textnode->data = preg_replace_callback( $settings['diacriticReplacement']['patterns'], function( $match ) use ( $replacements ) {
60
-				if ( isset( $replacements[ $match[0] ] ) ) {
61
-					return $replacements[ $match[0] ];
59
+			$textnode->data = preg_replace_callback($settings['diacriticReplacement']['patterns'], function($match) use ($replacements) {
60
+				if (isset($replacements[$match[0]])) {
61
+					return $replacements[$match[0]];
62 62
 				} else {
63 63
 					return $match[0];
64 64
 				}
65
-			}, $textnode->data );
65
+			}, $textnode->data);
66 66
 		}
67 67
 	}
68 68
 }
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-abstract-node-fix.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	 *
52 52
 	 * @param bool $feed_compatible Optional. Default false.
53 53
 	 */
54
-	public function __construct( $feed_compatible = false ) {
54
+	public function __construct($feed_compatible = false) {
55 55
 		$this->feed_compatible = $feed_compatible;
56 56
 	}
57 57
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @return void
66 66
 	 */
67
-	abstract public function apply( \DOMText $textnode, Settings $settings, $is_title = false );
67
+	abstract public function apply(\DOMText $textnode, Settings $settings, $is_title = false);
68 68
 
69 69
 	/**
70 70
 	 * Determines whether the fix should be applied to (RSS) feeds.
@@ -86,18 +86,18 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @return string            The string without `$prev_char` and `$next_char`.
88 88
 	 */
89
-	protected static function remove_adjacent_characters( $string, $prev_char = '', $next_char = '' ) {
89
+	protected static function remove_adjacent_characters($string, $prev_char = '', $next_char = '') {
90 90
 		// Use the most efficient string functions.
91
-		$func = Strings::functions( $string );
91
+		$func = Strings::functions($string);
92 92
 
93 93
 		// Remove previous character.
94
-		if ( '' !== $prev_char ) {
95
-			$string = $func['substr']( $string, 1, $func['strlen']( $string ) );
94
+		if ('' !== $prev_char) {
95
+			$string = $func['substr']($string, 1, $func['strlen']($string));
96 96
 		}
97 97
 
98 98
 		// Remove next character.
99
-		if ( '' !== $next_char ) {
100
-			$string = $func['substr']( $string, 0, $func['strlen']( $string ) - 1 );
99
+		if ('' !== $next_char) {
100
+			$string = $func['substr']($string, 0, $func['strlen']($string) - 1);
101 101
 		}
102 102
 
103 103
 		return $string;
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-style-numbers-fix.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
 	 * @param string $css_class       HTML class used in markup.
54 54
 	 * @param bool   $feed_compatible Optional. Default false.
55 55
 	 */
56
-	public function __construct( $css_class, $feed_compatible = false ) {
57
-		parent::__construct( self::REGEX, self::SETTINGS_SWITCH, $css_class, $feed_compatible );
56
+	public function __construct($css_class, $feed_compatible = false) {
57
+		parent::__construct(self::REGEX, self::SETTINGS_SWITCH, $css_class, $feed_compatible);
58 58
 	}
59 59
 }
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-simple-regex-replacement-fix.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 	 * @param string $settings_switch On/off switch for fix.
70 70
 	 * @param bool   $feed_compatible Optional. Default false.
71 71
 	 */
72
-	public function __construct( $regex, $replacement, $settings_switch, $feed_compatible = false ) {
73
-		parent::__construct( $feed_compatible );
72
+	public function __construct($regex, $replacement, $settings_switch, $feed_compatible = false) {
73
+		parent::__construct($feed_compatible);
74 74
 
75 75
 		$this->regex           = $regex;
76 76
 		$this->settings_switch = $settings_switch;
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 	 * @param Settings $settings Required.
85 85
 	 * @param bool     $is_title Optional. Default false.
86 86
 	 */
87
-	public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
88
-		if ( empty( $settings[ $this->settings_switch ] ) ) {
87
+	public function apply(\DOMText $textnode, Settings $settings, $is_title = false) {
88
+		if (empty($settings[$this->settings_switch])) {
89 89
 			return;
90 90
 		}
91 91
 
92
-		$textnode->data = preg_replace( $this->regex, $this->replacement, $textnode->data );
92
+		$textnode->data = preg_replace($this->regex, $this->replacement, $textnode->data);
93 93
 	}
94 94
 }
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-smart-marks-fix.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,22 +49,22 @@
 block discarded – undo
49 49
 	 * @param Settings $settings Required.
50 50
 	 * @param bool     $is_title Optional. Default false.
51 51
 	 */
52
-	public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
53
-		if ( empty( $settings['smartMarks'] ) ) {
52
+	public function apply(\DOMText $textnode, Settings $settings, $is_title = false) {
53
+		if (empty($settings['smartMarks'])) {
54 54
 			return;
55 55
 		}
56 56
 
57 57
 		// Escape usage of "501(c)(1...29)" (US non-profit).
58
-		$textnode->data = preg_replace( self::ESCAPE_501C, '$1' . RE::ESCAPE_MARKER . '$2' . RE::ESCAPE_MARKER . '$3', $textnode->data );
58
+		$textnode->data = preg_replace(self::ESCAPE_501C, '$1' . RE::ESCAPE_MARKER . '$2' . RE::ESCAPE_MARKER . '$3', $textnode->data);
59 59
 
60 60
 		// Replace marks.
61
-		$textnode->data = str_replace( [ '(c)', '(C)' ],   U::COPYRIGHT,      $textnode->data );
62
-		$textnode->data = str_replace( [ '(r)', '(R)' ],   U::REGISTERED_MARK, $textnode->data );
63
-		$textnode->data = str_replace( [ '(p)', '(P)' ],   U::SOUND_COPY_MARK,  $textnode->data );
64
-		$textnode->data = str_replace( [ '(sm)', '(SM)' ], U::SERVICE_MARK,    $textnode->data );
65
-		$textnode->data = str_replace( [ '(tm)', '(TM)' ], U::TRADE_MARK,      $textnode->data );
61
+		$textnode->data = str_replace(['(c)', '(C)'], U::COPYRIGHT, $textnode->data);
62
+		$textnode->data = str_replace(['(r)', '(R)'], U::REGISTERED_MARK, $textnode->data);
63
+		$textnode->data = str_replace(['(p)', '(P)'], U::SOUND_COPY_MARK, $textnode->data);
64
+		$textnode->data = str_replace(['(sm)', '(SM)'], U::SERVICE_MARK, $textnode->data);
65
+		$textnode->data = str_replace(['(tm)', '(TM)'], U::TRADE_MARK, $textnode->data);
66 66
 
67 67
 		// Un-escape escaped sequences.
68
-		$textnode->data = str_replace( RE::ESCAPE_MARKER, '', $textnode->data );
68
+		$textnode->data = str_replace(RE::ESCAPE_MARKER, '', $textnode->data);
69 69
 	}
70 70
 }
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-simple-style-fix.php 2 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,6 @@
 block discarded – undo
40 40
 
41 41
 	/**
42 42
 	 * The setting string used to enable/disable the fix (e.g. 'styleAmpersands').
43
-
44 43
 	 * @var string
45 44
 	 */
46 45
 	protected $settings_switch;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 	 * @param string $css_class       HTML class used in markup.
70 70
 	 * @param bool   $feed_compatible Optional. Default false.
71 71
 	 */
72
-	public function __construct( $regex, $settings_switch, $css_class, $feed_compatible = false ) {
73
-		parent::__construct( $css_class, $feed_compatible );
72
+	public function __construct($regex, $settings_switch, $css_class, $feed_compatible = false) {
73
+		parent::__construct($css_class, $feed_compatible);
74 74
 
75 75
 		$this->regex = $regex;
76 76
 		$this->settings_switch = $settings_switch;
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 	 * @param Settings $settings Required.
85 85
 	 * @param bool     $is_title Optional. Default false.
86 86
 	 */
87
-	public function apply_internal( \DOMText $textnode, Settings $settings, $is_title = false ) {
88
-		if ( empty( $settings[ $this->settings_switch ] ) ) {
87
+	public function apply_internal(\DOMText $textnode, Settings $settings, $is_title = false) {
88
+		if (empty($settings[$this->settings_switch])) {
89 89
 			return;
90 90
 		}
91 91
 
92
-		$textnode->data = preg_replace( $this->regex, '<span class="' . $this->css_class . '">$1</span>', $textnode->data );
92
+		$textnode->data = preg_replace($this->regex, '<span class="' . $this->css_class . '">$1</span>', $textnode->data);
93 93
 	}
94 94
 }
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-dash-spacing-fix.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -103,22 +103,22 @@  discard block
 block discarded – undo
103 103
 	 * @param Settings $settings Required.
104 104
 	 * @param bool     $is_title Optional. Default false.
105 105
 	 */
106
-	public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
107
-		if ( empty( $settings['dashSpacing'] ) ) {
106
+	public function apply(\DOMText $textnode, Settings $settings, $is_title = false) {
107
+		if (empty($settings['dashSpacing'])) {
108 108
 			return;
109 109
 		}
110 110
 
111 111
 		// Various special characters and regular expressions.
112 112
 		$s = $settings->dash_style();
113 113
 
114
-		if ( $s != $this->cached_dash_style ) {
115
-			$this->update_dash_spacing_regex( $s->parenthetical_dash(), $s->parenthetical_space(), $s->interval_dash(), $s->interval_space() );
114
+		if ($s != $this->cached_dash_style) {
115
+			$this->update_dash_spacing_regex($s->parenthetical_dash(), $s->parenthetical_space(), $s->interval_dash(), $s->interval_space());
116 116
 			$this->cached_dash_style = $s;
117 117
 		}
118 118
 
119
-		$textnode->data = preg_replace( self::EM_DASH_SPACING,             $this->em_dash_replacement,            $textnode->data );
120
-		$textnode->data = preg_replace( $this->parenthetical_dash_spacing, $this->parenthetical_dash_replacement, $textnode->data );
121
-		$textnode->data = preg_replace( $this->interval_dash_spacing,      $this->interval_dash_replacement,      $textnode->data );
119
+		$textnode->data = preg_replace(self::EM_DASH_SPACING, $this->em_dash_replacement, $textnode->data);
120
+		$textnode->data = preg_replace($this->parenthetical_dash_spacing, $this->parenthetical_dash_replacement, $textnode->data);
121
+		$textnode->data = preg_replace($this->interval_dash_spacing, $this->interval_dash_replacement, $textnode->data);
122 122
 	}
123 123
 
124 124
 	/**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 * @param string $interval            The dash character used for interval dashes.
130 130
 	 * @param string $interval_space      The space character used around interval dashes.
131 131
 	 */
132
-	private function update_dash_spacing_regex( $parenthetical, $parenthetical_space, $interval, $interval_space ) {
132
+	private function update_dash_spacing_regex($parenthetical, $parenthetical_space, $interval, $interval_space) {
133 133
 		$this->parenthetical_dash_spacing = "/
134 134
 			(?:
135 135
 				\s
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-space-collapse-fix.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -53,23 +53,23 @@
 block discarded – undo
53 53
 	 * @param Settings $settings Required.
54 54
 	 * @param bool     $is_title Optional. Default false.
55 55
 	 */
56
-	public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
57
-		if ( empty( $settings['spaceCollapse'] ) ) {
56
+	public function apply(\DOMText $textnode, Settings $settings, $is_title = false) {
57
+		if (empty($settings['spaceCollapse'])) {
58 58
 			return;
59 59
 		}
60 60
 
61 61
 		// Normal spacing.
62
-		$textnode->data = preg_replace( self::COLLAPSE_NORMAL_SPACES, ' ', $textnode->data );
62
+		$textnode->data = preg_replace(self::COLLAPSE_NORMAL_SPACES, ' ', $textnode->data);
63 63
 
64 64
 		// Non-breakable space get's priority. If non-breakable space exists in a string of spaces, it collapses to a single non-breakable space.
65
-		$textnode->data = preg_replace( self::COLLAPSE_NON_BREAKABLE_SPACES, U::NO_BREAK_SPACE, $textnode->data );
65
+		$textnode->data = preg_replace(self::COLLAPSE_NON_BREAKABLE_SPACES, U::NO_BREAK_SPACE, $textnode->data);
66 66
 
67 67
 		// For any other spaceing, replace with the first occurance of an unusual space character.
68
-		$textnode->data = preg_replace( self::COLLAPSE_OTHER_SPACES, '$1', $textnode->data );
68
+		$textnode->data = preg_replace(self::COLLAPSE_OTHER_SPACES, '$1', $textnode->data);
69 69
 
70 70
 		// Remove all spacing at beginning of block level elements.
71
-		if ( '' === DOM::get_prev_chr( $textnode ) ) { // we have the first text in a block level element.
72
-			$textnode->data = preg_replace( self::COLLAPSE_SPACES_AT_START_OF_BLOCK, '', $textnode->data );
71
+		if ('' === DOM::get_prev_chr($textnode)) { // we have the first text in a block level element.
72
+			$textnode->data = preg_replace(self::COLLAPSE_SPACES_AT_START_OF_BLOCK, '', $textnode->data);
73 73
 		}
74 74
 	}
75 75
 }
Please login to merge, or discard this patch.
src/fixes/node-fixes/class-smart-ellipses-fix.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@
 block discarded – undo
46 46
 	 * @param Settings $settings Required.
47 47
 	 * @param bool     $is_title Optional. Default false.
48 48
 	 */
49
-	public function apply( \DOMText $textnode, Settings $settings, $is_title = false ) {
50
-		if ( empty( $settings['smartEllipses'] ) ) {
49
+	public function apply(\DOMText $textnode, Settings $settings, $is_title = false) {
50
+		if (empty($settings['smartEllipses'])) {
51 51
 			return;
52 52
 		}
53 53
 
54
-		$textnode->data = str_replace( [ '....', '. . . .' ], '.' . U::ELLIPSIS, $textnode->data );
55
-		$textnode->data = str_replace( [ '...', '. . .' ],          U::ELLIPSIS, $textnode->data );
54
+		$textnode->data = str_replace(['....', '. . . .'], '.' . U::ELLIPSIS, $textnode->data);
55
+		$textnode->data = str_replace(['...', '. . .'], U::ELLIPSIS, $textnode->data);
56 56
 	}
57 57
 }
Please login to merge, or discard this patch.