Skip to content

Commit

Permalink
Remove usage of phpcsstandards packages
Browse files Browse the repository at this point in the history
This reverts commit e6b5a86.

Signed-off-by: Matthew Peveler <[email protected]>
  • Loading branch information
MasterOdin committed Mar 12, 2021
1 parent aa41798 commit af4a20c
Show file tree
Hide file tree
Showing 8 changed files with 411 additions and 342 deletions.
21 changes: 0 additions & 21 deletions SubmittyStandard/Sniffs/ControlStructures/DoWhileSniff.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,31 @@

namespace SubmittyStandard\Sniffs\ControlStructures;

use PHPCSExtra\Universal\Sniffs\ControlStructures\IfElseDeclarationSniff;
use PHP_CodeSniffer\Sniffs\AbstractPatternSniff;

class StroustrupStructureSniff extends IfElseDeclarationSniff {
public function register() {
class StroustrupStructureSniff extends AbstractPatternSniff {
// phpcs:disable SubmittyStandard.NamingConventions.ValidVariableName.MemberNotSnakeCase
/**
* If true, comments will be ignored if they are found in the code.
*
* @var boolean
*/
public $ignoreComments = true;
// phpcs: enable

protected function getPatterns() {
return [
\T_ELSE,
\T_ELSEIF,
\T_CATCH
'do {EOL...} while (...);EOL',
'while (...) {EOL',
'for (...) {EOL',
'if (...) {EOL',
'foreach (...) {EOL',
'}EOLelse if (...) {EOL',
'}EOLelseif (...) {EOL',
'}EOLelse {EOL',
'do {EOL',
'try {EOL',
'}EOLcatch (...) {EOL'
];
}
}
9 changes: 0 additions & 9 deletions SubmittyStandard/Tests/ControlStructures/DoWhileUnitTest.inc

This file was deleted.

18 changes: 0 additions & 18 deletions SubmittyStandard/Tests/ControlStructures/DoWhileUnitTest.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ elseif (false) {
else {
}

do {
} while (true);

// do-while is special
do {
}
while(true);

try {
} catch ($exc) {
}
Expand All @@ -26,3 +34,10 @@ try
{
} catch (exc) {
}

try
{
}
catch (exc)
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ public function getErrorList() {
4 => 1,
5 => 1,
6 => 1,
17 => 1,
27 => 1
20 => 1,
25 => 1,
33 => 1,
35 => 1,
38 => 1,
41 => 1
];
}

Expand Down
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"require": {
"php": ">=7.1",
"squizlabs/php_codesniffer": "^3.5.4",
"slevomat/coding-standard": "^6.1",
"phpcsstandards/phpcsutils": "dev-develop",
"phpcsstandards/phpcsextra": "dev-develop"
"slevomat/coding-standard": "^6.1"
},
"config": {
"platform": {
Expand All @@ -18,10 +16,10 @@
"require-dev": {
"pcov/clobber": "^2.0",
"phpunit/phpunit": "^7.5.12",
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2"
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1"
},
"suggest": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically."
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit af4a20c

Please sign in to comment.