Skip to content

Commit e6e2f6d

Browse files
binarykactions-user
authored andcommitted
Fix styling
1 parent de8621c commit e6e2f6d

14 files changed

+30
-30
lines changed

.php-cs-fixer.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"php":"8.0.11","version":"3.2.1","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Commands\/PruneCommand.php":1473367127,"src\/Telescope\/TelescopeException.php":1871046959,"src\/Telescope\/TelescopeDev.php":2309110818,"src\/LaravelDeveloper.php":1129170780,"src\/Dtos\/DevLogDto.php":1643551788,"src\/Dtos\/DevNotificationDto.php":412948095,"src\/Notifications\/DevNotification.php":2947327537,"src\/Notifications\/Slack.php":3934215647,"src\/Middleware\/DevSanctumAuthMiddleware.php":964085018,"src\/Middleware\/DevAuthMiddleware.php":1511410281,"src\/Models\/DeveloperLog.php":4104297917,"src\/Models\/Concerns\/WithUuid.php":1102884493,"src\/Models\/Concerns\/WithCreator.php":2183877251,"src\/Models\/Concerns\/InteractsWithDeveloper.php":1790705050,"src\/LaravelDeveloperServiceProvider.php":1956646152,"src\/Profiling\/ServerMemory.php":1460695193,"src\/Profiling\/ServerTiming.php":4274056244,"src\/helpers.php":715232250,"src\/Concerns\/Proxies.php":524787727,"src\/Concerns\/ClassResolver.php":1880027722,"src\/LaravelDeveloperFacade.php":3477645298,"src\/Nova\/DeveloperLogResource.php":9639465,"src\/Nova\/Fields\/Line.php":2270391664,"src\/Nova\/Fields\/CreatedAt.php":2148384209,"src\/Nova\/Fields\/Badge.php":1570922008,"src\/Nova\/Fields\/ExpirationDateBadge.php":4282897254,"src\/Nova\/Fields\/BelongsTo.php":1822753998,"src\/Nova\/Fields\/BadgeList.php":3076744754,"src\/Nova\/Fields\/DangerBadge.php":3216791755,"src\/Nova\/Filters\/EndingAtFilter.php":2850496008,"src\/Nova\/Filters\/HasResultsFilter.php":4116547610,"src\/Nova\/Filters\/FromDateFilter.php":1053058278,"src\/Nova\/Filters\/ToDateFilter.php":581993863,"src\/Nova\/Filters\/CreatedAtFilter.php":778019993,"src\/Nova\/Filters\/TagFilter.php":1978666758,"tests\/TestCase.php":3638931094,"tests\/Fixtures\/DummyNotification.php":3913031193,"tests\/Fixtures\/User.php":353028011,"tests\/Notifications\/DevNotificationTest.php":3587569263,"tests\/Middleware\/DevAuthMiddlewareTest.php":1606798965,"tests\/Middleware\/DevSanctumAuthMiddlewareTest.php":3421724279,"tests\/ExampleTest.php":1575370042,"tests\/Helpers\/SlackHelperTest.php":1334877550,"tests\/Helpers\/DevLogHelperTest.php":585022422,"tests\/Models\/ExceptionLogTest.php":2235509697,"tests\/Models\/LaravelDeveloperTest.php":1546634681,"tests\/Console\/PruneCommandTest.php":4199024702,"tests\/Mock\/CustomNotificationMock.php":2052176798,"tests\/Mock\/PayloadMock.php":1887690153,"tests\/Profiling\/ServerTimingTest.php":1295567184,"tests\/Profiling\/ServerMemoryTest.php":4137425435,"tests\/Mock.php":3663171411}}

src/Dtos/DevNotificationDto.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function getAttachmentContent(): ?string
5757

5858
public static function makeWithMessage(string $message): self
5959
{
60-
return tap(new static, fn (self $dto) => $dto->setMessage($message));
60+
return tap(new static(), fn (self $dto) => $dto->setMessage($message));
6161
}
6262

6363
public static function makeFromException(Throwable $t): self
@@ -83,7 +83,7 @@ public function setMessage(string $message): self
8383

