Skip to content

Commit 27b6a00

Browse files
author
Marc Paffen
committed
Update Sniff auf neue Struktur
1 parent 045b779 commit 27b6a00

File tree

4 files changed

+97
-16
lines changed

4 files changed

+97
-16
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

HDNETBlack/Sniffs/Whitespace/ObjectOperatorSpacingSniff.php

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
<?php
2-
class HDNETBlack_Sniffs_WhiteSpace_ObjectOperatorSpacingSniff implements PHP_CodeSniffer_Sniff
1+
<?php
2+
3+
namespace HDNET\CodingStandards\HDNETBlack\Sniffs\Whitespace;
4+
5+
use PHP_CodeSniffer\Files\File;
6+
use PHP_CodeSniffer\Sniffs\Sniff;
7+
8+
class ObjectOperatorSpacingSniff implements Sniff
39
{
410

511
/**
6-
* Returns an array of tokens this test wants to listen for.
7-
*
8-
* @return array
12+
* {@inheritdoc}
913
*/
1014
public function register()
1115
{
12-
return array(T_OBJECT_OPERATOR);
16+
return [T_OBJECT_OPERATOR];
1317
}
1418

1519
/**
16-
* Processes this test, when one of its tokens is encountered.
17-
*
18-
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
19-
* @param int $stackPtr The position of the current token
20-
* in the stack passed in $tokens.
21-
*
22-
* @return void
20+
* {@inheritdoc}
2321
*/
24-
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
22+
public function process(File $phpcsFile, $stackPtr)
2523
{
2624
$tokens = $phpcsFile->getTokens();
2725
if ($tokens[($stackPtr - 1)]['code'] !== T_WHITESPACE) {
@@ -62,7 +60,6 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
6260
$phpcsFile->fixer->replaceToken(($stackPtr + 1), '');
6361
}
6462
}
65-
6663
}
6764

68-
}
65+
}

composer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "hdnet/coding-standards",
3+
"type": "phpcodesniffer-standard",
4+
"description": "CodeSniffer ruleset for HDNET Team Black",
5+
"homepage": "https://github.com/hdnet/coding-standards",
6+
"require-dev": {
7+
"squizlabs/php_codesniffer": "3.*"
8+
},
9+
"autoload": {
10+
"psr-4": {
11+
"HDNET\\CodingStandards\\HDNETBlack\\": "HDNETBlack"
12+
}
13+
}
14+
}

composer.lock

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)