Skip to content

Commit 2d5e953

Browse files
committed
fix - psr12
1 parent c296aa6 commit 2d5e953

5 files changed

Lines changed: 74 additions & 0 deletions

fmt.stub.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8025,6 +8025,7 @@ public function format($source)
80258025
$docBlocks = [];
80268026
$declares = [];
80278027
$namespaceBlock = '';
8028+
$sawTopFileSection = false;
80288029
$useBlocks = [
80298030
'class' => [],
80308031
'function' => [],
@@ -8045,12 +8046,18 @@ public function format($source)
80458046
}
80468047

80478048
if (T_COMMENT === $id) {
8049+
if ($sawTopFileSection) {
8050+
break;
8051+
}
80488052
$prefixComments[] = trim($text);
80498053
++$idx;
80508054
continue;
80518055
}
80528056

80538057
if (T_DOC_COMMENT === $id) {
8058+
if ($sawTopFileSection) {
8059+
break;
8060+
}
80548061
$docBlocks[] = trim($text);
80558062
++$idx;
80568063
continue;
@@ -8062,18 +8069,21 @@ public function format($source)
80628069
}
80638070
list($declareText, $idx) = $this->accumulateStatement($tokens, $idx);
80648071
$declares[] = trim($declareText);
8072+
$sawTopFileSection = true;
80658073
continue;
80668074
}
80678075

80688076
if (T_NAMESPACE === $id) {
80698077
list($namespaceBlock, $idx) = $this->accumulateStatement($tokens, $idx);
80708078
$namespaceBlock = trim($namespaceBlock);
8079+
$sawTopFileSection = true;
80718080
continue;
80728081
}
80738082

80748083
if (T_USE === $id) {
80758084
list($useText, $idx) = $this->accumulateStatement($tokens, $idx);
80768085
$useText = trim($useText);
8086+
$sawTopFileSection = true;
80778087
if (0 === stripos($useText, 'use function ')) {
80788088
$useBlocks['function'][] = $useText;
80798089
} elseif (0 === stripos($useText, 'use const ')) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
namespace App\DDD\Orders\Jobs;
3+
4+
use App\DDD\Cities\Models\City;
5+
use App\DDD\Devops\Models\WebhookResponse;
6+
7+
/**
8+
* @covered Unit/DDD/Orders/Jobs/OrderNotifyToWebhookJobTest.php
9+
*/
10+
class X {
11+
public function y(City $city, WebhookResponse $response) {
12+
return [$city, $response];
13+
}
14+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
namespace App\DDD\Orders\Jobs;
4+
5+
use App\DDD\Cities\Models\City;
6+
use App\DDD\Devops\Models\WebhookResponse;
7+
8+
/**
9+
* @covered Unit/DDD/Orders/Jobs/OrderNotifyToWebhookJobTest.php
10+
*/
11+
class X
12+
{
13+
public function y(City $city, WebhookResponse $response)
14+
{
15+
return [$city, $response];
16+
}
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
//passes:Default,SpaceAroundControlStructures,AddMissingParentheses,PSR12ControlStructureBlocks,PSR12TopFileFormat
3+
namespace App\DDD\Orders\Jobs;
4+
5+
use App\DDD\Cities\Models\City;
6+
use App\DDD\Devops\Models\WebhookResponse;
7+
8+
/**
9+
* @covered Unit/DDD/Orders/Jobs/OrderNotifyToWebhookJobTest.php
10+
*/
11+
class X {
12+
public function y(City $city, WebhookResponse $response) {
13+
return [$city, $response];
14+
}
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
//passes:Default,SpaceAroundControlStructures,AddMissingParentheses,PSR12ControlStructureBlocks,PSR12TopFileFormat
3+
4+
namespace App\DDD\Orders\Jobs;
5+
6+
use App\DDD\Cities\Models\City;
7+
use App\DDD\Devops\Models\WebhookResponse;
8+
9+
/**
10+
* @covered Unit/DDD/Orders/Jobs/OrderNotifyToWebhookJobTest.php
11+
*/
12+
class X
13+
{
14+
public function y(City $city, WebhookResponse $response)
15+
{
16+
return [$city, $response];
17+
}
18+
}

0 commit comments

Comments
 (0)