devcraftclub / dev-tools
Reusable PHP attributes and validation utilities
Fund package maintenance!
dev-main
2026-08-12 12:09 UTC
Requires
- php: >=8.3
- analog/analog: ^1.0
- psr/log: ^3.0
Requires (Dev)
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-08-12 12:12:47 UTC
README
Reusable PHP 8.3 attributes and runtime helpers.
See docs/getting-started.md for full documentation.
Local installation
Add a Composer path repository in the consuming project and require the package:
{
"repositories": [
{
"type": "path",
"url": "dev-tools",
"options": {"symlink": true}
}
],
"require": {
"devcraft/dev-tools": "@dev"
}
}
Path repositories must be configured by the consuming root project; Composer does not inherit them transitively. Publish this package later, or replace the path repository with a normal repository and version.
Fluent properties
use Devcraft\Abstracts\AbstractWith; use Devcraft\Attributes\With; use Devcraft\Attributes\WithItem; final class Query extends AbstractWith { #[With] private ?int $page = null; #[With, WithItem('string')] private array $tags = []; #[WithItem('string', ['string', 'null'])] private array $labels = []; }
AbstractWith routes unresolved calls through WithHandler::handles() and
WithHandler::call(). One WithItem descriptor appends a value. Two
descriptors set a key/value pair. Arrays in a descriptor represent union types.