-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #94 - added blank line fixer * #94 - fixes * #94 - add more cases for fixer * #94 - added one more case for test
- Loading branch information
1 parent
f858620
commit 0018785
Showing
11 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/codestyle/fixtures/blankLineBeforeStatement/actual.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
class BlankLine | ||
{ | ||
/** | ||
* @throws Exception | ||
*/ | ||
public function getFoo(int $foo): int | ||
{ | ||
$bar = $foo; | ||
try { | ||
|
||
while ($bar > 0) { | ||
$bar++; | ||
} | ||
for ($i = 0; $i < 5; $i++) { | ||
echo $i; | ||
} | ||
} catch (Exception $exception) { | ||
$value = "error"; | ||
throw new Exception(message: $value); | ||
} | ||
return $bar; | ||
} | ||
|
||
protected function getBar(int $number): void | ||
{ | ||
if ($number === 1) { | ||
return; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
tests/codestyle/fixtures/blankLineBeforeStatement/expected.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
class BlankLine | ||
{ | ||
/** | ||
* @throws Exception | ||
*/ | ||
public function getFoo(int $foo): int | ||
{ | ||
$bar = $foo; | ||
|
||
try { | ||
while ($bar > 0) { | ||
$bar++; | ||
} | ||
|
||
for ($i = 0; $i < 5; $i++) { | ||
echo $i; | ||
} | ||
} catch (Exception $exception) { | ||
$value = "error"; | ||
|
||
throw new Exception(message: $value); | ||
} | ||
|
||
return $bar; | ||
} | ||
|
||
protected function getBar(int $number): void | ||
{ | ||
if ($number === 1) { | ||
return; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters