Development tools and utilities for BEAR.Sunday framework applications.
composer require --dev bear/devtools
The Halo module provides a visual development interface that appears around HTML representations of resources, offering detailed information about the resource being rendered.
Note: The Halo concept is inspired by the Seaside Smalltalk web framework, which pioneered this approach to visual web development debugging.
Features:
- Resource status and metadata display
- Interceptor chain visualization
- Direct links to resource class and template editors
- Request/response analysis
- Performance profiling integration
use BEAR\Dev\Halo\HaloModule;
use Ray\Di\AbstractModule;
class DevModule extends AbstractModule
{
protected function configure(): void
{
$this->install(new HaloModule($this));
}
}
HttpResource
starts a built-in PHP server and provides an HTTP client interface for testing your BEAR.Sunday applications.
Features:
- Automatic local server startup
- HTTP request logging to file
- Full HTTP method support (GET, POST, PUT, DELETE, etc.)
- Request/response capture for testing workflows
use BEAR\Dev\Http\HttpResource;
// Start server and create HTTP client
$resource = new HttpResource('127.0.0.1:8099', '/path/to/index.php', '/path/to/curl.log');
// Make HTTP requests
$ro = $resource->get('/users');
assert($ro->code === 200);
$ro = $resource->post('/users', ['name' => 'John', 'email' => '[email protected]']);
assert($ro->code === 201);
All HTTP requests made through HttpResource
are automatically logged with full curl command equivalents:
curl -s -i 'http://127.0.0.1:8099/users'
HTTP/1.1 200 OK
Content-Type: application/hal+json
...
- PHP 8.0 or higher
- BEAR.Sunday framework
This package includes comprehensive development tools:
- Code Quality: PHPStan, Psalm, PHP_CodeSniffer
- Testing: PHPUnit with coverage reporting
- Profiling: XHProf integration (optional)
The MIT License (MIT). Please see License File for more information.