Skip to content

Commit c431219

Browse files
committed
Renamed whole namespace
BC break. My bad. Sorry.
1 parent 39d2919 commit c431219

20 files changed

+89
-89
lines changed

Inpsyde/Helpers.php renamed to Inpsyde/PhpcsHelpers.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* released under MIT license.
1414
*/
1515

16-
namespace Inpsyde\InpsydeCodingStandard;
16+
namespace Inpsyde;
1717

1818
use PHP_CodeSniffer\Exceptions\RuntimeException as CodeSnifferRuntimeException;
1919
use PHP_CodeSniffer\Files\File;
@@ -23,7 +23,7 @@
2323
* @package php-coding-standards
2424
* @license http://opensource.org/licenses/MIT MIT
2525
*/
26-
class Helpers
26+
class PhpcsHelpers
2727
{
2828
const CODE_TO_TYPE_MAP = [
2929
T_CONST => 'Constant',
@@ -452,8 +452,8 @@ public static function countReturns(File $file, int $functionPosition): array
452452
}
453453

454454
if (!$scopeClosers->count() && $tokens[$i]['code'] === T_RETURN) {
455-
Helpers::isVoidReturn($file, $i) ? $voidReturnCount++ : $nonVoidReturnCount++;
456-
Helpers::isNullReturn($file, $i) and $nullReturnCount++;
455+
PhpcsHelpers::isVoidReturn($file, $i) ? $voidReturnCount++ : $nonVoidReturnCount++;
456+
PhpcsHelpers::isNullReturn($file, $i) and $nullReturnCount++;
457457
}
458458
}
459459

Inpsyde/Sniffs/CodeQuality/ArgumentTypeDeclarationSniff.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* released under MIT license.
1414
*/
1515

16-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
16+
namespace Inpsyde\Sniffs\CodeQuality;
1717

18-
use Inpsyde\InpsydeCodingStandard\Helpers;
18+
use Inpsyde\PhpcsHelpers;
1919
use PHP_CodeSniffer\Sniffs\Sniff;
2020
use PHP_CodeSniffer\Files\File;
2121

