Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options are not necessary at Application level #221

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 0 additions & 6 deletions config/reverb.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@
'key' => env('REVERB_APP_KEY'),
'secret' => env('REVERB_APP_SECRET'),
'app_id' => env('REVERB_APP_ID'),
'options' => [
'host' => env('REVERB_HOST'),
'port' => env('REVERB_PORT', 443),
'scheme' => env('REVERB_SCHEME', 'https'),
'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
],
'allowed_origins' => ['*'],
'ping_interval' => env('REVERB_APP_PING_INTERVAL', 60),
'max_message_size' => env('REVERB_APP_MAX_MESSAGE_SIZE', 10_000),
Expand Down
12 changes: 1 addition & 11 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public function __construct(
protected string $secret,
protected int $pingInterval,
protected array $allowedOrigins,
protected int $maxMessageSize,
protected array $options = [],
protected int $maxMessageSize
) {
//
}
Expand Down Expand Up @@ -69,14 +68,6 @@ public function maxMessageSize(): int
return $this->maxMessageSize;
}

/**
* Get the application options.
*/
public function options(): ?array
{
return $this->options;
}

/**
* Convert the application to an array.
*
Expand All @@ -91,7 +82,6 @@ public function toArray(): array
'ping_interval' => $this->pingInterval,
'allowed_origins' => $this->allowedOrigins,
'max_message_size' => $this->maxMessageSize,
'options' => $this->options,
];
}
}
1 change: 0 additions & 1 deletion src/ConfigApplicationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function find(string $key, mixed $value): Application
$app['ping_interval'],
$app['allowed_origins'],
$app['max_message_size'],
$app['options'] ?? [],
);
}
}
6 changes: 0 additions & 6 deletions tests/Unit/ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,5 @@
'ping_interval' => 60,
'allowed_origins' => ['*'],
'max_message_size' => 10_000,
'options' => [
'host' => 'localhost',
'port' => 443,
'scheme' => 'https',
'useTLS' => true,
],
]);
});