You've already forked Php-Template
tests
This commit is contained in:
@@ -40,4 +40,4 @@ class Config extends Facade
|
||||
{
|
||||
return 'config';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ use Spiral\Goridge\RPC\RPC;
|
||||
*/
|
||||
class Logger extends Facade
|
||||
{
|
||||
|
||||
public static function getFacadeRoot(): RRLogger
|
||||
{
|
||||
$rpc = RPC::create('tcp://127.0.0.1:6001');
|
||||
@@ -39,4 +38,4 @@ class Logger extends Facade
|
||||
{
|
||||
return RRLogger::class;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ use Nyholm\Psr7\Response;
|
||||
*/
|
||||
class JsonResponseFactory
|
||||
{
|
||||
|
||||
/**
|
||||
* Create a JSON response with the given data and status code.
|
||||
*
|
||||
@@ -32,4 +31,4 @@ class JsonResponseFactory
|
||||
body: json_encode($data, JSON_THROW_ON_ERROR)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,10 +31,12 @@ class CorsMiddleware implements MiddlewareInterface
|
||||
{
|
||||
$origin = $request->getHeaderLine('Origin');
|
||||
$allowedOrigins = array_map(
|
||||
'trim', explode(
|
||||
',',
|
||||
Config::get('CORS_ALLOWED_ORIGINS', 'https://example.com,https://another.com')
|
||||
));
|
||||
'trim',
|
||||
explode(
|
||||
',',
|
||||
Config::get('CORS_ALLOWED_ORIGINS', 'https://example.com,https://another.com')
|
||||
)
|
||||
);
|
||||
|
||||
$allowOrigin = in_array($origin, $allowedOrigins, true)
|
||||
? $origin
|
||||
@@ -63,4 +65,4 @@ class CorsMiddleware implements MiddlewareInterface
|
||||
|
||||
return $response->withHeader('Access-Control-Max-Age', $maxAge);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,4 @@ use Illuminate\Database\Eloquent\Model as ORM;
|
||||
|
||||
abstract class Model extends ORM
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ use Spiral\RoadRunner\Worker;
|
||||
*/
|
||||
class Server
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Router The router instance for handling routes.
|
||||
*/
|
||||
@@ -142,7 +141,7 @@ class Server
|
||||
|
||||
$response = $this->router->handle($request);
|
||||
$this->worker->respond($response);
|
||||
} catch (MethodNotAllowedException|NotFoundException) {
|
||||
} catch (MethodNotAllowedException | NotFoundException) {
|
||||
$this->worker->respond(
|
||||
JsonResponseFactory::createJsonResponse(
|
||||
['status_code' => 404, 'reason_phrase' => 'Not Found'],
|
||||
@@ -167,4 +166,4 @@ class Server
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user