You've already forked Php-Template
Some checks are pending
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Waiting to run
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 2m39s
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 2m44s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 2m41s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 2m55s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Successful in 2m59s
Reviewed-on: #24 Co-authored-by: Ron Rise <ron@siteworxpro.com> Co-committed-by: Ron Rise <ron@siteworxpro.com>
76 lines
1.9 KiB
PHP
76 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Siteworxpro\App\Controllers;
|
|
|
|
use League\Route\Http\Exception\NotFoundException;
|
|
use Nyholm\Psr7\ServerRequest;
|
|
use OpenApi\Attributes as OA;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
use Siteworxpro\App\Helpers\Version;
|
|
|
|
/**
|
|
* Class Controller
|
|
*
|
|
* An abstract base controller providing default implementations for HTTP methods.
|
|
*
|
|
* @package Siteworxpro\App\Controllers
|
|
*/
|
|
#[OA\Info(
|
|
version: Version::VERSION,
|
|
description: "This is a template API built using Siteworxpro framework.",
|
|
title: "Siteworxpro Template API",
|
|
contact: new OA\Contact(
|
|
name: "Siteworxpro",
|
|
url: "https://www.siteworxpro.com",
|
|
email: "support@siteworxpro.com"
|
|
),
|
|
license: new OA\License('MIT', 'https://opensource.org/licenses/MIT')
|
|
)]
|
|
#[OA\Server(url: "https://localhost", description: "Local Server")]
|
|
abstract class Controller implements ControllerInterface
|
|
{
|
|
/**
|
|
* @param ServerRequest $request
|
|
* @return ResponseInterface
|
|
* @throws NotFoundException
|
|
*/
|
|
public function get(ServerRequest $request): ResponseInterface
|
|
{
|
|
throw new NotFoundException("not found");
|
|
}
|
|
|
|
/**
|
|
* @throws NotFoundException
|
|
*/
|
|
public function post(ServerRequest $request): ResponseInterface
|
|
{
|
|
throw new NotFoundException("not found");
|
|
}
|
|
|
|
/**
|
|
* @throws NotFoundException
|
|
*/
|
|
public function put(ServerRequest $request): ResponseInterface
|
|
{
|
|
throw new NotFoundException("not found");
|
|
}
|
|
|
|
/**
|
|
* @throws NotFoundException
|
|
*/
|
|
public function delete(ServerRequest $request): ResponseInterface
|
|
{
|
|
throw new NotFoundException("not found");
|
|
}
|
|
|
|
/**
|
|
* @throws NotFoundException
|
|
*/
|
|
public function patch(ServerRequest $request): ResponseInterface
|
|
{
|
|
throw new NotFoundException("not found");
|
|
}
|
|
}
|