feat: initial commit of camelia/controllers
Framework-agnostic REST controller toolkit in vanilla PHP. - Router with path parameters, 404 and 405 with an Allow header. - Immutable Request, JsonRequest and Response; nothing is printed. - CrudController over a ResourceGateway port the application implements. - Composable Middleware/Pipeline chain. - Security middlewares: BearerAuth, RequireRole, RateLimit, Cors. - Transport middlewares: Logging, ContentNegotiation. - Nine typed HTTP exceptions with snake_case JSON bodies. - Declares PHP >=8.3 and no dependency on an ORM: ports are local. - MIT license.
This commit is contained in:
commit
341d1bdc2c
52 files changed
+7552
No files matched your search
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "camelia/controllers",
|
||||
"description": "Framework-agnostic REST controller toolkit: routing, request parsing, validation and JSON responses over any data source.",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"keywords": ["rest", "controller", "api", "http", "router"],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Dario Garcia",
|
||||
"email": "dario61081@gmail.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.3",
|
||||
"ext-json": "*"
|
||||
},
|
||||
"require-dev": {
|
||||
"carthage-software/mago": "^1.60",
|
||||
"phpstan/phpstan": "^1.11",
|
||||
"phpunit/phpunit": "^10.5 || ^11.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Camelia\\Controllers\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Camelia\\Controllers\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test": "phpunit --configuration phpunit.xml.dist",
|
||||
"fmt": "mago fmt",
|
||||
"fmt:check": "mago fmt --check",
|
||||
"lint": "mago lint",
|
||||
"analyze": "mago analyze",
|
||||
"phpstan": "php -d memory_limit=1G vendor/bin/phpstan analyse --configuration phpstan.neon --no-progress",
|
||||
"check": [
|
||||
"@fmt:check",
|
||||
"@lint",
|
||||
"@analyze",
|
||||
"@phpstan",
|
||||
"@test"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"archive": {
|
||||
"exclude": [
|
||||
"/tests",
|
||||
"/mago.toml",
|
||||
"/phpstan.neon",
|
||||
"/phpunit.xml.dist",
|
||||
"/AGENTS.md",
|
||||
"/.gitignore"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.0.x-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user