Removed exceptions

This commit is contained in:
Alex Renoki 2020-09-11 15:23:19 +03:00
parent dfe0dbf335
commit a906bc8f3e
2 changed files with 0 additions and 72 deletions

View File

@ -1,48 +0,0 @@
<?php
namespace BeyondCode\LaravelWebSockets\Exceptions;
use Exception;
use Facade\IgnitionContracts\BaseSolution;
use Facade\IgnitionContracts\ProvidesSolution;
use Facade\IgnitionContracts\Solution;
class InvalidApp extends Exception implements ProvidesSolution
{
/**
* Throw an "app not found by id" exception.
*
* @param mixed $appId
* @return \BeyondCode\LaravelWebSockets\Exceptions\InvalidApp
*/
public static function notFound($appId)
{
return new static("Could not find app for app id `{$appId}`.");
}
/**
* Throw an "app id required" exception.
*
* @param string $name
* @param mixed $appId
* @return \BeyondCode\LaravelWebSockets\Exceptions\InvalidApp
*/
public static function valueIsRequired($name, $appId)
{
return new static("{$name} is required but was empty for app id `{$appId}`.");
}
/**
* Provide the solution for Igniter.
*
* @return \Facade\IgnitionContracts\BaseSolution
*/
public function getSolution(): Solution
{
return BaseSolution::create('Your application id could not be found')
->setSolutionDescription('Make sure that your `config/websockets.php` contains the app key you are trying to use.')
->setDocumentationLinks([
'Configuring WebSocket Apps (official documentation)' => 'https://docs.beyondco.de/laravel-websockets/1.0/basic-usage/pusher.html#configuring-websocket-apps',
]);
}
}

View File

@ -1,24 +0,0 @@
<?php
namespace BeyondCode\LaravelWebSockets\Exceptions;
use Exception;
use Ratchet\WebSocket\MessageComponentInterface;
class InvalidWebSocketController extends Exception
{
/**
* Allocate a controller to the error.
*
* @param string $controllerClass
* @return \BeyondCode\LaravelWebSockets\Exceptions\InvalidWebSocketController
*/
public static function withController(string $controllerClass)
{
$class = MessageComponentInterface::class;
return new static(
"Invalid WebSocket Controller provided. Expected instance of `{$class}`, but received `{$controllerClass}`."
);
}
}