PHPackages                             bear/devtools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bear/devtools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bear/devtools
=============

1.4.0(2w ago)1264.1k↑96.8%33MITPHPPHP ^8.2CI passing

Since Jun 24Pushed 2w ago2 watchersCompare

[ Source](https://github.com/bearsunday/BEAR.DevTools)[ Packagist](https://packagist.org/packages/bear/devtools)[ RSS](/packages/bear-devtools/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (25)Versions (25)Used By (3)

BEAR.DevTools
=============

[](#beardevtools)

Development tools and utilities for BEAR.Sunday framework applications.

[![Latest Stable Version](https://camo.githubusercontent.com/4c1163866de75abc93b9b4a84edd425ac54f61ce6a4f3aae2739c624aa0eef6a/68747470733a2f2f706f7365722e707567782e6f72672f626561722f646576746f6f6c732f762f737461626c65)](https://packagist.org/packages/bear/devtools)[![Total Downloads](https://camo.githubusercontent.com/df917561b35f4ed3012d50c99017875d41deb79f43556695fe683ccfb28ed707/68747470733a2f2f706f7365722e707567782e6f72672f626561722f646576746f6f6c732f646f776e6c6f616473)](https://packagist.org/packages/bear/devtools)[![License](https://camo.githubusercontent.com/6692b14c7295d55bfd736410ef63fdfc4eb2bd59dc70f2316cd00e234823ae7e/68747470733a2f2f706f7365722e707567782e6f72672f626561722f646576746f6f6c732f6c6963656e7365)](https://packagist.org/packages/bear/devtools)

Installation
------------

[](#installation)

```
composer require --dev bear/devtools
```

Features
--------

[](#features)

### Halo Module - Resource Development Inspector

[](#halo-module---resource-development-inspector)

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](http://www.seaside.st/) 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 Client - HTTP Testing Utility

[](#httpresource-client---http-testing-utility)

`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 STDERR, a single file, or per-test files)
- Full HTTP method support (GET, POST, PUT, PATCH, DELETE)
- HAL link following with `href()`
- Request/response capture for testing workflows

```
use BEAR\Dev\Http\HttpResource;

// Start the built-in server and create an HTTP client.
// The third argument is the log destination and is optional
// (defaults to 'php://stderr'):
//   - 'php://stderr'       : write logs to STDERR (default)
//   - '/path/to/file.log'  : write every request to a single file
//   - '/path/to/log'       : a directory; one '.log' per test method
$resource = new HttpResource('127.0.0.1:8080', '/path/to/public/index.php', __DIR__ . '/log');

// Make HTTP requests
$ro = $resource->get('/users');
assert($ro->code === 200);

$ro = $resource->post('/users', ['name' => 'John', 'email' => 'john@example.com']);
assert($ro->code === 201);
```

#### Following HAL links

[](#following-hal-links)

`href()` follows a HAL `_links` relation from a response with a `GET` request:

```
$index = $resource->get('/');
// {"_links": {"next": {"href": "/users"}}}

$users = $resource->href('next', [], $index);
assert($users->code === 200);
```

A `HalLinkNotFoundException` is thrown when the relation or its `href` is missing.

#### HTTP Access Log

[](#http-access-log)

Each request is logged with its equivalent `curl` command followed by the raw response:

```
curl -s -i 'http://127.0.0.1:8080/users'

HTTP/1.1 200 OK
Content-Type: application/hal+json
...
```

### Workflow Testing

[](#workflow-testing)

`AbstractWorkflowTest` is the base contract for rel-driven workflow tests. Write the workflow once against `ResourceInterface`, then run the same scenario over HTTP by extending the concrete workflow test and overriding only `newResource()`with `HttpResource`.

```
use BEAR\Dev\Http\AbstractWorkflowTest;
use BEAR\Resource\ResourceInterface;
use BEAR\Resource\ResourceObject;
use MyVendor\MyProject\Injector;

use function assert;

class WorkflowTest extends AbstractWorkflowTest
{
    protected function newResource(): ResourceInterface
    {
        $resource = Injector::getInstance('app')->getInstance(ResourceInterface::class);
        assert($resource instanceof ResourceInterface);

        return $resource;
    }

    public function testIndex(): ResourceObject
    {
        $index = $this->resource->get('/index');
        $this->assertSame(200, $index->code);

        return $index;
    }

    /** @depends testIndex */
    public function testNext(ResourceObject $response): ResourceObject
    {
        return $this->follow($response, 'next');
    }
}
```

```
use BEAR\Dev\Http\HttpResource;
use BEAR\Resource\ResourceInterface;
use MyVendor\MyProject\Hypermedia\WorkflowTest as Workflow;

class WorkflowTest extends Workflow
{
    protected function newResource(): ResourceInterface
    {
        return new HttpResource('127.0.0.1:8088', __DIR__ . '/index.php', __DIR__ . '/log');
    }
}
```

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- ext-curl
- BEAR.Sunday framework

Development
-----------

[](#development)

This package includes comprehensive development tools:

- **Code Quality**: PHPStan, Psalm, PHP\_CodeSniffer
- **Testing**: PHPUnit with coverage reporting
- **Profiling**: XHProf integration (optional)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

61

—

FairBetter than 98% of packages

Maintenance96

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 95.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~145 days

Recently: every ~77 days

Total

16

Last Release

20d ago

Major Versions

0.1.4 → 1.0.02021-05-10

PHP version history (4 changes)0.1.0PHP &gt;=7.2.0

0.1.4PHP ^7.3 || ^8.0

1.2.0PHP ^8.0

1.3.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/db4fc75ffc631168d0d7143b6f2c24b1534dfb921212bd851c026c5cbbb1344d?d=identicon)[koriym](/maintainers/koriym)

---

Top Contributors

[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (252 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (10 commits)")[![momospnr](https://avatars.githubusercontent.com/u/1066913?v=4)](https://github.com/momospnr "momospnr (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bear-devtools/health.svg)

```
[![Health](https://phpackages.com/badges/bear-devtools/health.svg)](https://phpackages.com/packages/bear-devtools)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[bear/package

BEAR.Sunday application framework package

31566.2k27](/packages/bear-package)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
