Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Rector: investigation into CI integration #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/Actions/ProcessProperty/OnTheMarketAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

class OnTheMarketAction extends ProviderAction implements RespondsToProviderUrlInterface
{
const PROVIDER_NAME = 'OnTheMarket';
/** @var string */
public const PROVIDER_NAME = 'OnTheMarket';

protected Crawler $crawler;

Expand Down
5 changes: 3 additions & 2 deletions app/Actions/ProcessProperty/RightmoveAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

class RightmoveAction extends ProviderAction implements RespondsToProviderUrlInterface
{
const PROVIDER_NAME = 'Rightmove';
/** @var string */
public const PROVIDER_NAME = 'Rightmove';

protected Crawler $crawler;

Expand Down Expand Up @@ -67,7 +68,7 @@ protected function processAmenityNames(): array
return [];
}

return $amenities_crawler->each(function (Crawler $node) {
return $amenities_crawler->each(function (Crawler $node): string {
return Str::limit($node->text(), 255);
});
}
Expand Down
1 change: 1 addition & 0 deletions app/Actions/ProcessProperty/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

final class Utils
{
/** @var string[] */
public const PROVIDER_ACTIONS = [
OnTheMarketAction::class,
RightmoveAction::class,
Expand Down
5 changes: 3 additions & 2 deletions app/Actions/ProcessProperty/ZooplaAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

class ZooplaAction extends ProviderAction implements RespondsToProviderUrlInterface
{
const PROVIDER_NAME = 'Zoopla';
/** @var string */
public const PROVIDER_NAME = 'Zoopla';

protected Crawler $crawler;

Expand Down Expand Up @@ -67,7 +68,7 @@ protected function processAmenityNames(): array
return [];
}

return $amenities_crawler->each(function (Crawler $node) {
return $amenities_crawler->each(function (Crawler $node): string {
return Str::limit($node->text(), 255);
});
}
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Kernel extends ConsoleKernel
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}
Expand All @@ -32,7 +32,7 @@ protected function schedule(Schedule $schedule)
*
* @return void
*/
protected function commands()
protected function commands(): void
{
$this->load(__DIR__.'/Commands');

Expand Down
4 changes: 3 additions & 1 deletion app/Events/CommentStored.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

class CommentStored
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

/**
* Create a new event instance.
Expand Down
8 changes: 3 additions & 5 deletions app/Events/PropertyStored.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
namespace App\Events;

use App\Models\Property;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class PropertyStored
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;

/**
* Create a new event instance.
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Handler extends ExceptionHandler
*
* @return void
*/
public function register()
public function register(): void
{
}
}
3 changes: 1 addition & 2 deletions app/Http/Controllers/Auth/ConfirmablePasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ class ConfirmablePasswordController extends Controller
/**
* Show the confirm password view.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\View\View
*/
public function show(Request $request)
public function show()
{
return view('auth.confirm-password');
}
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/TrustHosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TrustHosts extends Middleware
*
* @return array
*/
public function hosts()
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
Expand Down
20 changes: 4 additions & 16 deletions app/Http/Requests/Auth/LoginRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,12 @@

class LoginRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}

/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
public function rules(): array
{
return [
'email' => 'required|string|email',
Expand All @@ -38,10 +28,9 @@ public function rules()
* Attempt to authenticate the request's credentials.
*
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
public function authenticate()
public function authenticate(): void
{
$this->ensureIsNotRateLimited();

Expand All @@ -60,10 +49,9 @@ public function authenticate()
* Ensure the login request is not rate limited.
*
* @return void
*
* @throws \Illuminate\Validation\ValidationException
*/
public function ensureIsNotRateLimited()
public function ensureIsNotRateLimited(): void
{
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
return;
Expand All @@ -86,7 +74,7 @@ public function ensureIsNotRateLimited()
*
* @return string
*/
public function throttleKey()
public function throttleKey(): string
{
return Str::lower($this->input('email')).'|'.$this->ip();
}
Expand Down
7 changes: 5 additions & 2 deletions app/Jobs/ProcessPropertyUrlJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

class ProcessPropertyUrlJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;

public function __construct(
protected Property $property,
Expand All @@ -28,7 +31,7 @@ public function __construct(
*
* @return void
*/
public function handle()
public function handle(): void
{
// If URL differ, we assume it has changed before processing the job
// and is being dealt with, and return
Expand Down
6 changes: 3 additions & 3 deletions app/Listeners/SendCommentStoredNotificationListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SendCommentStoredNotificationListener
* @param \App\Events\CommentStored $event
* @return void
*/
public function handle(CommentStored $event)
public function handle(CommentStored $event): void
{
$comment = $event->getComment();
$property = $event->getProperty();
Expand All @@ -28,7 +28,7 @@ public function handle(CommentStored $event)
->where('user_id', '<>', $creator->id)
->pluck('user')
->filter()
->filter(static function (User $recipient) {
->filter(static function (User $recipient): bool {
return $recipient->notification_preferences->where(
'type_id',
config('app.notification_types.new_comment_id')
Expand All @@ -38,7 +38,7 @@ public function handle(CommentStored $event)
$comment,
$property,
$creator,
) {
): void {
$recipient->notify(
new CommentStoredNotification($comment, $property, $creator)
);
Expand Down
4 changes: 2 additions & 2 deletions app/Listeners/SendPropertyStoredNotificationListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SendPropertyStoredNotificationListener
* @param \App\Events\PropertyStored $event
* @return void
*/
public function handle(PropertyStored $event)
public function handle(PropertyStored $event): void
{
$property = $event->getProperty();
$creator = $property->user;
Expand All @@ -27,7 +27,7 @@ public function handle(PropertyStored $event)
->where('user_id', '<>', $creator->id)
->pluck('user')
->filter()
->filter(static function (User $recipient) {
->filter(static function (User $recipient): bool {
return $recipient->notification_preferences->where(
'type_id',
config('app.notification_types.new_property_id')
Expand Down
5 changes: 2 additions & 3 deletions app/Notifications/CommentStoredNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ public function __construct(
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
public function via(): array
{
return ['mail'];
}
Expand All @@ -45,7 +44,7 @@ public function via($notifiable)
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
public function toMail($notifiable): MailMessage
{
return (new MailMessage)
->subject($this->creator->name.' Has Added A Comment')
Expand Down
5 changes: 2 additions & 3 deletions app/Notifications/InviteUserNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ public function __construct(
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
public function via(): array
{
return ['mail'];
}
Expand All @@ -39,7 +38,7 @@ public function via($notifiable)
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
public function toMail($notifiable): MailMessage
{
return (new MailMessage)
->subject(
Expand Down
10 changes: 3 additions & 7 deletions app/Notifications/PropertyStoredNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ public function __construct(
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
public function via(): array
{
return ['mail'];
}
Expand All @@ -42,7 +41,7 @@ public function via($notifiable)
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
public function toMail($notifiable): MailMessage
{
return (new MailMessage)
->subject($this->creator->name.' Has Added A New Property')
Expand All @@ -55,10 +54,7 @@ public function toMail($notifiable)
'View On Website',
route('properties.show', $this->property)
)
->line(
'You can let your group know what you think, '.
'by leaving a preference or a comment'
)
->line('You can let your group know what you think, by leaving a preference or a comment.')
->salutation('Regards,');
}
}
Loading