Skip to content

Commit

Permalink
style: run php formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jobara committed Jan 11, 2024
1 parent 369af6e commit 1bce650
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion app/Http/Middleware/EnsureEmailIsVerified.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class EnsureEmailIsVerified
/**
* Handle an incoming request.
*/
public function handle(Request $request, Closure $next, string $redirectToRoute = null): Response|RedirectResponse|null
public function handle(Request $request, Closure $next, ?string $redirectToRoute = null): Response|RedirectResponse|null
{
if (! $request->user() ||
($request->user() instanceof MustVerifyEmail &&
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/ManageAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function render()
->layout('layouts.app', ['bodyClass' => 'page', 'headerClass' => 'stack', 'pageWidth' => 'wide']);
}

public function flash(string $message, string $interpretation = null)
public function flash(string $message, ?string $interpretation = null)
{
$this->dispatch('clear-flash-message');
session()->flash('message', $message);
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Prompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Prompt extends Component

public ?string $interpretationNameSpace;

public function mount(mixed $model, string $modelPath, string $heading, string $description, string $actionLabel, string $actionUrl, int $level = 3, string $interpretationName = null, string $interpretationNameSpace = null)
public function mount(mixed $model, string $modelPath, string $heading, string $description, string $actionLabel, string $actionUrl, int $level = 3, ?string $interpretationName = null, ?string $interpretationNameSpace = null)
{
$this->model = $model;
$this->modelPath = $modelPath;
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Invitation.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function email(): Attribute
);
}

public function accept(string $type = null): void
public function accept(?string $type = null): void
{
if ($type) {
if ($type === 'individual') {
Expand Down
4 changes: 2 additions & 2 deletions app/Models/MatchingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public function detachClusters(array $clusters)
/**
* Synchronize associations with identities from a single identity cluster.
*/
public function syncRelatedIdentities(IdentityCluster $cluster, int|array $identities, string $weight = null, bool $detaching = true): void
public function syncRelatedIdentities(IdentityCluster $cluster, int|array $identities, ?string $weight = null, bool $detaching = true): void
{
if (! is_array($identities)) {
$identities = [$identities];
Expand All @@ -206,7 +206,7 @@ public function syncRelatedIdentities(IdentityCluster $cluster, int|array $ident
}
}

public function syncMutuallyExclusiveIdentities(IdentityCluster $cluster, int|array $identities, array $mutuallyExclusiveClusters, bool $detachLanguages = true, string $weight = null, bool $detaching = true): void
public function syncMutuallyExclusiveIdentities(IdentityCluster $cluster, int|array $identities, array $mutuallyExclusiveClusters, bool $detachLanguages = true, ?string $weight = null, bool $detaching = true): void
{
if (! is_array($identities)) {
$identities = [$identities];
Expand Down
2 changes: 1 addition & 1 deletion app/Rules/UniqueUserEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class UniqueUserEmail implements InvokableRule

// Can use the $id and $idColumn to define a model to ignore. Similar to how Laravel's unique validation rule works
// see: https://laravel.com/docs/10.x/validation#rule-unique
public function __construct(mixed $id = null, string $idColumn = null)
public function __construct(mixed $id = null, ?string $idColumn = null)
{
$this->id = $id;
$this->idColumn = $idColumn ?? 'id';
Expand Down
2 changes: 1 addition & 1 deletion app/View/Components/AppLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AppLayout extends Component

public ?string $pageWidth;

public function __construct(string $bodyClass = 'page', string $headerClass = 'stack', string $pageWidth = null)
public function __construct(string $bodyClass = 'page', string $headerClass = 'stack', ?string $pageWidth = null)
{
$this->bodyClass = $bodyClass;
$this->headerClass = $headerClass;
Expand Down
2 changes: 1 addition & 1 deletion app/View/Components/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Banner extends Component

public ?string $icon;

public function __construct(string $type = 'info', string $icon = null)
public function __construct(string $type = 'info', ?string $icon = null)
{
$this->type = $type;

Expand Down
2 changes: 1 addition & 1 deletion app/View/Components/Interpretation.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Interpretation extends Component
*
* @return void
*/
public function __construct(string $name, string $namespace = null)
public function __construct(string $name, ?string $namespace = null)
{
$this->name = $name;
$this->namespace = $namespace;
Expand Down
2 changes: 1 addition & 1 deletion app/View/Components/TranslationPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TranslationPicker extends Component

public array $availableLanguages;

public function __construct(array $languages = null, array $availableLanguages = null)
public function __construct(?array $languages = null, ?array $availableLanguages = null)
{
$this->languages = $languages ?? get_supported_locales(false);
$this->availableLanguages = $availableLanguages ?? Options::forArray(get_available_languages(true, false))->nullable(__('Choose a language…'))->toArray();
Expand Down
14 changes: 7 additions & 7 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @param string|null $key The setting key.
* @param mixed|null $default A default value for the setting.
*/
function settings(string $key = null, mixed $default = null): mixed
function settings(?string $key = null, mixed $default = null): mixed
{
return app(GeneralSettings::class)->$key ?? $default;
}
Expand Down Expand Up @@ -209,7 +209,7 @@ function to_written_languages(array $codes): array
* @param bool $capitalize Whether the returned language exonym should be capitalized.
* @return null|string The localized name of the locale, if found.
*/
function get_language_exonym(string $code, string $locale = null, bool $capitalize = true, bool $acronym = false): ?string
function get_language_exonym(string $code, ?string $locale = null, bool $capitalize = true, bool $acronym = false): ?string
{
$locale ??= locale();

Expand Down Expand Up @@ -244,7 +244,7 @@ function get_language_exonym(string $code, string $locale = null, bool $capitali
*
* See: https://github.com/spatie/laravel-sluggable/discussions/228
*/
function localized_route_for_locale(string $name, mixed $parameters, string $locale = null, bool $absolute = true): string
function localized_route_for_locale(string $name, mixed $parameters, ?string $locale = null, bool $absolute = true): string
{
// dd(is_null($locale), $locale === $locale);
if (is_null($locale) || $locale === locale()) {
Expand All @@ -271,7 +271,7 @@ function localized_route_for_locale(string $name, mixed $parameters, string $loc
* would be the same as calling the `getName` method on the route directly. If no route is passed in, it will attempt
* to use the current route.
*/
function route_name(Route $route = null, bool $localized = false): ?string
function route_name(?Route $route = null, bool $localized = false): ?string
{
$route ??= RouteFacade::getCurrentRoute();
$routeName = $route->getName();
Expand Down Expand Up @@ -367,7 +367,7 @@ function html_replacements(string $string, array $replacements = []): string
}

if (! function_exists('safe_markdown')) {
function safe_markdown(string $string, array $replacements = [], string $locale = null, bool $inline = false): HtmlString
function safe_markdown(string $string, array $replacements = [], ?string $locale = null, bool $inline = false): HtmlString
{
$markdownFuncName = $inline ? 'inlineMarkdown' : 'markdown';

Expand All @@ -379,7 +379,7 @@ function safe_markdown(string $string, array $replacements = [], string $locale
}

if (! function_exists('safe_inlineMarkdown')) {
function safe_inlineMarkdown(string $string, array $replacements = [], string $locale = null): HtmlString
function safe_inlineMarkdown(string $string, array $replacements = [], ?string $locale = null): HtmlString
{
return safe_markdown($string, $replacements, $locale, true);
}
Expand Down Expand Up @@ -412,7 +412,7 @@ function orientation_link(string $userType): string
* @param string|null $locale The requested locale for the setting to be returned in
* @param mixed|null $default A default value for the setting.
*/
function settings_localized(string $key = null, string $locale = null, mixed $default = null): mixed
function settings_localized(?string $key = null, ?string $locale = null, mixed $default = null): mixed
{
$locale = to_written_language($locale ?? config('app.locale'));
$settings = settings($key, []);
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/MatchingStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
expect(array_values($matchingStrategy->disability_and_deaf_group_summary))->toEqual($expected);
})->with('matchingStrategyDisabilityAndDeafGroupSummary');

test('matching strategy other identities summary accessor', function ($data, array $identities, array $expected = null) {
test('matching strategy other identities summary accessor', function ($data, array $identities, ?array $expected = null) {
$this->seed(LanguageSeeder::class);
$matchingStrategy = MatchingStrategy::factory()->create($data);
$expectedIdentities = [];
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/NotificationListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
expect($organization->isNotifying($nullUser))->toBeFalse();
});

test('add notificationable validation errors', function ($data, array $errors = null) {
test('add notificationable validation errors', function ($data, ?array $errors = null) {
$user = User::factory()->create();
$organization = Organization::factory()->create(['name' => ['en' => 'Umbrella Corporation'], 'published_at' => now()]);

Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/TranslationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
expect(flash()->message)->toBe(__('Language :language added.', ['language' => get_language_exonym('asl')]));
});

test('add translation validation errors', function ($data, array $errors = null) {
test('add translation validation errors', function ($data, ?array $errors = null) {
$individual = Individual::factory()->create([
'name' => 'Tester',
'roles' => ['consultant'],
Expand Down Expand Up @@ -62,7 +62,7 @@
expect(flash()->message)->toBe(__('Language :language removed.', ['language' => get_language_exonym('fr')]));
});

test('destroy translation validation errors', function ($data, array $errors = null) {
test('destroy translation validation errors', function ($data, ?array $errors = null) {
$individual = Individual::factory()->create([
'name' => 'Tester',
'roles' => ['consultant'],
Expand Down

0 comments on commit 1bce650

Please sign in to comment.