Releases: ray-di/Ray.Di
2.18.0
What's Changed
- Bug fix: Handle missing dependencies in setter methods with #[Inject(optional: true)] by @koriym in #292
- PHP 8.4 Support: Update CI to support PHP 8.4 and include PHP 8.3 in old_stable by @koriym in #293
- Enhance code quality with Psalm annotations by @koriym in #294
Full Changelog: 2.17.2...2.18.0
2.17.2
What's Changed
PDOをプロパティに持つクラスは通常シリアライズができませんが、以下のようにPDOではなくPDOのプロバイダーを注入することによりシリアライズが可能になります。
Classes that have PDO as a property cannot normally be serialized, but they can be serialized by injecting a lazy object as follows.
class LazyPdo
{
private PDO $pdo;
public function __construct(
/** ProviderInterface<PDO> */
#[Set(PDO::class)] private ProviderInterface $pdoProvider
) {
$this->pdoProvider = $pdoProvider;
$this->initialize($pdoProvider);
}
public function initialize(ProviderInterface $pdoProvider)
{
$this->pdo = $this->pdoProvider->get();
}
public function __serialize(): array
{
return [
'pdoProvider' => $this->pdoProvider
];
}
public function __unserialize(array $data): void
{
$this->pdoProvider = $data['pdoProvider'];
$this->initialize($data['pdoProvider']);
}
}
Full Changelog: 2.17.1...2.17.2
2.17.1
2.16.1
2.16.0
What's Changed
Starting with this version, the doctrine/annotation dependency is removed and annotations are read from reflection through the methods of Ray.Aop. Aop is expected to improve the execution speed during development and heccompilation.
このバージョンからdoctrine/annotationの依存がなくなりアノテーションの読み込みはRay.Aopのメソッドを通じて、リフレクションより行われます。Ray.Aopのアノテーションの読み込みは、対象ファイルの更新日付に基づいた恒久的なものになり開発時やヘコンパイル時の実行速度の向上が期待でできます。
Full Changelog: 2.15.1...2.16.0
2.15.1
What's Changed
- Update license copyright year(s) by @github-actions in #281
- Bump ray/aop and nikic/php-parser by @NaokiTsuchiya in #283
New Contributors
- @NaokiTsuchiya made their first contribution in #283
Full Changelog: 2.15.0...2.15.1
2.15.0
What's Changed
- Set tmpdir in environment variable by @koriym in #278 (for testing only)
- Remove implicit untarget bindings by @koriym in #279
Important 【重要】
See #280
Explicit untargeted binding is required even when the dependency is a concrete class.
Most of the time this is not a problem, but if you get an Unbound
exception with a concrete class dependency, untarget bound.
依存が具象クラスの時にも明示的なアンターゲット束縛が必要です。
ほとんどの場合問題ありませんが、もし具象クラスの依存でUnbound
例外が発生したらアンターゲット束縛してください。
Full Changelog: 2.14.5...2.15.0
2.14.5
2.14.1
What's Changed
- Fix "Unable to compile with AOP applied to objects created with Null binding" ray-di/Ray.Compiler#83 (#272) @jingu Thanks for the reporting issue!
- Ray.Compiler to be separated again and require from composer.json #273 #274
Full Changelog: 2.14.0...2.14.1
2.14.0
What's Changed
- Add ModuleMerger by @koriym in #258
- Update README by @koriym in #259
- Provider injection with Set attribute by @koriym in #262
- Multi binding by @koriym in #263
- Support toProvider, toInstance() bind in multibindings by @koriym in #264
- Add generics syntax to ProviderInterface by @koriym in #269
Full Changelog: 2.13.3...2.14.0