NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #5058 most downloaded on Packagist
Hypermedia framework for object as a service
Latest stable
1.34.1
Last release 2 months ago
10 Sep 2026
Release timing varies
gaps range from 9 days to 3 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
149 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
Bind HttpResourceObject explicitly in HttpClientModule; HttpAdapter::get() resolves it by class, which required just-in-time binding and failed under
HttpResourceObject explicitly in HttpClientModule; HttpAdapter::get()
resolves it by class, which required just-in-time binding and failed under
CompiledInjector (#379)### Fixed - #[Link] now renders title and non-default method in HAL links
#[Link] now renders title and non-default method in HAL linksHttpRequestException for HTTP transport and response parsing failures
Your coding agent can read these notes before it upgrades. Set up the MCP server →
HttpRequestException for HTTP transport and response parsing failuresJsonSchemaException::getErrors() returning typed JsonSchemaError / ConstraintViolation DTOs through a JsonSchemaErrors collection (#364)JsonSchemaRequestException / JsonSchemaResponseException subclasses for source discrimination at catch sites (#369)AbstractRequest::__invoke()HalRenderer now evaluates embedded AbstractRequest instances via (string) cast instead of direct __invoke(), allowing lazy/batch decorators (e.g. bear
HalRenderer now evaluates embedded AbstractRequest instances via (string) cast instead of direct __invoke(), allowing lazy/batch decorators (e.g. bear/async's AsyncRequest) to short-circuit invocation (#360).HalRenderer on same-schema sibling embeds before evaluation so batch decorators preserve _links on flushed siblings (#360).AbstractRequest::jsonSerialize() return type to mixed for JsonSerializable interface compliance (#360).HalRenderer embed evaluation to handle mixed return from jsonSerialize() (#360)Allow JsonSchemaInterceptor request validation to flatten Ray.InputQuery #[Input] DTO arguments before JSON Schema validation.
JsonSchemaInterceptor request validation to flatten Ray.InputQuery #[Input] DTO arguments before JSON Schema validation.ResourceClient class — stateless ResourceInterface implementation safe for coroutine/async environments
ResourceClient class — stateless ResourceInterface implementation safe for coroutine/async environmentsMethod enum for type-safe HTTP method parametersResourceClient::newRequest() for direct request creation without fluent interfaceLinkCrawler extracted from Linker for coroutine safetyLinker delegates list detection to LinkCrawler for shared logicEmbedInterceptorInterface for swappable embed implementations
EmbedInterceptorInterface for swappable embed implementations
EmbedInterceptor now implements this interfaceEmbedResourceModule binds via the interface for extensibilityAdd Psalm taint annotations for security analysis
Add Psalm taint annotations for security analysis
@psalm-taint-specialize to AbstractUri::__toString()Ray.InputQuery #[Input] attribute support for OPTIONS method
#[Input] attribute support for OPTIONS method
#[Input] parameters to show constructor properties#[Input] attribute existedOptionsMethodRequest parameter processing for improved maintainability
PHP 8 Attributes Migration: Removed doctrine/annotations and doctrine/cache dependencies, migrated to native PHP 8 attributes
doctrine/annotations and doctrine/cache dependencies, migrated to native PHP 8 attributesdoctrine/annotations (abandoned package)doctrine/cache (abandoned package)symfony/polyfill-php83 (unnecessary for PHP 8.2+).gitignore for .phpunit.cache directoryApplications using annotations must migrate to PHP 8 attributes:
composer require --dev bearsunday/rector-bearsunday
# Preview changes
vendor/bin/rector process src --config=vendor/bearsunday/rector-bearsunday/rector.php --dry-run
# Apply migration
vendor/bin/rector process src --config=vendor/bearsunday/rector-bearsunday/rector.php
The doctrine/annotations package has been officially abandoned by its maintainers. This change:
Full changelog: https://github.com/bearsunday/BEAR.Resource/blob/1.x/CHANGELOG.md
@depends → #[Depends], @dataProvider → #[DataProvider])nocarrier/hal with koriym/hal ^1.1getAnnotationParamMetas, getAssistedNames, addNamedParams, getWebContext, setAssistedAnnotation, getInsFromMethodAnnotations)doctrine/annotations dependencysymfony/polyfill-php83 dependency@CookieParam annotation docblocksMigration Guide: Use bearsunday/rector-bearsunday to automatically convert annotations to attributes.
.gitignore for .phpunit.cache directoryUpdated ray/input-query dependency to version ^1.0
ray/input-query dependency to version ^1.0https://github.com/bearsunday/BEAR.Resource/compare/v1.26.2...v1.26.3
Updated ray/input-query dependency to version ^0.3.0
ray/input-query dependency to version ^0.3.0This minor release updates the Ray.InputQuery dependency to support the latest features and improvements in version 0.3.0.
For full changelog, see: https://github.com/bearsunday/BEAR.Resource/blob/1.x/CHANGELOG.md
Exception handling in parameter resolution: Fixed issue where InvalidArgumentException from Ray.InputQuery was not properly caught and converted to Pa
InvalidArgumentException from Ray.InputQuery was not properly caught and converted to ParameterException, causing unhandled exceptions when empty queries were passed to resource methods.This patch release ensures that the Ray.InputQuery integration introduced in 1.26.0 properly handles parameter validation errors in a way that's consistent with the framework's exception handling patterns.
When Ray.InputQuery integration was added in 1.26.0, it introduced InvalidArgumentException for missing parameters, but NamedParameter was not catching these exceptions. This caused unhandled exceptions to bubble up when empty queries were passed to various methods that previously caught ParameterException.
The fix properly catches InvalidArgumentException from Ray.InputQuery and converts it to ParameterException to maintain backward compatibility and consistent error handling throughout the framework.
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.26.0...1.26.1
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.26.0...1.26.1
BEAR.Resource 1.26.0 introduces a groundbreaking paradigm that creates perfect 1:1 mapping between HTML forms and PHP method signatures - the first of
BEAR.Resource 1.26.0 introduces a groundbreaking paradigm that creates perfect 1:1 mapping between HTML forms and PHP method signatures - the first of its kind in web development history!
<\!-- Your HTML Form -->
<form enctype="multipart/form-data">
<input name="name" value="John Doe" required>
<input name="email" type="email" value="john@example.com" required>
<input name="avatar" type="file" accept="image/*">
<input name="documents[]" type="file" multiple accept=".pdf">
</form>
// PHP Constructor (Perfect Mirror\!)
final class UserRegistration
{
public function __construct(
#[Input] string $name,
#[Input] string $email,
#[InputFile(allowedTypes: ['image/jpeg', 'image/png'])]
?FileUpload $avatar = null,
#[InputFile(allowedExtensions: ['pdf'])]
array $documents = []
) {}
}
This is not just similar - it's IDENTICAL structure! 🤯
// HTTP Request: ?name=John&addressStreet=123&addressCity=Tokyo
// Automatically becomes:
final class UserInput {
public function __construct(
#[Input] public readonly string $name,
#[Input] public readonly AddressInput $address // Nested object\!
) {}
}
$user = $inputQuery->newInstance(UserInput::class, $_GET);
echo $user->address->street; // "123" - Perfect hierarchy\!
Key Innovation: addressStreet and addressCity automatically compose the AddressInput object.
Unlike DTOs or Entities, Input classes are dedicated to representing input structure:
final class CheckoutInput {
public function __construct(
#[Input] public readonly CartInput $cart,
#[Input] public readonly ShippingAddressInput $shipping,
#[Input] public readonly PaymentMethodInput $payment,
#[Input] public readonly ?string $couponCode = null
) {}
}
This IS your checkout form structure - not an approximation!
// BEAR.Resource magic - just define the structure
public function onPost(UserRegistrationInput $input): static
{
// $input->avatar is already a validated FileUpload object
// $input->documents is already an array of FileUpload objects
return $this->userService->register($input);
}
// Testing is trivial
$mockAvatar = FileUpload::fromFile(__DIR__ . '/fixtures/avatar.jpg');
$input = new UserRegistrationInput(
name: 'Test User',
email: 'test@example.com',
avatar: $mockAvatar,
documents: []
);
[Type-Safe Zone ←→ Type-Safe Zone ←→ Type-Safe Zone]
HTML Form Input Classes Domain Objects
No more "type-less void" between your form and your business logic!
// Traditional: "How to parse this data?"
$title = $_POST['title'] ?? '';
if (empty($title)) throw new ValidationException('Title required');
// Ray.InputQuery: "What should this data be?"
final class TodoInput {
public function __construct(
#[Input] public readonly string $title, // Validation implicit
#[Input] public readonly AuthorInput $author
) {}
}
Instead of writing parsing code, you declare the structure. The framework handles the rest.
Clear, structured inputs make AI code generation natural:
AbstractFileUpload return types in InputFormParam and InputFormsParamTypes.php for bulletproof type safety// Production: Automatic file processing
$input = $inputQuery->newInstance(UserProfileInput::class, $_POST);
// Testing: Simple mock injection
$input = new UserProfileInput(
name: 'Test',
avatar: FileUpload::fromFile('test.jpg')
);
Input Classes (PHP)
/ \
/ \
HTML Forms JSON Schema
(Interface) (Contract)
All three representations of the same structure!
Traditional: Validation Everywhere (Expensive)
┌─────────────────┐
│ Controller │ ← Validate
├─────────────────┤
│ Service │ ← Validate again
├─────────────────┤
│ Repository │ ← Validate again
└─────────────────┘
Input-First: Validation Once (Efficient)
┌─────────────────┐
│ Input Boundary │ ← ALL validation here
├─────────────────┤
│ Controller │ ← Trust
├─────────────────┤
│ Service │ ← Trust
├─────────────────┤
│ Repository │ ← Trust
└─────────────────┘
Result: Validate once at the boundary, trust everywhere else.
This isn't just an update - it's a fundamental advancement in web development:
BEAR.Resource 1.26.0 represents the evolution from:
This is not just a library update - it's the future of web application development! 🚀
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.25.0...1.26.0
Join the Input-First revolution and experience the future of web development today!
AbstractFileUpload return types in InputFormParam and InputFormsParamInputParam class for handling input query parametersTypes.php for improved type safetyray/input-query dependency to version ^0.2.0koriym/file-upload dependency to version ^0.2.0create method with newInstance for inputQuery instantiationray/input-query: ^0.2.0koriym/file-upload: ^0.2.0ext-fileinfo: * (required for Windows CI compatibility)A handler interface has been created that is called when the validation of the schema specified in JsonSchema is not enabled when entering a request.
A handler interface has been created that is called when the validation of the schema specified in JsonSchema is not enabled when entering a request.
public function handleRequestException(
array $arguments,
ResourceObject $ro,
JsonSchemaException $e,
string $schemaFile,
)
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.24.0...1.25.0
JsonSchemaRequestExceptionHandlerInterfaceUpdate license copyright year(s) by @github-actions in https://github.com/bearsunday/BEAR.Resource/pull/311
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.23.0...1.24.0
rize/uri-template requirement from ^0.3 to ^0.4assertSame with assertJsonStringEqualsJsonString in testsMake koriym/json-schema-faker package optional by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/309
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.22.5...1.23.0
Update json-schema dependency for broader compatibility by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/307
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.22.4...1.22.5
Update dependabot.yml by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/299
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.22.3...1.22.4
Change HTTP client in symfony/cache to Curl by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/296
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.22.2...1.22.3
Incorrect phpdoc type specification is corrected; an error with a false positive in phpstan is repaired.
Incorrect phpdoc type specification is corrected; an error with a false positive in phpstan is repaired.
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.22.1...1.22.2
Thanks @KazuyaUchida !
Cleanup deprecated test by @NaokiTsuchiya in https://github.com/bearsunday/BEAR.Resource/pull/295
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.22.0...1.22.1
It was a tedious task that had to be done at some point. Thnaks @NaokiTsuchiya
Introduced: a Self link feature that enhances the linking capabilities within the application. This allows resources to directly link to themselves us
Introduced: a Self link feature that enhances the linking capabilities within the application. This allows resources to directly link to themselves using the _self keyword, streamlining the process of assigning a resource's body to another without an intermediary.
#[Embed(rel: "_self", src: "app://self/bar")]
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.21.0...1.22.0
<img width="600" alt="三春の大滝" src="https://github.com/bearsunday/BEAR.Resource/assets/529021/ee3af3cc-1cbd-47e5-88c1-558a00c0a792">
`php public function _invokeRequest(InvokerInterface $invoker, AbstractRequest $request): ResourceObject; `
public function _invokeRequest(InvokerInterface $invoker, AbstractRequest $request): ResourceObject;
上記のインターフェイスがResourceObjectに実装され、ResourceObjectはリソースリクエストを自分自身が行うようになりました。 The above interface is implemented in ResourceObject, and ResourceObject now makes resource requests itself.
public function _invokeRequest(InvokerInterface $invoker, AbstractRequest $request): ResourceObject
{
return $invoker->invoke($request);
}
transfer()と同じように外部からサービスオブジェクトが渡され自身が実行します。ユーザーはこのメソッドをオーバーライドして実行部分を上書きする事ができます。 Like transfer(), a service object is passed from the outside and executed by itself. The user can override this method to override the execution part.
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.20.2...1.21.0
Fixed issue with RequiredParam handling null by @jingu in https://github.com/bearsunday/BEAR.Resource/pull/285
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.20.1...1.20.2
Enum exceptions in more detail by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/284
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.20.0...1.20.1
Doc change: https://github.com/bearsunday/bearsunday.github.io/pull/245
Fix README by @wand2016 in https://github.com/bearsunday/BEAR.Resource/pull/279
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.19.1...1.20.0
Update license copyright year(s) by @github-actions in https://github.com/bearsunday/BEAR.Resource/pull/276
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.19.0...1.19.1
Add ResourceObjectModule by @NaokiTsuchiya in https://github.com/bearsunday/BEAR.Resource/pull/275
🎉 * @NaokiTsuchiya made their first contribution in https://github.com/bearsunday/BEAR.Resource/pull/275
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.18.1...1.19.0
PHP 7.4 reached EOL yesterday (28 Nov 2022) and this package will also support PHP 8.0 and above. https://www.php.net/eol.php
PHP 7.4 reached EOL yesterday (28 Nov 2022) and this package will also support PHP 8.0 and above. https://www.php.net/eol.php
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.6...1.18.1
PHP 8.2 Support by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/269
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.5...1.18.0
PHP 8.2 Support by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/269
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.5...1.17.6
Support psr/log 2 and 3 by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/268
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.4...1.17.5
Constructor support for Input class by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/266
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.3...1.17.4
JsonSchema supports "target=view" by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/264
Added option to validate not only the body of a ResourceObject, but also the view.
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.2...1.17.3
Bump phpstan from 1.4.2 to 1.4.6 by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/261
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.1...1.17.2
Wrong type bad request by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/260
@yuki777 Thanks for the reporting issue!
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.17.0...1.17.1
Create .update-copyright-years-in-license-file by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/254
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.16.3...1.17.0
json_encode to have a string expression by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/253
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.16.1...1.16.3
Fix PHP 8.1 deprecation warnings by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/250
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.16.0...1.16.2
Fix PHP 8.1 deprecation warnings by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/250
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.16.0...1.16.1
In AOP, bind interfaces, not classes by @koriym in https://github.com/bearsunday/BEAR.Resource/pull/247
Full Changelog: https://github.com/bearsunday/BEAR.Resource/compare/1.15.6...1.16.0
Recommend to update bear/package 1.10.12
Recommend to update bear/package 1.10.12
Update HTTP output headers format as same as ResourceObject #245
Change AppName binding optional #243
Fix Embedded request issue #242
Nothing published for this version
Make it work without an annotation reader #238
* Support PHP 8 attributes * Update CI to GH actions
* Fix #231 Thanks @jingu !
Thanks @jingu !
Forward compatible with PHP 8 #228
Fix InvalidKeyJsonSchemaand add test #222
InvalidKeyJsonSchemaand add test #222@chanshige Thank you for the reporting issue!
@chanshige Thank you for the reporting issue!
@yuki777 Thanks reporting the issue !
@yuki777 Thanks reporting the issue !
Fix the BC: Removing the return type void in php, which should be done in phpdoc issue #217 @apple-x-co
@apple-x-co Thanks for the reporting issue and PR!
<img src="https://user-images.githubusercontent.com/529021/85219219-ed156200-b3dc-11ea-958b-749e8d7058ac.png" width=500>
Clear crawler cache #208 (required for "singleton injector" in phpunit)
declare(strict_type=1) from Invoker, User code can use declare(strict_type=1) #212<img src="https://user-images.githubusercontent.com/529021/83973837-f0601680-a923-11ea-8b82-465f7c610f19.png" width=300> Spacex - first docking (2020/6/1)
Nothing published for this version
`php public function onGet(int $id) // caused type error in the previous version. `
No error caused in this code.
public function onGet(int $id) // caused type error in the previous version.
* Drop EOL php 7.1 * Support php 7.4 狩野永徳 - 花鳥風月
<img src="https://user-images.githubusercontent.com/529021/70094464-ea803480-1665-11ea-8e11-cbec95777921.png" width=300> 狩野永徳 - 花鳥風月
Nothing published for this version
One column per quarter.