Skip to content

Releases: ray-di/Ray.Di

2.18.0

29 Nov 15:49
a7dc251
Compare
Choose a tag to compare

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

10 Sep 16:24
3155fc6
Compare
Choose a tag to compare

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

27 May 13:52
f6f39ef
Compare
Choose a tag to compare

What's Changed

  • Implements visitor pattern #289
  • Add MultiBindings class to configuration in DI module by @koriym in #290

v2.17.0 was found to contain errors and was immediately withdrawn and replaced by v2.17.1.

Full Changelog: 2.17.0...2.17.1

2.16.1

21 Sep 08:59
c94cec2
Compare
Choose a tag to compare

What's Changed

Full Changelog: 2.16.0...2.16.1

2.16.0

15 Sep 07:23
fac2d0a
Compare
Choose a tag to compare

What's Changed

  • Remove doctrine/annotation by @koriym in #284
  • Support PHP 8.3

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

13 Jan 02:49
751e66b
Compare
Choose a tag to compare

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

Full Changelog: 2.15.0...2.15.1

2.15.0

06 Dec 11:31
53bb56b
Compare
Choose a tag to compare

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

04 Jul 04:09
1143ded
Compare
Choose a tag to compare

What's Changed

Full Changelog: 2.14.1...2.14.5

2.14.1

24 Mar 00:08
a318795
Compare
Choose a tag to compare

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

10 Mar 08:00
df0f6f5
Compare
Choose a tag to compare

What's Changed

Full Changelog: 2.13.3...2.14.0

image