@@ -41,9 +41,9 @@ public function register()
4141
*/
4242
public function process(File $file, $position)
4343
{
44-
if (Helpers::functionIsArrayAccess($file, $position)
45-
|| Helpers::isHookClosure($file, $position)
46-
|| Helpers::isHookFunction($file, $position)
44+
if (PhpcsHelpers::functionIsArrayAccess($file, $position)
45+
|| PhpcsHelpers::isHookClosure($file, $position)
46+
|| PhpcsHelpers::isHookFunction($file, $position)
4747
) {
4848
return;
4949
}
@@ -57,7 +57,7 @@ public function process(File $file, $position)
5757
return;
5858
}
5959

60-
$variables = Helpers::filterTokensByType($paramsStart, $paramsEnd, $file, T_VARIABLE);
60+
$variables = PhpcsHelpers::filterTokensByType($paramsStart, $paramsEnd, $file, T_VARIABLE);
6161

6262
foreach (array_keys($variables) as $varPosition) {
6363
$typePosition = $file->findPrevious(

Inpsyde/Sniffs/CodeQuality/AssignmentInsideConditionSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
11+
namespace Inpsyde\Sniffs\CodeQuality;
1212

13-
use Inpsyde\InpsydeCodingStandard\Helpers;
13+
use Inpsyde\PhpcsHelpers;
1414
use PHP_CodeSniffer\Files\File;
1515
use PHP_CodeSniffer\Sniffs\Sniff;
1616
use PHP_CodeSniffer\Util\Tokens;
@@ -78,7 +78,7 @@ private function findAssignmentPositions(
7878
File $file
7979
): array {
8080

81-
$assignmentTokens = Helpers::filterTokensByType(
81+
$assignmentTokens = PhpcsHelpers::filterTokensByType(
8282
$ifOpenerPosition + 1,
8383
$ifCloserPosition - 1,
8484
$file,
@@ -123,7 +123,7 @@ private function isAssignmentWrapped(
123123
return false;
124124
}
125125

126-
$parenthesisInBetween = Helpers::filterTokensByType(
126+
$parenthesisInBetween = PhpcsHelpers::filterTokensByType(
127127
$insideIfOpenParenthesisPosition + 1,
128128
$insideIfCloserParenthesisPosition - 1,
129129
$file,

Inpsyde/Sniffs/CodeQuality/DisallowShortOpenTagSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
11+
namespace Inpsyde\Sniffs\CodeQuality;
1212

1313
use PHP_CodeSniffer\Standards\Generic\Sniffs\PHP as Generic;
1414

Inpsyde/Sniffs/CodeQuality/ElementNameMinimalLengthSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* released under MIT license.
1414
*/
1515

16-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
16+
namespace Inpsyde\Sniffs\CodeQuality;
1717

18-
use Inpsyde\InpsydeCodingStandard\Helpers;
18+
use Inpsyde\PhpcsHelpers;
1919
use PHP_CodeSniffer\Files\File;
2020
use PHP_CodeSniffer\Sniffs\Sniff;
2121

@@ -60,14 +60,14 @@ public function register()
6060
*/
6161
public function process(File $file, $position)
6262
{
63-
$elementName = Helpers::tokenName($file, $position);
63+
$elementName = PhpcsHelpers::tokenName($file, $position);
6464
$elementNameLength = mb_strlen($elementName);
6565

6666
if ($this->shouldBeSkipped($elementNameLength, $elementName)) {
6767
return;
6868
}
6969

70-
$typeName = Helpers::tokenTypeName($file, $position);
70+
$typeName = PhpcsHelpers::tokenTypeName($file, $position);
7171
$message = sprintf(
7272
'%s name "%s" is only %d chars long. Must be at least %d.',
7373
$typeName,

Inpsyde/Sniffs/CodeQuality/ForbiddenPublicPropertySniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* released under MIT license.
1414
*/
1515

16-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
16+
namespace Inpsyde\Sniffs\CodeQuality;
1717

18-
use Inpsyde\InpsydeCodingStandard\Helpers;
18+
use Inpsyde\PhpcsHelpers;
1919
use PHP_CodeSniffer\Files\File;
2020
use PHP_CodeSniffer\Sniffs\Sniff;
2121
use PHP_CodeSniffer\Util\Tokens;
@@ -40,7 +40,7 @@ public function register()
4040
*/
4141
public function process(File $file, $position)
4242
{
43-
if (!Helpers::variableIsProperty($file, $position)) {
43+
if (!PhpcsHelpers::variableIsProperty($file, $position)) {
4444
return;
4545
}
4646

Inpsyde/Sniffs/CodeQuality/FunctionLengthSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* released under MIT license.
1414
*/
1515

16-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
16+
namespace Inpsyde\Sniffs\CodeQuality;
1717

1818
use PHP_CodeSniffer\Files\File;
1919
use PHP_CodeSniffer\Sniffs\Sniff;

Inpsyde/Sniffs/CodeQuality/HookClosureReturnSniff.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
* file that was distributed with this source code.
99
*/
1010

11-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
11+
namespace Inpsyde\Sniffs\CodeQuality;
1212

13-
use Inpsyde\InpsydeCodingStandard\Helpers;
13+
use Inpsyde\PhpcsHelpers;
1414
use PHP_CodeSniffer\Sniffs\Sniff;
1515
use PHP_CodeSniffer\Files\File;
1616

@@ -29,18 +29,18 @@ public function register()
2929
*/
3030
public function process(File $file, $position)
3131
{
32-
if (!Helpers::isHookClosure($file, $position)) {
32+
if (!PhpcsHelpers::isHookClosure($file, $position)) {
3333
return;
3434
}
3535

36-
list($functionStart, $functionEnd) = Helpers::functionBoundaries($file, $position);
36+
list($functionStart, $functionEnd) = PhpcsHelpers::functionBoundaries($file, $position);
3737
if (!$functionStart < 0 || $functionEnd <= 0) {
3838
return;
3939
}
4040

41-
list($nonVoidReturnCount, $voidReturnCount) = Helpers::countReturns($file, $position);
41+
list($nonVoidReturnCount, $voidReturnCount) = PhpcsHelpers::countReturns($file, $position);
4242

43-
$isFilterClosure = Helpers::isHookClosure($file, $position, true, false);
43+
$isFilterClosure = PhpcsHelpers::isHookClosure($file, $position, true, false);
4444

4545
if ($isFilterClosure && (!$nonVoidReturnCount || $voidReturnCount)) {
4646
$file->addError(

Inpsyde/Sniffs/CodeQuality/LineLengthSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* released under BSD license.
1414
*/
1515

16-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
16+
namespace Inpsyde\Sniffs\CodeQuality;
1717

1818
use PHP_CodeSniffer\Sniffs\Sniff;
1919
use PHP_CodeSniffer\Files\File;
@@ -22,7 +22,7 @@
2222
* Modified version of the `LineLengthSniff` from "Generic" standard that
2323
* ignores long lines when they contain string
2424
*
25-
* @package Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality
25+
* @package Inpsyde\Sniffs\CodeQuality
2626
*/
2727
class LineLengthSniff implements Sniff
2828
{

Inpsyde/Sniffs/CodeQuality/NoAccessorsSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
* released under MIT license.
1414
*/
1515

16-
namespace Inpsyde\InpsydeCodingStandard\Sniffs\CodeQuality;
16+
namespace Inpsyde\Sniffs\CodeQuality;
1717

18-
use Inpsyde\InpsydeCodingStandard\Helpers;
18+
use Inpsyde\PhpcsHelpers;
1919
use PHP_CodeSniffer\Files\File;
2020
use PHP_CodeSniffer\Sniffs\Sniff;
2121

@@ -49,7 +49,7 @@ public function register()
4949
*/
5050
public function process(File $file, $position)
5151
{
52-
if ($this->skipForFunctions && !Helpers::functionIsMethod($file, $position)) {
52+
if ($this->skipForFunctions && !PhpcsHelpers::functionIsMethod($file, $position)) {
5353
return;
5454
}
5555

0 commit comments

Comments
 (0)