8484
public static function makeFromExceptionLog(DeveloperLog $log): self
8585
{
86-
return tap(new static, fn (self $dto) => $dto
86+
return tap(new static(), fn (self $dto) => $dto
8787
->setMessage($log->name)
8888
->setTitle($log->identifier)
8989
->setLine($log->line)

src/Models/DeveloperLog.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Binarcode\LaravelDeveloper\Models;
44

5+
use Binarcode\LaravelDeveloper\Dtos\DevLogDto;
56
use Binarcode\LaravelDeveloper\LaravelDeveloper;
67
use Binarcode\LaravelDeveloper\Models\Concerns\WithCreator;
78
use Binarcode\LaravelDeveloper\Models\Concerns\WithUuid;
8-
use Binarcode\LaravelDeveloper\Dtos\DevLogDto;
99
use DateTimeInterface;
1010
use Illuminate\Database\Eloquent\Factories\HasFactory;
1111
use Illuminate\Database\Eloquent\Model;
@@ -120,7 +120,9 @@ public function getUrl(): ?string
120120
}
121121

122122
return Str::replaceArray(
123-
'{id}', ['{id}' => $this->id,], config('developer.developer_log_base_url')
123+
'{id}',
124+
['{id}' => $this->id,],
125+
config('developer.developer_log_base_url')
124126
);
125127
}
126128

src/Notifications/Slack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ private function send($item)
6464
*/
6565
$class = config('developer.notification', DevNotification::class);
6666

67-
$dto = new DevNotificationDto;
67+
$dto = new DevNotificationDto();
6868

6969
if ($item instanceof Throwable) {
7070
if ($this->persist) {
7171
$dto = DevNotificationDto::makeFromExceptionLog(
72-
tap(DeveloperLog::makeFromException($item), fn(DeveloperLog $log) => $log->save())
72+
tap(DeveloperLog::makeFromException($item), fn (DeveloperLog $log) => $log->save())
7373
);
7474

7575
if ($this->telescope && TelescopeDev::allow()) {

src/Nova/DeveloperLogResource.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Binarcode\LaravelDeveloper\Nova;
44

5-
use App\Domains\Developer\Models\ExceptionLog;
65
use Binarcode\LaravelDeveloper\Models\DeveloperLog;
76
use Binarcode\LaravelDeveloper\Nova\Fields\Badge;
87
use Binarcode\LaravelDeveloper\Nova\Fields\Line;
@@ -50,7 +49,7 @@ public function fields(Request $request)
5049
: '';
5150
}),
5251

53-
Text::make('Name')->displayUsing(fn($name) => Str::substr($name, 0, 50)),
52+
Text::make('Name')->displayUsing(fn ($name) => Str::substr($name, 0, 50)),
5453

5554
Text::make('File')->hideFromIndex(),
5655

src/Nova/Fields/Line.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Line extends \Laravel\Nova\Fields\Line
66
{
7-
const MEDIUM = 'medium';
7+
public const MEDIUM = 'medium';
88

99
public static $classes = [
1010
self::HEADING => 'text-base font-semibold',

src/Telescope/TelescopeDev.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ class TelescopeDev
66
{
77
public static function allow(): bool
88
{
9-
if (!class_exists('Laravel\\Telescope\\Telescope')) {
9+
if (! class_exists('Laravel\\Telescope\\Telescope')) {
1010
logger('Telescope is not installed.');
11+
1112
return false;
1213
}
1314

tests/Fixtures/DummyNotification.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
namespace Binarcode\LaravelDeveloper\Tests\Fixtures;
44

5-
use App\Domains\Discounts\Models\DiscountUses;
6-
use App\Domains\Items\Models\Item;
7-
use App\Domains\Orders\Models\Order;
85
use Illuminate\Bus\Queueable;
96
use Illuminate\Contracts\Queue\ShouldQueue;
107
use Illuminate\Notifications\Messages\SlackMessage;
@@ -14,7 +11,6 @@ class DummyNotification extends Notification implements ShouldQueue
1411
{
1512
use Queueable;
1613

17-
1814
public function via($notifiable)
1915
{
2016
return ['slack'];

tests/Helpers/DevLogHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Binarcode\LaravelDeveloper\Tests\Helpers;
44

5-
use Binarcode\LaravelDeveloper\Models\DeveloperLog;
65
use Binarcode\LaravelDeveloper\Dtos\DevLogDto;
6+
use Binarcode\LaravelDeveloper\Models\DeveloperLog;
77
use Binarcode\LaravelDeveloper\Tests\TestCase;
88

99
class DevLogHelperTest extends TestCase

tests/Helpers/SlackHelperTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Exception;
1111
use Illuminate\Notifications\AnonymousNotifiable;
1212
use Illuminate\Support\Facades\Notification;
13-
use Illuminate\Notifications\Notification as NotificationBase;
1413

1514
class SlackHelperTest extends TestCase
1615
{
@@ -29,7 +28,7 @@ public function test_slack_helper_can_send_message_to_slack()
2928

3029
$this->assertInstanceOf(Slack::class, slack('message'));
3130

32-
Notification::assertSentTo(new AnonymousNotifiable, DevNotification::class);
31+
Notification::assertSentTo(new AnonymousNotifiable(), DevNotification::class);
3332
}
3433

3534
public function test_slack_helper_can_send_throwable_to_slack()
@@ -50,10 +49,13 @@ public function test_slack_helper_can_send_throwable_to_slack()
5049

5150
$uuid = DeveloperLog::latest()->first()->id;
5251

53-
Notification::assertSentTo(new AnonymousNotifiable, DevNotification::class,
52+
Notification::assertSentTo(
53+
new AnonymousNotifiable(),
54+
DevNotification::class,
5455
function (DevNotification $class) use ($uuid) {
5556
return $class->notificationDto->attachment_link === "app.test/{$uuid}";
56-
});
57+
}
58+
);
5759
}
5860

5961
public function test_slack_helper_can_send_notifications_to_slack()
@@ -69,6 +71,6 @@ public function test_slack_helper_can_send_notifications_to_slack()
6971
new DummyNotification()
7072
)->persist());
7173

72-
Notification::assertSentTo(new AnonymousNotifiable, DummyNotification::class);
74+
Notification::assertSentTo(new AnonymousNotifiable(), DummyNotification::class);
7375
}
7476
}

tests/Middleware/DevAuthMiddlewareTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ class DevAuthMiddlewareTest extends TestCase
1313
{
1414
public function test_can_authenticate_using_testing()
1515
{
16-
$user = new User;
16+
$user = new User();
1717
DevAuthMiddleware::resolveUserUsing(fn () => $user);
1818

19-
$middleware = new DevAuthMiddleware;
19+
$middleware = new DevAuthMiddleware();
2020

2121
$request = tap(new Request(), function (Request $request) {
2222
/** * @var HeaderBag $bag */

tests/Middleware/DevSanctumAuthMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class DevSanctumAuthMiddlewareTest extends TestCase
1313
{
1414
public function test_can_authenticate_and_change_bearer_using_testing()
1515
{
16-
DevSanctumAuthMiddleware::resolveUserUsing(fn () => new User);
16+
DevSanctumAuthMiddleware::resolveUserUsing(fn () => new User());
1717

1818
$middleware = new DevSanctumAuthMiddleware();
1919

tests/Models/LaravelDeveloperTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function test_can_notify_any_exception()
3939
new Exception('wew')
4040
);
4141

42-
Notification::assertSentTo(new AnonymousNotifiable, DevNotification::class);
42+
Notification::assertSentTo(new AnonymousNotifiable(), DevNotification::class);
4343
}
4444

4545
public function test_can_notify_any_dto()
@@ -50,7 +50,7 @@ public function test_can_notify_any_dto()
5050
DevNotificationDto::makeWithMessage('hey')
5151
);
5252

53-
Notification::assertSentTo(new AnonymousNotifiable, DevNotification::class);
53+
Notification::assertSentTo(new AnonymousNotifiable(), DevNotification::class);
5454
}
5555

5656
public function test_can_notify_with_message()
@@ -59,6 +59,6 @@ public function test_can_notify_with_message()
5959

6060
LaravelDeveloper::messageToDevSlack('wew');
6161

62-
Notification::assertSentTo(new AnonymousNotifiable, DevNotification::class);
62+
Notification::assertSentTo(new AnonymousNotifiable(), DevNotification::class);
6363
}
6464
}

tests/Notifications/DevNotificationTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Binarcode\LaravelDeveloper\LaravelDeveloper;
66
use Binarcode\LaravelDeveloper\Models\DeveloperLog;
77
use Binarcode\LaravelDeveloper\Notifications\DevNotification;
8-
use Binarcode\LaravelDeveloper\Tests\Fixtures\User;
98
use Binarcode\LaravelDeveloper\Tests\Mock\CustomNotificationMock;
109
use Binarcode\LaravelDeveloper\Tests\Mock\PayloadMock;
1110
use Binarcode\LaravelDeveloper\Tests\TestCase;
@@ -25,7 +24,7 @@ public function test_can_notify_from_exception_log(): void
2524
$payload = new PayloadMock()
2625
)->notifyDevs();
2726

28-
Notification::assertSentTo(new AnonymousNotifiable, DevNotification::class);
27+
Notification::assertSentTo(new AnonymousNotifiable(), DevNotification::class);
2928
}
3029

3130
public function test_can_relate_target(): void
@@ -60,7 +59,7 @@ public function test_can_send_custom_notification(): void
6059
$payload = new PayloadMock()
6160
)->notifyDevs();
6261

63-
Notification::assertSentTo(new AnonymousNotifiable, CustomNotificationMock::class);
62+
Notification::assertSentTo(new AnonymousNotifiable(), CustomNotificationMock::class);
6463

6564
LaravelDeveloper::notifyUsing(null);
6665
}
@@ -78,6 +77,6 @@ public function test_can_set_custom_config_notification(): void
7877
$payload = new PayloadMock()
7978
)->notifyDevs();
8079

81-
Notification::assertSentTo(new AnonymousNotifiable, CustomNotificationMock::class);
80+
Notification::assertSentTo(new AnonymousNotifiable(), CustomNotificationMock::class);
8281
}
8382
}

0 commit comments

Comments
 (0)