diff --git a/app/Concerns/ProvidesSubscriptions.php b/app/Concerns/ProvidesSubscriptions.php index 334726d91..52cbe2046 100644 --- a/app/Concerns/ProvidesSubscriptions.php +++ b/app/Concerns/ProvidesSubscriptions.php @@ -40,7 +40,7 @@ public function hasSubscriber(User $user): bool public function subscribe(User $user): Subscription { - $subscription = new Subscription(); + $subscription = new Subscription; $subscription->uuid = Uuid::uuid4()->toString(); $subscription->userRelation()->associate($user); $subscription->subscriptionAbleRelation()->associate($this); diff --git a/app/Http/Requests/ArticleRequest.php b/app/Http/Requests/ArticleRequest.php index e4010c23c..9465f3fba 100644 --- a/app/Http/Requests/ArticleRequest.php +++ b/app/Http/Requests/ArticleRequest.php @@ -14,7 +14,7 @@ public function rules(): array { return [ 'title' => ['required', 'max:100'], - 'body' => ['required', new HttpImageRule()], + 'body' => ['required', new HttpImageRule], 'tags' => 'array|nullable', 'tags.*' => 'exists:tags,id', 'original_url' => 'url|nullable', diff --git a/app/Http/Requests/CreateReplyRequest.php b/app/Http/Requests/CreateReplyRequest.php index 0c3328909..f2292da03 100644 --- a/app/Http/Requests/CreateReplyRequest.php +++ b/app/Http/Requests/CreateReplyRequest.php @@ -13,7 +13,7 @@ class CreateReplyRequest extends Request public function rules(): array { return [ - 'body' => ['required', new HttpImageRule(), new InvalidMentionRule()], + 'body' => ['required', new HttpImageRule, new InvalidMentionRule], 'replyable_id' => 'required', 'replyable_type' => 'required|in:'.Thread::TABLE, ]; diff --git a/app/Http/Requests/ThreadRequest.php b/app/Http/Requests/ThreadRequest.php index 380c38646..8ce9eb409 100644 --- a/app/Http/Requests/ThreadRequest.php +++ b/app/Http/Requests/ThreadRequest.php @@ -11,8 +11,8 @@ class ThreadRequest extends Request public function rules(): array { return [ - 'subject' => ['required', 'max:60', new DoesNotContainUrlRule()], - 'body' => ['required', new HttpImageRule(), new InvalidMentionRule()], + 'subject' => ['required', 'max:60', new DoesNotContainUrlRule], + 'body' => ['required', new HttpImageRule, new InvalidMentionRule], 'tags' => 'array', 'tags.*' => 'exists:tags,id', ]; diff --git a/app/Http/Requests/UpdatePasswordRequest.php b/app/Http/Requests/UpdatePasswordRequest.php index efb30c189..0faf359d2 100644 --- a/app/Http/Requests/UpdatePasswordRequest.php +++ b/app/Http/Requests/UpdatePasswordRequest.php @@ -14,7 +14,7 @@ public function rules(): array ]; if ($this->user()->hasPassword()) { - $rules['current_password'] = ['required', new PasscheckRule()]; + $rules['current_password'] = ['required', new PasscheckRule]; } return $rules; diff --git a/app/Http/Requests/UpdateReplyRequest.php b/app/Http/Requests/UpdateReplyRequest.php index 2c1fefe73..34778db9f 100644 --- a/app/Http/Requests/UpdateReplyRequest.php +++ b/app/Http/Requests/UpdateReplyRequest.php @@ -10,7 +10,7 @@ class UpdateReplyRequest extends Request public function rules(): array { return [ - 'body' => ['required', new HttpImageRule(), new InvalidMentionRule()], + 'body' => ['required', new HttpImageRule, new InvalidMentionRule], ]; } diff --git a/app/Jobs/CreateReply.php b/app/Jobs/CreateReply.php index 625837191..1490478d4 100644 --- a/app/Jobs/CreateReply.php +++ b/app/Jobs/CreateReply.php @@ -44,7 +44,7 @@ public function handle(): void event(new ReplyWasCreated($reply)); if ($this->replyAble instanceof SubscriptionAble && ! $this->replyAble->hasSubscriber($this->author)) { - $subscription = new Subscription(); + $subscription = new Subscription; $subscription->uuid = Uuid::uuid4()->toString(); $subscription->userRelation()->associate($this->author); $subscription->subscriptionAbleRelation()->associate($this->replyAble); diff --git a/app/Jobs/CreateThread.php b/app/Jobs/CreateThread.php index c5fac34ce..fbeef8ae9 100644 --- a/app/Jobs/CreateThread.php +++ b/app/Jobs/CreateThread.php @@ -45,7 +45,7 @@ public function handle(): void $thread->save(); // Subscribe author to the thread. - $subscription = new Subscription(); + $subscription = new Subscription; $subscription->uuid = Uuid::uuid4()->toString(); $subscription->userRelation()->associate($this->author); $subscription->subscriptionAbleRelation()->associate($thread); diff --git a/app/Jobs/SubscribeToSubscriptionAble.php b/app/Jobs/SubscribeToSubscriptionAble.php index 88d9e2837..dfc748746 100644 --- a/app/Jobs/SubscribeToSubscriptionAble.php +++ b/app/Jobs/SubscribeToSubscriptionAble.php @@ -13,7 +13,7 @@ public function __construct(private User $user, private SubscriptionAble $subscr public function handle(): void { - $subscription = new Subscription(); + $subscription = new Subscription; $subscription->uuid = Uuid::uuid4()->toString(); $subscription->userRelation()->associate($this->user); $this->subscriptionAble->subscriptionsRelation()->save($subscription); diff --git a/app/Livewire/EditReply.php b/app/Livewire/EditReply.php index 4530095a9..c148f279c 100644 --- a/app/Livewire/EditReply.php +++ b/app/Livewire/EditReply.php @@ -27,7 +27,7 @@ public function updateReply($body) $this->body = $body; $this->authorize(ReplyPolicy::UPDATE, $this->reply); - $this->validate((new UpdateReplyRequest())->rules()); + $this->validate((new UpdateReplyRequest)->rules()); dispatch_sync(new UpdateReply($this->reply, Auth::user(), $this->body)); diff --git a/composer.lock b/composer.lock index daa18fb1b..3180ac0ba 100644 --- a/composer.lock +++ b/composer.lock @@ -1792,24 +1792,24 @@ }, { "name": "graham-campbell/result-type", - "version": "v1.1.2", + "version": "v1.1.3", "source": { "type": "git", "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862" + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862", - "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945", + "reference": "3ba905c11371512af9d9bdd27d99b782216b6945", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.2" + "phpoption/phpoption": "^1.9.3" }, "require-dev": { - "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "autoload": { @@ -1838,7 +1838,7 @@ ], "support": { "issues": "https://github.com/GrahamCampbell/Result-Type/issues", - "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.2" + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3" }, "funding": [ { @@ -1850,26 +1850,26 @@ "type": "tidelift" } ], - "time": "2023-11-12T22:16:48+00:00" + "time": "2024-07-20T21:45:45+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "a629e5b69db96eb4939c1b34114130077dd4c6fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a629e5b69db96eb4939c1b34114130077dd4c6fc", + "reference": "a629e5b69db96eb4939c1b34114130077dd4c6fc", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -1880,9 +1880,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -1960,7 +1960,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.9.1" }, "funding": [ { @@ -1976,20 +1976,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2024-07-19T16:19:57+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", "shasum": "" }, "require": { @@ -1997,7 +1997,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -2043,7 +2043,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.3" }, "funding": [ { @@ -2059,20 +2059,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2024-07-18T10:29:17+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -2087,8 +2087,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -2159,7 +2159,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -2175,7 +2175,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "guzzlehttp/uri-template", @@ -2650,16 +2650,16 @@ }, { "name": "laravel/framework", - "version": "v10.48.16", + "version": "v10.48.17", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "f9a3a50fae399d75e125b0eea637dda90c99eae7" + "reference": "60f3c8f667b24a09e0392e26b1f40fb9067cdc3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/f9a3a50fae399d75e125b0eea637dda90c99eae7", - "reference": "f9a3a50fae399d75e125b0eea637dda90c99eae7", + "url": "https://api.github.com/repos/laravel/framework/zipball/60f3c8f667b24a09e0392e26b1f40fb9067cdc3c", + "reference": "60f3c8f667b24a09e0392e26b1f40fb9067cdc3c", "shasum": "" }, "require": { @@ -2853,20 +2853,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-07-09T15:25:22+00:00" + "time": "2024-07-23T16:06:06+00:00" }, { "name": "laravel/horizon", - "version": "v5.25.0", + "version": "v5.26.0", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "81e62cee5b3feaf169d683b8890e33bf454698ab" + "reference": "ee804ece8e0376e8ddf44348de947945751c06f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/81e62cee5b3feaf169d683b8890e33bf454698ab", - "reference": "81e62cee5b3feaf169d683b8890e33bf454698ab", + "url": "https://api.github.com/repos/laravel/horizon/zipball/ee804ece8e0376e8ddf44348de947945751c06f2", + "reference": "ee804ece8e0376e8ddf44348de947945751c06f2", "shasum": "" }, "require": { @@ -2930,9 +2930,9 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/v5.25.0" + "source": "https://github.com/laravel/horizon/tree/v5.26.0" }, - "time": "2024-07-05T16:46:31+00:00" + "time": "2024-07-22T14:37:58+00:00" }, { "name": "laravel/prompts", @@ -3399,16 +3399,16 @@ }, { "name": "league/commonmark", - "version": "2.4.2", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf" + "reference": "0026475f5c9a104410ae824cb5a4d63fa3bdb1df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/91c24291965bd6d7c46c46a12ba7492f83b1cadf", - "reference": "91c24291965bd6d7c46c46a12ba7492f83b1cadf", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/0026475f5c9a104410ae824cb5a4d63fa3bdb1df", + "reference": "0026475f5c9a104410ae824cb5a4d63fa3bdb1df", "shasum": "" }, "require": { @@ -3421,8 +3421,8 @@ }, "require-dev": { "cebe/markdown": "^1.0", - "commonmark/cmark": "0.30.3", - "commonmark/commonmark.js": "0.30.0", + "commonmark/cmark": "0.31.0", + "commonmark/commonmark.js": "0.31.0", "composer/package-versions-deprecated": "^1.8", "embed/embed": "^4.4", "erusev/parsedown": "^1.0", @@ -3444,7 +3444,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "2.6-dev" } }, "autoload": { @@ -3501,7 +3501,7 @@ "type": "tidelift" } ], - "time": "2024-02-02T11:59:32+00:00" + "time": "2024-07-22T18:18:14+00:00" }, { "name": "league/config", @@ -5041,16 +5041,16 @@ }, { "name": "phpoption/phpoption", - "version": "1.9.2", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-option.git", - "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820" + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820", - "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820", + "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54", + "reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54", "shasum": "" }, "require": { @@ -5058,13 +5058,13 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" + "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" }, "type": "library", "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { "dev-master": "1.9-dev" @@ -5100,7 +5100,7 @@ ], "support": { "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.9.2" + "source": "https://github.com/schmittjoh/php-option/tree/1.9.3" }, "funding": [ { @@ -5112,7 +5112,7 @@ "type": "tidelift" } ], - "time": "2023-11-12T21:59:55+00:00" + "time": "2024-07-20T21:41:07+00:00" }, { "name": "phpseclib/phpseclib", @@ -6190,16 +6190,16 @@ }, { "name": "sentry/sentry-laravel", - "version": "4.7.0", + "version": "4.7.1", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-laravel.git", - "reference": "44151798253145c1abc7fe7e38210b98f926d794" + "reference": "d70415f19f35806acee5bcbc7403e9cb8fb5252c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/44151798253145c1abc7fe7e38210b98f926d794", - "reference": "44151798253145c1abc7fe7e38210b98f926d794", + "url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/d70415f19f35806acee5bcbc7403e9cb8fb5252c", + "reference": "d70415f19f35806acee5bcbc7403e9cb8fb5252c", "shasum": "" }, "require": { @@ -6263,7 +6263,7 @@ ], "support": { "issues": "https://github.com/getsentry/sentry-laravel/issues", - "source": "https://github.com/getsentry/sentry-laravel/tree/4.7.0" + "source": "https://github.com/getsentry/sentry-laravel/tree/4.7.1" }, "funding": [ { @@ -6275,7 +6275,7 @@ "type": "custom" } ], - "time": "2024-07-10T21:55:04+00:00" + "time": "2024-07-17T13:27:43+00:00" }, { "name": "spatie/backtrace", @@ -10023,23 +10023,23 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.6.0", + "version": "v5.6.1", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4" + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", - "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", "shasum": "" }, "require": { "ext-pcre": "*", - "graham-campbell/result-type": "^1.1.2", + "graham-campbell/result-type": "^1.1.3", "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.2", + "phpoption/phpoption": "^1.9.3", "symfony/polyfill-ctype": "^1.24", "symfony/polyfill-mbstring": "^1.24", "symfony/polyfill-php80": "^1.24" @@ -10056,7 +10056,7 @@ "extra": { "bamarni-bin": { "bin-links": true, - "forward-command": true + "forward-command": false }, "branch-alias": { "dev-master": "5.6-dev" @@ -10091,7 +10091,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" }, "funding": [ { @@ -10103,7 +10103,7 @@ "type": "tidelift" } ], - "time": "2023-11-12T22:43:29+00:00" + "time": "2024-07-20T21:52:34+00:00" }, { "name": "voku/portable-ascii", diff --git a/tests/Integration/Commands/PostArticleToTwitterTest.php b/tests/Integration/Commands/PostArticleToTwitterTest.php index dde0f36c3..a9cbacd11 100644 --- a/tests/Integration/Commands/PostArticleToTwitterTest.php +++ b/tests/Integration/Commands/PostArticleToTwitterTest.php @@ -23,10 +23,10 @@ 'approved_at' => now(), ]); - (new PostArticleToTwitter())->handle(new AnonymousNotifiable()); + (new PostArticleToTwitter)->handle(new AnonymousNotifiable); Notification::assertSentTo( - new AnonymousNotifiable(), + new AnonymousNotifiable, PostArticleToTwitterNotification::class, function ($notification, $channels, $notifiable) use ($article) { $tweet = $notification->generateTweet(); @@ -51,10 +51,10 @@ function ($notification, $channels, $notifiable) use ($article) { 'approved_at' => now(), ]); - (new PostArticleToTwitter())->handle(new AnonymousNotifiable()); + (new PostArticleToTwitter)->handle(new AnonymousNotifiable); Notification::assertSentTo( - new AnonymousNotifiable(), + new AnonymousNotifiable, PostArticleToTwitterNotification::class, function ($notification, $channels, $notifiable) { return Str::contains($notification->generateTweet(), '@_joedixon'); @@ -74,10 +74,10 @@ function ($notification, $channels, $notifiable) { 'approved_at' => now(), ]); - (new PostArticleToTwitter())->handle(new AnonymousNotifiable()); + (new PostArticleToTwitter)->handle(new AnonymousNotifiable); Notification::assertSentTo( - new AnonymousNotifiable(), + new AnonymousNotifiable, PostArticleToTwitterNotification::class, function ($notification, $channels, $notifiable) { return Str::contains($notification->generateTweet(), 'Joe Dixon'); @@ -92,7 +92,7 @@ function ($notification, $channels, $notifiable) { 'shared_at' => now(), ]); - (new PostArticleToTwitter())->handle(new AnonymousNotifiable()); + (new PostArticleToTwitter)->handle(new AnonymousNotifiable); Notification::assertNothingSent(); }); @@ -102,7 +102,7 @@ function ($notification, $channels, $notifiable) { 'submitted_at' => now(), ]); - (new PostArticleToTwitter())->handle(new AnonymousNotifiable()); + (new PostArticleToTwitter)->handle(new AnonymousNotifiable); Notification::assertNothingSent(); }); @@ -110,7 +110,7 @@ function ($notification, $channels, $notifiable) { test('unsubmitted articles are not shared', function () { Article::factory()->create(); - (new PostArticleToTwitter())->handle(new AnonymousNotifiable()); + (new PostArticleToTwitter)->handle(new AnonymousNotifiable); Notification::assertNothingSent(); }); diff --git a/tests/Integration/Rules/PasscheckRuleTest.php b/tests/Integration/Rules/PasscheckRuleTest.php index 88e19b89a..7711c8e18 100644 --- a/tests/Integration/Rules/PasscheckRuleTest.php +++ b/tests/Integration/Rules/PasscheckRuleTest.php @@ -9,7 +9,7 @@ it('passes when the password is correct', function () { $this->login(['password' => bcrypt('foo')]); - $rule = new PasscheckRule(); + $rule = new PasscheckRule; $result = $rule->passes('password', 'foo'); @@ -18,7 +18,7 @@ it('fails when the password is incorrect', function () { $this->login(); - $rule = new PasscheckRule(); + $rule = new PasscheckRule; $result = $rule->passes('password', 'foo'); diff --git a/tests/Unit/Rules/DoesNotContainUrlRuleTest.php b/tests/Unit/Rules/DoesNotContainUrlRuleTest.php index 6280a6163..d6c9301e7 100644 --- a/tests/Unit/Rules/DoesNotContainUrlRuleTest.php +++ b/tests/Unit/Rules/DoesNotContainUrlRuleTest.php @@ -4,18 +4,18 @@ it('detects a url in a string', function () { $this->assertFalse( - (new DoesNotContainUrlRule())->passes('foo', 'This is a string http://example.com with an url in it.'), + (new DoesNotContainUrlRule)->passes('foo', 'This is a string http://example.com with an url in it.'), ); }); it('passes when no url is present', function () { $this->assertTrue( - (new DoesNotContainUrlRule())->passes('foo', 'This is a string without an url in it.'), + (new DoesNotContainUrlRule)->passes('foo', 'This is a string without an url in it.'), ); }); it('passes when extra spaces are present', function () { $this->assertTrue( - (new DoesNotContainUrlRule())->passes('foo', 'This is a string with extra spaces.'), + (new DoesNotContainUrlRule)->passes('foo', 'This is a string with extra spaces.'), ); }); diff --git a/tests/Unit/Rules/HttpImageRuleTest.php b/tests/Unit/Rules/HttpImageRuleTest.php index ed20a0b66..f95a67036 100644 --- a/tests/Unit/Rules/HttpImageRuleTest.php +++ b/tests/Unit/Rules/HttpImageRuleTest.php @@ -4,12 +4,12 @@ it('passes when no http links are detected', function () { $this->assertTrue( - (new HttpImageRule())->passes('body', 'some text ![](https://link.com)'), + (new HttpImageRule)->passes('body', 'some text ![](https://link.com)'), ); }); it('fails when http links are detected', function () { $this->assertFalse( - (new HttpImageRule())->passes('body', 'some text ![](http://link.com)'), + (new HttpImageRule)->passes('body', 'some text ![](http://link.com)'), ); }); diff --git a/tests/Unit/Rules/InvalidMentionRuleTest.php b/tests/Unit/Rules/InvalidMentionRuleTest.php index bc5c47d14..1e0175a1d 100644 --- a/tests/Unit/Rules/InvalidMentionRuleTest.php +++ b/tests/Unit/Rules/InvalidMentionRuleTest.php @@ -3,7 +3,7 @@ use App\Rules\InvalidMentionRule; it('passes when no invalid mentions are detected', function ($body) { - expect((new InvalidMentionRule())->passes('body', $body))->toBeTrue(); + expect((new InvalidMentionRule)->passes('body', $body))->toBeTrue(); })->with([ 'Hello, I\'m looking for some help', 'I\'ve seen [this link](https://example.com), is it legit?', @@ -27,7 +27,7 @@ ]); it('fails when invalid mentions are detected', function ($body) { - expect((new InvalidMentionRule())->passes('body', $body))->toBeFalse(); + expect((new InvalidMentionRule)->passes('body', $body))->toBeFalse(); })->with([ '[@driesvints](https://somethingnasty.com)', 'Hey [@joedixon](https://somethingnasty.com), is it legit?',