Skip to content

Commit 6e97cd2

Browse files
authored
Merge pull request #1243 from PHPCSStandards/phpcs-4.x/feature/155-normalize-some-code-style-rules-5
CS: normalize code style rules [5]
2 parents 1adb191 + 484b89b commit 6e97cd2

File tree

656 files changed

+3060
-6749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+3060
-6749
lines changed

autoload.php

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ public static function load(string $className)
140140
}
141141

142142
return false;
143-
144-
}//end load()
143+
}
145144

146145

147146
/**
@@ -183,8 +182,7 @@ public static function loadFile(string $path)
183182
self::$loadedClasses[$path] = $className;
184183
self::$loadedFiles[$className] = $path;
185184
return self::$loadedClasses[$path];
186-
187-
}//end loadFile()
185+
}
188186

189187

190188
/**
@@ -244,8 +242,7 @@ static function ($remaining, $current) {
244242
}
245243

246244
return $className;
247-
248-
}//end determineLoadedClass()
245+
}
249246

250247

251248
/**
@@ -259,8 +256,7 @@ static function ($remaining, $current) {
259256
public static function addSearchPath(string $path, string $nsPrefix = '')
260257
{
261258
self::$searchPaths[$path] = rtrim(trim((string) $nsPrefix), '\\');
262-
263-
}//end addSearchPath()
259+
}
264260

265261

266262
/**
@@ -271,8 +267,7 @@ public static function addSearchPath(string $path, string $nsPrefix = '')
271267
public static function getSearchPaths()
272268
{
273269
return self::$searchPaths;
274-
275-
}//end getSearchPaths()
270+
}
276271

277272

278273
/**
@@ -290,8 +285,7 @@ public static function getLoadedClassName(string $path)
290285
}
291286

292287
return self::$loadedClasses[$path];
293-
294-
}//end getLoadedClassName()
288+
}
295289

296290

297291
/**
@@ -309,8 +303,7 @@ public static function getLoadedFileName(string $className)
309303
}
310304

311305
return self::$loadedFiles[$className];
312-
313-
}//end getLoadedFileName()
306+
}
314307

315308

316309
/**
@@ -321,8 +314,7 @@ public static function getLoadedFileName(string $className)
321314
public static function getLoadedClasses()
322315
{
323316
return self::$loadedClasses;
324-
325-
}//end getLoadedClasses()
317+
}
326318

327319

328320
/**
@@ -333,11 +325,8 @@ public static function getLoadedClasses()
333325
public static function getLoadedFiles()
334326
{
335327
return self::$loadedFiles;
336-
337-
}//end getLoadedFiles()
338-
339-
340-
}//end class
328+
}
329+
}
341330

342331
// Register the autoloader before any existing autoloaders to ensure
343332
// it gets a chance to hear about every autoload request, and record

phpcs.xml.dist

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<!-- Include some sniffs from other standards that don't conflict with PEAR -->
3838
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
3939
<rule ref="Squiz.Arrays.ArrayDeclaration"/>
40-
<rule ref="Squiz.Commenting.ClosingDeclarationComment"/>
40+
<rule ref="PSR12.Classes.ClosingBrace"/>
4141
<rule ref="Squiz.ControlStructures.ControlSignature"/>
4242
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
4343
<rule ref="Squiz.Commenting.BlockComment"/>
@@ -64,8 +64,15 @@
6464
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired"/>
6565
<rule ref="Generic.Strings.UnnecessaryHeredoc"/>
6666
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>
67-
<rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/>
68-
<rule ref="Squiz.WhiteSpace.FunctionSpacing"/>
67+
<rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace">
68+
<exclude name="Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose"/>
69+
</rule>
70+
<rule ref="PSR2.Methods.FunctionClosingBrace"/>
71+
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
72+
<properties>
73+
<property name="spacingAfterLast" value="0"/>
74+
</properties>
75+
</rule>
6976
<rule ref="Squiz.WhiteSpace.MemberVarSpacing"/>
7077
<rule ref="PSR12.Operators.OperatorSpacing"/>
7178
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>

requirements.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,4 @@ function checkRequirements()
6969
fwrite(STDERR, sprintf($error, $required, $missing));
7070
exit($exitCode);
7171
}
72-
73-
}//end checkRequirements()
72+
}

scripts/BuildRequirementsCheckMatrix.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public function getBuilds()
7171
);
7272

7373
return $builds;
74-
75-
}//end getBuilds()
74+
}
7675

7776

7877
/**
@@ -105,8 +104,7 @@ private function getValidBuilds()
105104
}
106105

107106
return $builds;
108-
109-
}//end getValidBuilds()
107+
}
110108

111109

112110
/**
@@ -137,8 +135,7 @@ private function getInvalidPHPBuilds()
137135
}
138136

139137
return $builds;
140-
141-
}//end getInvalidPHPBuilds()
138+
}
142139

143140

144141
/**
@@ -181,8 +178,5 @@ private function getMissingExtensionsBuilds()
181178
}//end foreach
182179

183180
return $builds;
184-
185-
}//end getMissingExtensionsBuilds()
186-
187-
188-
}//end class
181+
}
182+
}

scripts/build-phar.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ function stripWhitespaceAndComments(string $fullpath, Config $config)
7575
}
7676

7777
return $stripped;
78-
79-
}//end stripWhitespaceAndComments()
78+
}
8079

8180

8281
Timing::startTiming();

0 commit comments

Comments
 (0)