Skip to content

Commit ceb6734

Browse files
committed
Cleanup
1 parent 9ea17c8 commit ceb6734

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ In your PHP CS Fixer configuration register fixers and use them:
3131

3232

3333
## Fixers
34-
- **ImplodeCallFixer** - function `implode` must be called with 2 arguments in the documented order. DEPRECATED: use `implode_call` instead.
35-
34+
- **ImplodeCallFixer** - function `implode` must be called with 2 arguments in the documented order.
35+
DEPRECATED: use `implode_call` instead.
3636
*Risky: when the function `implode` is overridden.*
3737
```diff
3838
<?php
@@ -83,8 +83,7 @@ In your PHP CS Fixer configuration register fixers and use them:
8383
$y = new \Baz();
8484
```
8585

86-
- **NoNullableBooleanTypeFixer** - there must be no nullable boolean type.
87-
86+
- **NoNullableBooleanTypeFixer** - there must be no nullable boolean type.
8887
*Risky: when the null is used.*
8988
```diff
9089
<?php
@@ -107,16 +106,16 @@ In your PHP CS Fixer configuration register fixers and use them:
107106
namespace Foo;
108107
```
109108

110-
- **NoReferenceInFunctionDefinitionFixer** - there must be no reference in function definition.
111-
109+
- **NoReferenceInFunctionDefinitionFixer** - there must be no reference in function definition.
112110
*Risky: when rely on reference.*
113111
```diff
114112
<?php
115113
-function foo(&$x) {}
116114
+function foo($x) {}
117115
```
118116

119-
- **NoTwoConsecutiveEmptyLinesFixer** - there must be no two consecutive empty lines in code. DEPRECATED: use `no_extra_blank_lines` instead.
117+
- **NoTwoConsecutiveEmptyLinesFixer** - there must be no two consecutive empty lines in code.
118+
DEPRECATED: use `no_extra_blank_lines` instead.
120119
```diff
121120
<?php
122121
namespace Foo;
@@ -127,8 +126,9 @@ In your PHP CS Fixer configuration register fixers and use them:
127126

128127
- **NoUnneededConcatenationFixer** - there should not be inline concatenation of strings.
129128
```diff
130-
-<?php 'foo' . 'bar';
131-
+<?php 'foobar';
129+
<?php
130+
-echo 'foo' . 'bar';
131+
+echo 'foobar';
132132
```
133133

134134
- **NoUselessClassCommentFixer** - there must be no comment like: "Class FooBar".

src/Fixer/NoUnneededConcatenationFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function getDefinition(): FixerDefinition
1515
{
1616
return new FixerDefinition(
1717
'There should not be inline concatenation of strings.',
18-
[new CodeSample("<?php 'foo' . 'bar';\n")]
18+
[new CodeSample("<?php\necho 'foo' . 'bar';\n")]
1919
);
2020
}
2121

src/Readme/ReadmeCommand.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,14 @@ private function fixers(): string
129129

130130
if ($fixer instanceof DeprecatedFixerInterface) {
131131
$output .= \sprintf(
132-
' DEPRECATED: use `%s` instead.',
132+
" \n DEPRECATED: use `%s` instead.",
133133
\implode('`, `', $fixer->getSuccessorsNames())
134134
);
135135
}
136136

137-
$output .= "\n";
138-
139137
if ($fixer->isRisky()) {
140138
$output .= \sprintf(
141-
"\n *Risky: %s*\n",
139+
" \n *Risky: %s*",
142140
\lcfirst($fixer->getDefinition()->getRiskyDescription())
143141
);
144142
}
@@ -150,7 +148,7 @@ private function fixers(): string
150148
$fixedCode = $tokens->generateCode();
151149

152150
$output .= \sprintf(
153-
"```diff\n%s\n```\n",
151+
"\n```diff\n%s\n```\n",
154152
$this->diff($originalCode, $fixedCode)
155153
);
156154
}

tests/Fixer/NoImportFromGlobalNamespaceFixerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function __construct() {
147147
'<?php
148148
namespace Foo;
149149
class Bar {
150-
/**
150+
/**
151151
* @param \DateTime $a
152152
* @param \DateTime $b
153153
* @param NotDateTime $c
@@ -165,7 +165,7 @@ public function __construct($a, $b, $c, $d, $e, $f, $g, $h, $i) {}
165165
namespace Foo;
166166
use DateTime;
167167
class Bar {
168-
/**
168+
/**
169169
* @param DateTime $a
170170
* @param \DateTime $b
171171
* @param NotDateTime $c

tests/Fixer/NoUnneededConcatenationFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function provideFixCases(): \Iterator
4141
yield ['<?php "foo".\'bar\';'];
4242
yield ['<?php "foo" . \'bar\';'];
4343
yield ['<?php \'bar\' . "foo";'];
44-
yield ['<?php "foo"
44+
yield ['<?php "foo"
4545
. "bar";'];
4646
yield ['<?php "foo" .
4747
"bar";'];

tests/Fixer/PhpdocSelfAccessorFixerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Foo {
4141
* @var FooBar
4242
*/
4343
private $instance;
44-
44+
4545
/**
4646
* @param Foo\Bar $x
4747
* @param Bar\Foo $x
@@ -59,7 +59,7 @@ class Foo {
5959
* @var self
6060
*/
6161
private $instance;
62-
62+
6363
/**
6464
* @param self $x
6565
* @param self $x
@@ -82,7 +82,7 @@ class Foo {
8282
* @var Foo
8383
*/
8484
private $instance;
85-
85+
8686
/**
8787
* @param Foo $x
8888
* @param \Foo $x

0 commit comments

Comments
 (0)