diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml
index 7ba88b1b..50cd6323 100644
--- a/.github/workflows/coding-standards.yml
+++ b/.github/workflows/coding-standards.yml
@@ -34,8 +34,5 @@ jobs:
- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist
- - name: Validate composer.json
- run: composer validate --strict
-
- name: Run PHP_CodeSniffer
run: ./vendor/bin/phpcs -q --no-colors --report=checkstyle src tests | cs2pr
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 03c04276..d98a57ba 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -17,9 +17,11 @@ jobs:
- ubuntu-latest
- windows-latest
php-version:
+ - '7.2'
- '7.3'
- '7.4'
- '8.0'
+ - '8.1'
dependencies:
- lowest
- highest
diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml
new file mode 100644
index 00000000..fc00479f
--- /dev/null
+++ b/.github/workflows/update-copyright-years-in-license-file.yml
@@ -0,0 +1,17 @@
+name: Update copyright year(s) in license file
+
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: "0 3 1 1 *"
+
+jobs:
+ run:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ with:
+ fetch-depth: 0
+ - uses: FantasticFiasco/action-update-license-year@v2
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
index d94453de..552f1f29 100644
--- a/.scrutinizer.yml
+++ b/.scrutinizer.yml
@@ -1,15 +1,8 @@
+build:
+ nodes:
+ analysis:
+ tests:
+ override:
+ - php-scrutinizer-run
filter:
paths: ["src/*"]
-tools:
- php_sim: true
- php_pdepend: true
- php_analyzer: true
- php_cpd: true
- php_mess_detector:
- enabled: true
- config:
- ruleset: ./phpmd.xml
- php_code_sniffer:
- enabled: true
- config:
- ruleset: ./phpcs.xml
diff --git a/LICENSE b/LICENSE
index 3675648e..54553f68 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2012-2021 Akihito Koriyama
+Copyright (c) 2012-2022 Akihito Koriyama
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.ja.md b/README.ja.md
deleted file mode 100644
index f8c0cc52..00000000
--- a/README.ja.md
+++ /dev/null
@@ -1,693 +0,0 @@
-# Ray.Di
-
-## Dependency Injection framework #
-
-[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ray-di/Ray.Di/badges/quality-score.png?b=2.x)](https://scrutinizer-ci.com/g/ray-di/Ray.Di/?branch=2.x)
-[![codecov](https://codecov.io/gh/ray-di/Ray.Di/branch/2.x/graph/badge.svg?token=KCQXtu01zc)](https://codecov.io/gh/ray-di/Ray.Di)
-[![Type Coverage](https://shepherd.dev/github/ray-di/Ray.Di/coverage.svg)](https://shepherd.dev/github/ray-di/Ray.Di)
-[![Build Status](https://scrutinizer-ci.com/g/ray-di/Ray.Di/badges/build.png?b=2.x)](https://scrutinizer-ci.com/g/ray-di/Ray.Di/build-status/2.x)
-[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/ray-di/Ray.Di/Continuous%20Integration/2.x)](https://github.com/ray-di/Ray.Di/actions)
-[![Total Downloads](https://poser.pugx.org/ray/di/downloads)](https://packagist.org/packages/ray/di)
-
-**Ray.Di**はGoogleの[Guice](http://code.google.com/p/google-guice/wiki/Motivation?tm=6)の主要な機能を持つPHPのDIフレームワークです。
-
-Note: For PHP 8.x users, please see [README.md](README.md).
-
-## 概要
-
-Ray.Diには以下の機能があります。
-
-- コンストラクタインジェクションとセッターインジェクション
-
-- 自動ワイアリング
-
-- コンストラクタの後の初期化
-
-- PHPのファクトリーコード生成
-
-- 名前付きインターフェイス
-
-- インジェクションポイントメタデータ
-
-- インスタンスファクトリー
-
-- アノテーションはオプション
-
-- AOP統合
-
-- Nullオブジェクト
-
-# 始めよう
-
-## オブジェクトグラフの作成
-
-DIではそのオブジェクトを作るのに必要なオブジェクトや値を**依存**としてコンストラクタで受け取ります。その依存を作るためにも、他の依存が必要です。そうやってオブジェクトを作るのには結局オブジェクトの**グラフ**が必要になります。
-
-オブジェクトグラフを手動で作成するのは骨の折れる仕事です。テストも難しくなります。代わりにRay.Diがオブジェクトグラフを作ります。そのためには最初にどういうグラフを必要としてるのかを正確に設定しないといけません。
-
-説明のために`BillingService`という`ProcessorInterface`と`LoggerInterface`を必要とするクラスを作ることから始めます。
-
-```php
-class BillingService
-{
- private $processor;
- private $logger
-
- public function __construct(ProcessorInterface $processor, LoggerInterface $logger)
- {
- $this->processor = $processor;
- $this->logger = $logger;
- }
-}
-```
-
-Ray.Di はインターフェイスとその実装をマップするために束縛(バインド)します。`モジュール`はその束縛を英語のように表記したものの集まりです。
-
-```php
-class BillingModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bind(ProcessorInterface::class)->to(PaypalProcessor::class);
- $this->bind(LoggerInterface::class)->to(DatabaseLogger::class);
- }
-}
-```
-
-`Ray.Di` がオブジェクトグラフを作るためにはモジュールが必要です。まずはモジュールでインジェクターを作って、そのインジェクターで`BillingService`を組み立てます。
-
-```php
-$injector = new Injector(new BillingModule);
-$billingService = $injector->getInstance(BillingService::class);
-```
-
-# インジェクション
-
-## コンストラクタインジェクション
-
-コンストラクタインジェクションはインジェクションとオブジェクトの生成を一緒にします。そこで使われるコンストラクタは依存を引数として受け取ります。ほとんどの場合コンストラクタはプロパティにその依存オブジェクトを割り当てます。コンストラクタインジェクションには`@Inject`アノテーションは必要ありません。
-
-```php
- public function __construct(DbInterface $db)
- {
- $this->db = $db;
- }
-```
-
-## セッターインジェクション
-
-`@Inject` アノテーションを持つメソッドでメソッドインジェクションをすることができます。依存は引数の形を取り、メソッド実行前にインジェクタに解決されます。メソッドインジェクションでは任意の引数を取ることができます。メソッド名は注入には影響しません。
-
-```php
- /**
- * @Inject
- */
- public function setDb(DbInterface $db)
- {
- $this->db = $db;
- }
-```
-
-## プロパティインジェクション
-
-プロパティインジェクションはサポートされません。
-
-## アシスティッドインジェクション
-
-メソッドが実行されるタイミングでメソッドの引数に依存を渡すことができます。そのためには依存を受け取る引数を`@Assisted`で指定し、引数リストの終わり(右)に移動して`null`をデフォルトとして与える必要があります。
-
-```php
-use Ray\Di\Di\Assisted;
-```
-
-```php
- /**
- * @Assisted({"db"})
- */
- public function doSomething($id, DbInterface $db = null)
- {
- $this->db = $db;
- }
-```
-
-`@Assisted`で提供される依存は、その時に渡された他の引数を参照して決定することもできます。そのためには依存を`プロバイダーバインディング`で束縛して、その[プロバイダー束縛](#provider-bidning)は`MethodInvocationProvider`を依存として受け取るようにします。`get()`メソッドでメソッド実行オブジェクト [MethodInvocation](https://github.com/ray-di/Ray.Aop/blob/2.x/src/MethodInvocation.php) を取得することができ、引数の値や対象のメソッドのプロパティにアクセスすることができます。
-
-```php
-class HorizontalScaleDbProvider implements ProviderInterface
-{
- /**
- * @var MethodInvocationProvider
- */
- private $invocationProvider;
-
- public function __construct(MethodInvocationProvider $invocationProvider)
- {
- $this->invocationProvider = $invocationProvider;
- }
-
- public function get()
- {
- $methodInvocation = $this->invocationProvider->get();
- list($id) = methodInvocation->getArguments()->getArrayCopy();
-
- return new UserDb($id); // $idによって接続データベースを切り替えます
- }
-}
-```
-
-# 束縛
-
-インジェクタの役目はオブジェクトグラフの構築です。インスタンスを型で要求されると生成すべきものを見つけて依存解決し、それらを結びつけます。依存解決の方法を指定するにはインジェクタに束縛で設定を行います。
-
-## リンク束縛 ##
-
-**Linked Bindings** はインターフェイスとその実装クラスを束縛します。
-
-```php
-namespace MovieApp;
-
-use Ray\Di\AbstractModule;
-use Ray\Di\Di\Inject;
-use Ray\Di\Injector;
-use MovieApp\FinderInterface;
-use MovieApp\Finder;
-
-interface FinderInterface
-{
-}
-
-interface ListerInterface
-{
-}
-
-class Finder implements FinderInterface
-{
-}
-
-class Lister implements ListerInterface
-{
- public $finder;
-
- /**
- * @Inject
- */
- public function setFinder(FinderInterface $finder)
- {
- $this->finder = $finder;
- }
-}
-
-class ListerModule extends AbstractModule
-{
- public function configure()
- {
- $this->bind(FinderInterface::class)->to(Finder::class);
- $this->bind(ListerInterface::class)->to(Lister::class);
- }
-}
-
-$injector = new Injector(new ListerModule);
-$lister = $injector->getInstance(ListerInterface::class);
-$works = ($lister->finder instanceof Finder::class);
-echo(($works) ? 'It works!' : 'It DOES NOT work!');
-
-// It works!
-```
-
-Linked Bindings はチェーンさせることができます。
-
-
-## プロバイダ束縛
-
-[Provider bindings](http://code.google.com/p/rayphp/wiki/ProviderBindings) はインターフェイスと実装クラスの**プロバイダー**を束縛します。
-
-プロバイダーは依存のインスタンスを`get`メソッドで返します。
-
-```php
-use Ray\Di\ProviderInterface;
-
-interface ProviderInterface
-{
- public function get();
-}
-```
-
-プロバイダーにも依存が注入されます。
-インスタンス生成にファクトリーコードが必要な時に **Provider Bindings**を使います。
-
-```php
-class DatabaseTransactionLogProvider implements Provider
-{
- private $connection;
-
- public function __construct(ConnectionInterface $connection)
- {
- $this->connection = $connection;
- }
-
- public function get()
- {
- $transactionLog = new DatabaseTransactionLog;
- $transactionLog->setConnection($this->connection);
-
- return $transactionLog;
- }
-}
-```
-
-このようにして `toProvider()` メソッドを使ってプロバイダに束縛します。
-
-```php
-$this->bind(TransactionLogInterface::class)->toProvider(DatabaseTransactionLogProvider:class);
-```
-## コンテンキストプロバイダ束縛
-
-同じプロバイダーでコンテキスト別にオブジェクトを生成したい場合があります。例えば接続先の違う複数のDBオブジェクトを同じインターフェイスでインジェクトしたい場合などです。そういう場合には`toProvider()`でコンテキスト(文字列)を指定して束縛をします。
-
-```php
-$dbConfig = ['user' => $userDsn, 'job'=> $jobDsn, 'log' => $logDsn];
-$this->bind()->annotatedWith('db_config')->toInstance(dbConfig);
-$this->bind(Connection::class)->annotatedWith('usr_db')->toProvider(DbalProvider::class, 'user');
-$this->bind(Connection::class)->annotatedWith('job_db')->toProvider(DbalProvider::class, 'job');
-$this->bind(Connection::class)->annotatedWith('log_db')->toProvider(DbalProvider::class, 'log');
-```
-
-プロバイダーはコンテキスト別に生成します。
-
-```php
-class DbalProvider implements ProviderInterface, SetContextInterface
-{
- private $dbConfigs;
-
- public function setContext($context)
- {
- $this->context = $context;
- }
-
- /**
- * @Named("db_config")
- */
- public function __construct(array $dbConfigs)
- {
- $this->dbConfigs = $dbConfigs;
- }
-
- /**
- * {@inheritdoc}
- */
- public function get()
- {
- $config = $this->dbConfigs[$this->context];
- $conn = DriverManager::getConnection(config);
-
- return $conn;
- }
-}
-```
-同じインターフェイスですが、接続先の違う別々のDBオブジェクトを受け取ります。
-
-```php
-/**
- * @Named("userDb=user_db,jobDb=job_db,logDb=log_db")
- */
-public function __construct(Connection $userDb, Connection $jobDb, Connection $logDb)
-{
- //...
-}
-```
-
-
-## 名前束縛
-
-Rayには`@Named`という文字列で`名前`を指定できるビルトインアノテーションがあります。同じインターフェイスの依存を`名前`で区別します。
-
-メソッドの引数が1つの場合
-
-```php
-/**
- * @Inject
- * @Named("checkout")
- */
-public RealBillingService(CreditCardProcessorInterface $processor)
-{
-...
-```
-
-メソッドの引数が複数の場合は`変数名=名前`のペアでカンマ区切りの文字列を指定します。
-
-```php
-/**
- * @Inject
- * @Named("processonr=checkout,subProcessor=backup")
- */
-public RealBillingService(CreditCardProcessorInterface $processor, CreditCardProcessorInterface $subProcessor)
-{
-...
-```
-
-名前を使って束縛するために`annotatedWith()`メソッドを使います。
-
-```php
-protected function configure()
-{
- $this->bind(CreditCardProcessorInterface::class)->annotatedWith('checkout')->to(CheckoutCreditCardProcessor::class)
-}
-```
-
-## インスタンス束縛
-
-`toInstance`は値を直接束縛します。
-
-```php
-protected function configure()
-{
- $this->bind(UserInterface::class)->toInstance(new User);
-}
-```
-
-定数は`@Named`を使って束縛します。
-
-```php
-protected function configure()
-{
- $this->bind()->annotatedWith("login_id")->toInstance('bear');
-}
-```
-
-## アンターゲット束縛
-
-ターゲットを指定しないで束縛をつくることができ、コンクリートクラスの束縛に便利です。事前にインジェクターに型の情報を伝えるので束縛を事前に行いエラー検知や最適化を行うことができます。
-Untargetted bindingsは以下のように`to()`が必要ありません。
-
-```php
-
-protected function configure()
-{
- $this->bind(MyConcreteClass::class);
- $this->bind(AnotherConcreteClass::class)->in(Scope::SINGLETON);
-}
-```
-
-## コンストラクタ束縛
-
-`@Inject`アノテーションのないサードパーティーのクラスやアノテーションを使いたくない時には`Provider`束縛を使うこともできますが、その場合インスタンスをユーザーコードが作成する事になりAOPが利用できません。
-
-この問題は`toConstructor`束縛で解決できます。インターフェイスにクラスを束縛するのは`to()`と同じですが、`@Named`やセッターメソッドの`@Inject`の指定をアノテートする事なしに指定できます。
-
-```php
-id = $id;
- $this->password = $password;
- }
-
- /**
- * @Inject
- */
- public function setGuzzle(ClientInterface $client)
- {
- $this->client = $client;
- }
-
- /**
- * @Inect(optional=true)
- * @Named("token")
- */
- public function setOptionalToken(string $token)
- {
- $this->token = $token;
- }
-
- /**
- * @PostConstruct
- */
- public function initialize()
- {
- }
-```
-
-上記のWebApiクラスをアノテーションを使わないでコンストラクタ束縛するにはこのようにします。
-
-
-```php
-bind(WebApiInterface::class)
- ->toConstructor(
- WebApi::class, // string $class_name
- [
- 'id' => 'user_id', // array $name
- 'passowrd' => 'user_password'
- ],
- (new InjectionPoints) // InjectionPoints $setter_injection
- ->addMethod('setGuzzle', 'token')
- ->addOptionalMethod('setOptionalToken'),
- 'initialize' // string $postCostruct
- );
- $this->bind()->annotated('user_id')->toInstance($_ENV['user_id']);
- $this->bind()->annotated('user_password')->toInstance($_ENV['user_password']);
-}
-```
-
-### Parameter
-
-**class_name**
-
-クラス名
-
-**name**
-
-名前束縛。配列か文字列で`引数名`と`束縛名の名前`をペアにして指定します。
-
-array `[[$parame_name => $binding_name],...]` or string `"param_name=binding_name&..."`
-
-**setter_injection**
-
-セッターインジェクションのメソッド名と`束縛名の名前`を指定したインジェクとポイントオブジェクト
-
-**postCosntruct**
-
-`@postCosntruct`と同じく全てのインジェクションが終わった後に呼ばれる初期化メソッド名。
-
-## PDO Example
-
-[PDO](http://php.net/manual/ja/pdo.construct.php)クラスの束縛の例です.
-
-```php
-public PDO::__construct ( string $dsn [, string $username [, string $password [, array $options ]]] )
-```
-
-```php
-protected function configure()
-{
- $this->bind(\PDO::class)->toConstructor(
- \PDO::class,
- [
- 'dsn' => 'pdo_dsn',
- 'username' => 'pdo_username',
- 'password' => 'pdo_password'
- ]
- )->in(Scope::SINGLETON);
- $this->bind()->annotatedWith('pdo_dsn')->toInstance($dsn);
- $this->bind()->annotatedWith('pdo_username')->toInstance($username);
- $this->bind()->annotatedWith('pdo_password')->toInstance($password);
-}
-```
-
-PDOのどのインターフェイスがないので`toConstructor()`メソッドの二番目の引数の名前束縛でP束縛しています
-
-## Nullオブジェクト束縛
-
-Null Objectはインターフェイスを実装していてもメソッドの中で何もしないオブジェクトです。
-`toNull()`で束縛するとインターフェイスからNullオブジェクトのコード生成され、そのインスタンスにバインドされます。
-
-```php
-protected function configure()
-{
- $this->bind(CreditCardProcessorInterface::class)->toNull();
-}
-```
-
-## スコープ
-
-デフォルトでは、Rayは毎回新しいインスタンスを生成しますが、これはスコープの設定で変更することができます。
-
-```php
-protected function configure()
-{
- $this->bind(TransactionLog::class)->to(InMemoryTransactionLog::class)->in(Scope::SINGLETON);
-}
-```
-
-## オブジェクトライフサイクル
-
-オブジェクトライフサイクルのアノテーションを使ってオブジェクトの初期化のメソッドを指定する事ができます。
-
-このメソッドは全ての依存がインジェクトされた後に呼ばれます。
-セッターインジェクションがある場合などでも全ての必要な依存が注入された前提にすることができます。
-
-```php
-/**
- * @PostConstruct
- */
-public function onInit()
-{
- //....
-}
-```
-## インストール
-
-モジュールは他のモジュールの束縛をインストールして使う事ができます。
-
- * 同一の束縛があれば先にされた方が優先されますが`overrinde`でインストールすると後からのモジュールが優先されインストールされます。
-
-```php
-protected function configure()
-{
- $this->install(new OtherModule);
- $this->override(new CustomiseModule);
-}
-```
-
-## アスペクト指向プログラミング
-
-Ray.Aopのアスペクト指向プログラミングが利用できます。
-
-```php
-class TaxModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bindInterceptor(
- $this->matcher->subclassesOf(RealBillingService::class),
- $this->matcher->annotatedWith('Tax'),
- [TaxCharger::class]
- );
- }
-}
-```
-
-```php
-class AopMatcherModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bindInterceptor(
- $this->matcher->any(), // In any class and
- $this->matcher->startWith('delete'), // ..the method start with "delete"
- [Logger::class]
- );
- }
-}
-```
-
-# ベストプラクティス
-
-可能な限りインジェクターを直接使わないコードにします。その代わりアプリケーションのbootstrapで **ルートオブジェクト** をインジェクトするようにします。
-このルートオブジェクトのクラスは依存する他のオブジェクトのインジェクションに使われます。その先のオブジェクトも同じで、依存が依存を必要として最終的にオブジェクトグラフが作られます。
-
-## パフォーマンスの向上
-
-### スクリプトインジェクタ
-
-`ScriptInjector` はパフォーマンス改善のためにファクトリーコードそれ自体を生成し、インスタンス生成の方法を分かりやすくします。
-
-```php
-
-use Ray\Di\ScriptInjector;
-use Ray\Compiler\DiCompiler;
-use Ray\Compiler\Exception\NotCompiled;
-
-try {
- $injector = new ScriptInjector($tmpDir);
- $instance = $injector->getInstance(ListerInterface::class);
-} catch (NotCompiled $e) {
- $compiler = new DiCompiler(new ListerModule, $tmpDir);
- $compiler->compile();
- $instance = $injector->getInstance(ListerInterface::class);
-}
-```
-
-インスタンスが生成されれば、生成されたファクトリーファイルを `$tmpDir` で見ることができるようになります。
-
-### キャッシュインジェクタ
-
-シリアライズをして高速にインジェクションを行うようにすることもできます。
-
-```php
-
-// save
-$injector = new Injector(new ListerModule);
-$cachedInjector = serialize($injector);
-
-// load
-$injector = unserialize($cachedInjector);
-$lister = $injector->getInstance(ListerInterface::class);
-```
-
-### CachedInjectorFactory
-
-CachedInejctorFactory`は、ノーマルのインジェクターとスクリプトインジェクターをハイブリッドで利用する事で開発とプロダクションの両方で最高のパフォーマンスを発揮します。
-
-インジェクターは、リクエストを超えてシングルトンオブジェクトを注入することができ、テストの速度が大幅に向上します。テストでの連続するPDO接続も(再利用されるため)接続リソースを使い果たすことがありません。
-
-詳細は [CachedInjectorFactory](https://github.com/ray-di/Ray.Compiler/issues/75) を参照してください。
-
-## Grapher
-
-`Grapher`では、コンストラクタの引数は手動で渡しその後のインジェクションを自動で行われます。
-(ルートオブジェクトのみオブジェクトの生成の仕組みをもつような)既存のシステムにRay.Diを導入するために便利です。AOPなども同様に使えます。
-
-```php
-// ...
-$grapher = new Grapher(new Module, __DIR__ . '/tmp');
-$instance = $grapher->newInstanceArgs(FooController::class, [$param1, $param2]);
-```
-
-Ray.Compilerは使用できません。パフォーマンス向上にはインジェクタをシリアライズして使います。
-
-## フレームワーク
-
- * [CakePHP3 PipingBag](https://github.com/lorenzo/piping-bag) by [@jose_zap](https://twitter.com/jose_zap)
- * [Symfony QckRayDiBundle](https://github.com/qckanemoto/QckRayDiBundle) and [sample project](https://github.com/qckanemoto/symfony-raydi-sample) by [@qckanemoto](https://twitter.com/qckanemoto)
- * [Radar](https://github.com/ray-di/Ray.Adr)
- * [BEAR.Sunday](https://github.com/koriym/BEAR.Sunday)
- * [Yii 1](https://github.com/koriym/Ray.Dyii)
-
-
-## モジュール
-
-`Ray.Di` のためのさまざまなモジュールが利用可能です。 https://github.com/Ray-Di
-
-## インストール
-
-Ray.Diをインストールにするには [Composer](http://getcomposer.org)を利用します。
-
-```bash
-# Add Ray.Di as a dependency
-$ composer require ray/di ^2.0
-```
-
-## テスト
-
-インストールしてテストとデモプログラムを実行します。
-
-```bash
-$ git clone https://github.com/ray-di/Ray.Di.git
-$ cd Ray.Di
-$ ./vendor/bin/phpunit
-$ php demo/run.php
-```
diff --git a/README.md b/README.md
index 35d4a6cb..bb85bd48 100644
--- a/README.md
+++ b/README.md
@@ -1,745 +1,15 @@
# Ray.Di
-## Dependency Injection framework #
+## A dependency injection framework for PHP
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ray-di/Ray.Di/badges/quality-score.png?b=2.x)](https://scrutinizer-ci.com/g/ray-di/Ray.Di/?branch=2.x)
[![codecov](https://codecov.io/gh/ray-di/Ray.Di/branch/2.x/graph/badge.svg?token=KCQXtu01zc)](https://codecov.io/gh/ray-di/Ray.Di)
[![Type Coverage](https://shepherd.dev/github/ray-di/Ray.Di/coverage.svg)](https://shepherd.dev/github/ray-di/Ray.Di)
-[![Build Status](https://scrutinizer-ci.com/g/ray-di/Ray.Di/badges/build.png?b=2.x)](https://scrutinizer-ci.com/g/ray-di/Ray.Di/build-status/2.x)
-[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/ray-di/Ray.Di/Continuous%20Integration/2.x)](https://github.com/ray-di/Ray.Di/actions)
+[![Continuous Integration](https://github.com/ray-di/Ray.Di/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/ray-di/Ray.Di/actions/workflows/continuous-integration.yml)
[![Total Downloads](https://poser.pugx.org/ray/di/downloads)](https://packagist.org/packages/ray/di)
-**Ray.Di** was created in order to get [Guice](https://github.com/google/guice/wiki) style dependency injection in PHP projects. It tries to mirror Guice's behavior and style.
+
-## Overview
+Ray.Di is DI and AOP framework for PHP inspired by [Google Guice](https://github.com/google/guice/wiki).
-The Ray.Di package provides a dependency injector
-with the following features:
-
-- Constructor injection and setter injection
-- Automatic injection
-- Post-construct initialization
-- Raw PHP factory code compiler
-- Binding annotations / attributes
-- Contextual injection with injection point meta data
-- Aspect oriented programming (AOP)
-- Assisted injection
-- Null object
-
-# Getting Started
-
-## Creating Object graph
-
-With dependency injection, objects accept dependencies in their constructors. To construct an object, you first build its dependencies. But to build each dependency, you need its dependencies, and so on. So when you build an object, you really need to build an object graph.
-
-Building object graphs by hand is labour intensive, error prone, and makes testing difficult. Instead, Ray.Di can build the object graph for you. But first, Ray.Di needs to be configured to build the graph exactly as you want it.
-
-To illustrate, we'll start the BillingService class that accepts its dependent interfaces in its constructor: ProcessorInterface and LoggerInterface.
-
-```php
-class BillingService
-{
- private ProcessorInterface $processor;
- private LoggerInterface $logger;
-
- public function __construct(ProcessorInterface $processor, LoggerInterface $logger)
- {
- $this->processor = $processor;
- $this->logger = $logger;
- }
-}
-```
-
-Ray.Di uses bindings to map types to their implementations. A module is a collection of bindings specified using fluent, English-like method calls:
-
-```php
-class BillingModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bind(ProcessorInterface::class)->to(PaypalProcessor::class);
- $this->bind(LoggerInterface::class)->to(DatabaseLogger::class);
- }
-}
-```
-
-The modules are the building blocks of an injector, which is Ray.Di's object-graph builder. First we create the injector, and then we can use that to build the BillingService:
-
-```php
-$injector = new Injector(new BillingModule);
-$billingService = $injector->getInstance(BillingService::class);
-```
-
-By building the billingService, we've constructed a small object graph using Ray.Di.
-
-# Injections
-
-## Constructor Injection
-
-Constructor injection combines instantiation with injection. This constructor should accept class dependencies as parameters. Most constructors will then assign the parameters to properties. You do not need `#[Inject]` attribute in constructor.
-
-```php
-public function __construct(DbInterface $db)
-{
- $this->db = $db;
-}
-```
-
-## Setter Injection
-
-Ray.Di can inject methods that have the `#[Inject]` attribute. Dependencies take the form of parameters, which the injector resolves before invoking the method. Injected methods may have any number of parameters, and the method name does not impact injection.
-
-```php
-use Ray\Di\Di\Inject;
-```
-
-```php
-#[Inject]
-public function setDb(DbInterface $db)
-{
- $this->db = $db;
-}
-```
-
-## Property Injection
-
-Ray.Di does not support property injection.
-
-## Assisted Injection
-
-It is also possible to inject dependencies directly in the invoke method parameter(s). When doing this, add the dependency to the end of the arguments and add `#[Assisted]` to the parameter(s). You need `null` default for that parameter.
-
-```php
-use Ray\Di\Di\Assisted;
-```
-
-```php
-public function doSomething($id, #[Assisted] DbInterface $db = null)
-{
- $this->db = $db;
-}
-```
-
-You can also provide dependency which depends on other dynamic parameter in method invocation. `MethodInvocationProvider` provides [MethodInvocation](https://github.com/ray-di/Ray.Aop/blob/2.x/src/MethodInvocation.php) object.
-
-```php
-class HorizontalScaleDbProvider implements ProviderInterface
-{
- public function __construct(
- private MethodInvocationProvider $invocationProvider)
- ){}
-
- public function get()
- {
- $methodInvocation = $this->invocationProvider->get();
- [$id] = $methodInvocation->getArguments()->getArrayCopy();
-
- return UserDb::withId($id); // $id for database choice.
- }
-}
-```
-
-# Bindings
-
-The injector's job is to assemble graphs of objects. You request an instance of a given type, and it figures out what to build, resolves dependencies, and wires everything together. To specify how dependencies are resolved, configure your injector with bindings.
-
-## Creating Bindings
-
-To create bindings, extend AbstractModule and override its configure method. In the method body, call bind() to specify each binding. These methods are type checked in compile can report errors if you use the wrong types. Once you've created your modules, pass them as arguments to **Injector** to build an injector.
-
-Use modules to create linked bindings, instance bindings, provider bindings, constructor bindings and untargetted bindings.
-
-```php
-class TweetModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bind(TweetClient::class);
- $this->bind(TweeterInterface::class)->to(SmsTweeter::class)->in(Scope::SINGLETON);
- $this->bind(UrlShortenerInterface)->toProvider(TinyUrlShortener::class)
- $this->bind('')->annotatedWith(Username::class)->toInstance("koriym")
- }
-}
-```
-
-## Linked Bindings
-
-Linked bindings map a type-hint to its implementation. This example maps the interface TransactionLogInterface to the implementation DatabaseTransactionLog:
-
-```php
-class BillingModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bind(TransactionLogInterface::class)->to(DatabaseTransactionLog::class);
- }
-}
-```
-
-## Provider Bindings ##
-
-Provider bindings map a type-hint to its provider.
-
-```php
-$this->bind(TransactionLogInterface::class)->toProvider(DatabaseTransactionLogProvider::class);
-```
-The provider class implements Ray's Provider interface, which is a simple, general interface for supplying values:
-
-```php
-namespace Ray\Di;
-
-interface ProviderInterface
-{
- public function get();
-}
-```
-Our provider implementation class has dependencies of its own, which it receives via a contructor.
-It implements the Provider interface to define what's returned with complete type safety:
-
-```php
-
-use Ray\Di\Di\Inject;
-use Ray\Di\ProviderInterface;
-
-class DatabaseTransactionLogProvider implements ProviderInterface
-{
- public function __construct(
- private ConnectionInterface $connection)
- ){}
-
- public function get()
- {
- $transactionLog = new DatabaseTransactionLog;
- $transactionLog->setConnection($this->connection);
-
- return $transactionLog;
- }
-}
-```
-
-Finally we bind to the provider using the `toProvider()` method:
-
-```php
-$this->bind(TransactionLogInterface::class)->toProvider(DatabaseTransactionLogProvider::class);
-```
-
-
-## Injection Point
-
-An **InjectionPoint** is a class that has information about an injection point.
-It provides access to metadata via `\ReflectionParameter` or an attribute in `Provider`.
-
-For example, the following `get()` method of `Psr3LoggerProvider` class creates injectable Loggers. The log category of a Logger depends upon the class of the object into which it is injected.
-
-```php
-class Psr3LoggerProvider implements ProviderInterface
-{
- public function __construct(
- private InjectionPointInterface $ip
- ){}
-
- public function get()
- {
- $logger = new \Monolog\Logger($this->ip->getClass()->getName());
- $logger->pushHandler(new StreamHandler('path/to/your.log', Logger::WARNING));
-
- return $logger;
- }
-}
-```
-`InjectionPointInterface` provides following methods.
-
-```php
-$ip->getClass(); // \ReflectionClass
-$ip->getMethod(); // \ReflectionMethod
-$ip->getParameter(); // \ReflectionParameter
-$ip->getQualifiers(); // (array) $qualifierAnnotations
-```
-
-## Instance Bindings
-
-```php
-protected function configure()
-{
- $this->bind(UserInterface::class)->toInstance(new User);
-}
-```
-You can bind a type to an instance of that type. This is usually only useful for objects that don't have dependencies of their own, such as value objects:
-
-```php
-protected function configure()
-{
- $this->bind()->annotatedWith("login_id")->toInstance('bear');
-}
-```
-
-## Untargeted Bindings
-
-You may create bindings without specifying a target. This is most useful for concrete classes. An untargetted binding informs the injector about a type, so it may prepare dependencies eagerly. Untargetted bindings have no _to_ clause, like so:
-
-```php
-
-protected function configure()
-{
- $this->bind(MyConcreteClass::class);
- $this->bind(AnotherConcreteClass::class)->in(Scope::SINGLETON);
-}
-```
-
-note: annotations are not supported for Untargeted Bindings
-
-## Binding Attributes ##
-
-Occasionally you'll want multiple bindings for a same type. For example, you might want both a PayPal credit card processor and a Google Checkout processor.
-To enable this, bindings support an optional binding attribute. The attribute and type together uniquely identify a binding. This pair is called a key.
-
-Define qualifier attribute first. It needs to be annotated with `Qualifier` attribute.
-
-```php
-use Ray\Di\Di\Qualifier;
-
-#[Attribute(Attribute::TARGET_METHOD), Qualifier]
-final class PayPal
-{
-}
-```
-
-To depend on the annotated binding, apply the attribute to the injected parameter:
-
-```php
-public function __construct(#[Paypal] CreditCardProcessorInterface $processor)
-{
-}
-```
-You can specify parameter name with qualifier. Qualifier applied all parameters without it.
-
-```php
-public function __construct(#[Paypal('processor')] CreditCardProcessorInterface $processor)
-{
- ....
-}
-```
-Lastly we create a binding that uses the attribute. This uses the optional `annotatedWith` clause in the bind() statement:
-
-```php
-protected function configure()
-{
- $this->bind(CreditCardProcessorInterface::class)
- ->annotatedWith(PayPal::class)
- ->to(PayPalCreditCardProcessor::class);
-```
-
-By default your custom `#[Attribute]` annotations will only help injecting dependencies in constructors on when
-you annotate you also annotate your methods with `#[Inject]`.
-
-### Binding Annotations in Setters ###
-
-In order to make your custom `Qualifier` attribute inject dependencies by default in any method the
-attribute is added, you need to implement the `Ray\Di\Di\InjectInterface`:
-
-```php
-use Ray\Di\Di\InjectInterface;
-use Ray\Di\Di\Qualifier;
-
-#[Attribute(Attribute::TARGET_METHOD), Qualifier]
-final class PaymentProcessorInject implements InjectInterface
-{
- public function isOptional()
- {
- return $this->optional;
- }
-
- public function __construct(
- public bool $optional = true
- public string $type;
- ){}
-}
-```
-
-The interface requires that you implement the `isOptional()` method. It will be used to determine whether
-or not the injection should be performed based on whether there is a known binding for it.
-
-Now that you have created your custom injector attribute, you can use it on any method.
-
-```php
-#[PaymentProcessorInject(type: 'paypal')]
-public setPaymentProcessor(CreditCardProcessorInterface $processor)
-{
- ....
-}
-```
-
-Finally, you can bind the interface to an implementation by using your new annotated information:
-
-```php
-protected function configure()
-{
- $this->bind(CreditCardProcessorInterface::class)
- ->annotatedWith(PaymentProcessorInject::class)
- ->toProvider(PaymentProcessorProvider::class);
-}
-```
-
-The provider can now use the information supplied in the qualifier attribute in order to instantiate
-the most appropriate class.
-
-### Qualifier ###
-
-The most common use of a Qualifier attribute is tagging arguments in a function with a certain label,
-the label can be used in the bindings in order to select the right class to be instantiated. For those
-cases, Ray.Di comes with a built-in binding attribute `#[Named]` that takes a string.
-
-```php
-use Ray\Di\Di\Inject;
-use Ray\Di\Di\Named;
-
-public function __construct(#[Named('checkout')] CreditCardProcessorInterface $processor)
-{
-...
-```
-
-To bind a specific name, pass that string using the `annotatedWith()` method.
-
-```php
-protected function configure()
-{
- $this->bind(CreditCardProcessorInterface::class)
- ->annotatedWith('checkout')
- ->to(CheckoutCreditCardProcessor::class);
-}
-```
-
-You need to put the `#[Named()]` attribuet in order to specify the parameter.
-
-```php
-use Ray\Di\Di\Inject;
-use Ray\Di\Di\Named;
-
-public function __construct(#[Named('checkout')] CreditCardProcessorInterface $processor, #[Named('backup')] CreditCardProcessorInterface $subProcessor)
-{
-...
-```
-
-## Constructor Bindings ##
-
-When `#[Inject]` attribute cannot be applied to the target constructor or setter method because it is a third party class, Or you simply don't like to use annotations. `Constructor Binding` provide the solution to this problem. By calling your target constructor explicitly, you don't need reflection and its associated pitfalls. But there are limitations of that approach: manually constructed instances do not participate in AOP.
-
-To address this, Ray.Di has `toConstructor` bindings.
-
-```php
-id = $id;
- $this->password = $password;
- }
-
- #[Inject]
- public function setGuzzle(ClientInterface $client)
- {
- $this->client = $client;
- }
-
- #[Inject(optional: true)]
- public function setOptionalToken(#[Named('token') string $token)
- {
- $this->token = $token;
- }
-
- #[PostConstruct]
- public function initialize()
- {
- }
-```
-
-All attributes in dependent above can be removed by following `toConstructor` binding.
-
-```php
-bind(WebApiInterface::class)
- ->toConstructor(
- WebApi::class, // string $class_name
- [
- 'id' => 'user_id', // array $name
- 'passowrd' => 'user_password'
- ],
- (new InjectionPoints) // InjectionPoints $setter_injection
- ->addMethod('setGuzzle', 'token')
- ->addOptionalMethod('setOptionalToken'),
- 'initialize' // string $postCostruct
- );
- $this->bind()->annotated('user_id')->toInstance($_ENV['user_id']);
- $this->bind()->annotated('user_password')->toInstance($_ENV['user_password']);
-}
-```
-
-### Parameter
-
-**class_name**
-
-Class Name
-
-**name**
-
-Parameter name binding.
-
-array `[[$parame_name => $binding_name],...]` or string `"param_name=binding_name&..."`
-
-**setter_injection**
-
-Setter Injection
-
-**postCosntruct**
-
-Ray.Di will invoke that constructor and setter method to satisfy the binding and invoke in `$postCosntruct` method after all dependencies are injected.
-
-### PDO Example
-
-Here is the example for the native [PDO](http://php.net/manual/ja/pdo.construct.php) class.
-
-```php
-public PDO::__construct ( string $dsn [, string $username [, string $password [, array $options ]]] )
-```
-
-```php
-protected function configure()
-{
- $this->bind(\PDO::class)->toConstructor(
- \PDO::class,
- [
- 'dsn' => 'pdo_dsn',
- 'username' => 'pdo_username',
- 'password' => 'pdo_password'
- ]
- )->in(Scope::SINGLETON);
- $this->bind()->annotatedWith('pdo_dsn')->toInstance($dsn);
- $this->bind()->annotatedWith('pdo_username')->toInstance(getenv('db_user'));
- $this->bind()->annotatedWith('pdo_password')->toInstance(getenv('db_password'));
-}
-```
-
-Since no argument of PDO has a type, it binds with the `Name Binding` of the second argument of the `toConstructor()` method.
-
-## Null Object Binding
-
-A Null Object is an object that implements an interface but whose methods do nothing.
-When bound with `toNull()`, the code of the Null Object is generated from the interface and bound to the generated instance.
-This is useful for testing and AOP.
-
-```php
-protected function configure()
-{
- $this->bind(CreditCardProcessorInterface::class)->toNull();
-}
-```
-
-## Scopes ##
-
-By default, Ray returns a new instance each time it supplies a value. This behaviour is configurable via scopes.
-
-```php
-use Ray\Di\Scope;
-
-protected function configure()
-{
- $this->bind(TransactionLogInterface::class)->to(InMemoryTransactionLog::class)->in(Scope::SINGLETON);
-}
-```
-
-## Object life cycle
-
-`#[PostConstruct]` is used on methods that need to get executed after dependency injection has finalized to perform any extra initialization.
-
-```php
-
-use Ray\Di\Di\PostConstruct;
-
-#[PostConstruct]
-public function init()
-{
- //....
-}
-```
-
-## Aspect Oriented Programing ##
-
-To compliment dependency injection, Ray.Di supports method interception. This feature enables you to write code that is executed each time a matching method is invoked. It's suited for cross cutting concerns ("aspects"), such as transactions, security and logging. Because interceptors divide a problem into aspects rather than objects, their use is called Aspect Oriented Programming (AOP).
-
-To mark select methods as weekdays-only, we define an attribute.
-
-```php
-#[Attribute(Attribute::TARGET_METHOD)]
-final class NotOnWeekends
-{
-}
-```
-
-...and apply it to the methods that need to be intercepted:
-
-```php
-class BillingService
-{
- #[NotOnWeekends]
- chargeOrder(PizzaOrder $order, CreditCard $creditCard)
- {
-```
-
-Next, we define the interceptor by implementing the org.aopalliance.intercept.MethodInterceptor interface. When we need to call through to the underlying method, we do so by calling `$invocation->proceed()`:
-
-```php
-
-use Ray\Aop\MethodInterceptor;
-use Ray\Aop\MethodInvocation;
-
-class WeekendBlocker implements MethodInterceptor
-{
- public function invoke(MethodInvocation $invocation)
- {
- $today = getdate();
- if ($today['weekday'][0] === 'S') {
- throw new \RuntimeException(
- $invocation->getMethod()->getName() . " not allowed on weekends!"
- );
- }
- return $invocation->proceed();
- }
-}
-```
-
-Finally, we configure everything. In this case we match any class, but only the methods with our `#[NotOnWeekends]` attribute:
-
-```php
-
-use Ray\Di\AbstractModule;
-
-class WeekendModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bindInterceptor(
- $this->matcher->any(), // any class
- $this->matcher->annotatedWith('NotOnWeekends'), // #[NotOnWeekends] attributed method
- [WeekendBlocker::class] // apply WeekendBlocker interceptor
- );
- }
-}
-
-$injector = new Injector(new WeekendModule);
-$billing = $injector->getInstance(BillingServiceInterface::class);
-try {
- echo $billing->chargeOrder();
-} catch (\RuntimeException $e) {
- echo $e->getMessage() . "\n";
- exit(1);
-}
-```
-Putting it all together, (and waiting until Saturday), we see the method is intercepted and our order is rejected:
-
-```php
-RuntimeException: chargeOrder not allowed on weekends! in /apps/pizza/WeekendBlocker.php on line 14
-
-Call Stack:
- 0.0022 228296 1. {main}() /apps/pizza/main.php:0
- 0.0054 317424 2. Ray\Aop\Weaver->chargeOrder() /apps/pizza/main.php:14
- 0.0054 317608 3. Ray\Aop\Weaver->__call() /libs/Ray.Aop/src/Weaver.php:14
- 0.0055 318384 4. Ray\Aop\ReflectiveMethodInvocation->proceed() /libs/Ray.Aop/src/Weaver.php:68
- 0.0056 318784 5. Ray\Aop\Sample\WeekendBlocker->invoke() /libs/Ray.Aop/src/ReflectiveMethodInvocation.php:65
-```
-
-You can bind interceptors in variouas ways as follows.
-
-```php
-
-use Ray\Di\AbstractModule;
-
-class TaxModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bindInterceptor(
- $this->matcher->annotatedWith('Tax'),
- $this->matcher->any(),
- [TaxCharger::class]
- );
- }
-}
-```
-
-```php
-
-use Ray\Di\AbstractModule;
-
-class AopMatcherModule extends AbstractModule
-{
- protected function configure()
- {
- $this->bindInterceptor(
- $this->matcher->any(), // In any class and
- $this->matcher->startWith('delete'), // ..the method start with "delete"
- [Logger::class]
- );
- }
-}
-```
-
-## More Docs
-
- * [Contextual binding](docs/contextual_binding.md)
- * [Performance Boost](docs/performance_boost.md)
- * [Grapher](docs/grapher.md)
-
-## Installation ##
-
-A module can install other modules to configure more bindings.
-
- * Earlier bindings have priority even if the same binding is made later.
- * `override` bindings in that module have priority.
-
-```php
-protected function configure()
-{
- $this->install(new OtherModule);
- $this->override(new CustomiseModule);
-}
-```
-## Frameworks integration ##
-
- * [BEAR.Sunday](https://github.com/koriym/BEAR.Sunday)
- * [CakePHP 3/4 PipingBag](https://github.com/lorenzo/piping-bag) by [@jose_zap](https://twitter.com/jose_zap)
- * [Yii 1](https://github.com/koriym/Ray.Dyii)
-
-## Annotation / Attribute
-
-Ray.Di can be used either with [doctrine/annotation](https://github.com/doctrine/annotations) in PHP 7/8 or with an [Attributes](https://www.php.net/manual/en/language.attributes.overview.php) in PHP8.
-See the annotation code examples in the older [README(v2.10)](https://github.com/ray-di/Ray.Di/tree/2.10.5/README.md).
-To make forward-compatible annotations for attributes, see [Custom Annotation Classes](https://github.com/kerveros12v/sacinta4/blob/e976c143b3b7d42497334e76c00fdf38717af98e/vendor/doctrine/annotations/docs/en/custom.rst#optional-constructors-with-named-parameters).
-
-## Installation ##
-
-The recommended way to install Ray.Di is through [Composer](https://github.com/composer/composer).
-
-```bash
-# Add Ray.Di as a dependency
-$ composer require ray/di ^2.0
-```
-
-## Testing Ray.Di ##
-
-Here's how to install Ray.Di from source and run the unit tests and demos.
-
-```bash
-$ git clone https://github.com/ray-di/Ray.Di.git
-$ cd Ray.Di
-$ ./vendor/bin/phpunit
-$ php demo-php8/run.php
-```
+https://ray-di.github.io
diff --git a/codecov.yml b/codecov.yml
index 7a6ecf3d..b5d92572 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -10,5 +10,3 @@ coverage:
patch:
default:
target: 100%
-
-comment: false
diff --git a/composer.json b/composer.json
index 1e4544f8..3bcda7c1 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
"name": "ray/di",
- "description": "Guice style annotation-driven dependency injection framework",
+ "description": "Guice style dependency injection framework",
"keywords": ["di", "aop"],
"license": "MIT",
"authors": [
@@ -13,29 +13,33 @@
"php": "^7.2 || ^8.0",
"doctrine/annotations": "^1.12",
"doctrine/cache": "^1.10 | ^2.1",
- "koriym/attributes": "^1.0",
+ "koriym/attributes": "^1.0.4",
"koriym/null-object": "^1.0",
+ "koriym/param-reader": "^1.0",
"koriym/printo": "^1.0",
- "nikic/php-parser": "^4.5",
- "ray/aop": "^2.10"
+ "nikic/php-parser": "^4.13",
+ "ray/aop": "^2.10",
+ "ray/compiler": "^1.6"
},
"require-dev": {
- "phpunit/phpunit": "^9.5",
+ "ext-pdo": "*",
+ "phpunit/phpunit": "^8.5.24 || ^9.5",
"bamarni/composer-bin-plugin": "^1.4"
},
"config": {
- "sort-packages": true
+ "sort-packages": true,
+ "allow-plugins": {
+ "bamarni/composer-bin-plugin": true
+ }
},
"autoload": {
"psr-4": {
- "Ray\\Di\\": ["src/di", "src-deprecated/di"],
- "Ray\\Compiler\\": ["src/compiler"]
+ "Ray\\Di\\": ["src/di", "src-deprecated/di"]
}
},
"autoload-dev": {
"psr-4": {
- "Ray\\Di\\": ["tests/di", "tests/di/Fake/"],
- "Ray\\Compiler\\": ["tests/compiler", "tests/compiler/Fake"]
+ "Ray\\Di\\": ["tests/di", "tests/di/Fake/"]
},
"files": ["tests/deleteFiles.php"]
},
@@ -49,8 +53,6 @@
"cs": ["./vendor/bin/phpcs --standard=./phpcs.xml src tests"],
"cs-fix": ["./vendor/bin/phpcbf src tests"],
"clean": ["./vendor/bin/phpstan clear-result-cache", "./vendor/bin/psalm --clear-cache", "rm -rf tests/tmp/*.php"],
- "sa": ["@sa-di", "@sa-compiler"],
- "sa-di": ["./vendor/bin/phpstan analyse -c phpstan.neon", "./vendor/bin/psalm --show-info=true"],
"sa-compiler": ["./vendor/bin/psalm -c psalm.compiler.xml --show-info=true"],
"metrics": ["@test", "./vendor/bin/phpmetrics --report-html=build/metrics --exclude=Exception --log-junit=build/junit.xml --junit=build/junit.xml src"],
"phpmd": ["./vendor/bin/phpmd src/di text ./phpmd.xml"],
diff --git a/docs/contextual_binding.md b/docs/contextual_binding.md
deleted file mode 100644
index ba13220e..00000000
--- a/docs/contextual_binding.md
+++ /dev/null
@@ -1,54 +0,0 @@
-## Contextual Provider Bindings
-
-You may want to create an object using the context when binding with Provider. For example, you want to inject different connection destinations on the same DB interface. In such a case, we bind it by specifying the context (string) with `toProvider ()`.
-
-
-```php
-$dbConfig = ['user' => $userDsn, 'job'=> $jobDsn, 'log' => $logDsn];
-$this->bind()->annotatedWith('db_config')->toInstance(dbConfig);
-$this->bind(Connection::class)->annotatedWith('usr_db')->toProvider(DbalProvider::class, 'user');
-$this->bind(Connection::class)->annotatedWith('job_db')->toProvider(DbalProvider::class, 'job');
-$this->bind(Connection::class)->annotatedWith('log_db')->toProvider(DbalProvider::class, 'log');
-```
-
-Providers are created for each context.
-
-```php
-use Ray\Di\Di\Inject;
-use Ray\Di\Di\Named;
-
-class DbalProvider implements ProviderInterface, SetContextInterface
-{
- private $dbConfigs;
-
- public function setContext($context)
- {
- $this->context = $context;
- }
-
- public function __construct(#[Named('db_config') array $dbConfigs)
- {
- $this->dbConfigs = $dbConfigs;
- }
-
- /**
- * {@inheritdoc}
- */
- public function get()
- {
- $config = $this->dbConfigs[$this->context];
- $conn = DriverManager::getConnection($config);
-
- return $conn;
- }
-}
-```
-
-It is the same interface, but you can receive different connections made by `Provider`.
-
-```php
-public function __construct(#[Named('user')] Connection $userDb, #[Named('job')] Connection $jobDb, #[Named('log') Connection $logDb)
-{
- //...
-}
-```
diff --git a/docs/grapher.md b/docs/grapher.md
deleted file mode 100644
index f44d1297..00000000
--- a/docs/grapher.md
+++ /dev/null
@@ -1,19 +0,0 @@
-## Grapher
-
-In `Grapher`, constructor arguments are passed manually and subsequent injections are done automatically.
-It is useful to introduce Ray.Di into an existing system (where only root objects have an object generation mechanism).
-
-```php
-// ...
-$grapher = new Grapher(new Module, __DIR__ . '/tmp');
-$instance = $grapher->newInstanceArgs(FooController::class, [$param1, $param2]);
-```
-
-## Graphing Ray.Di Applications
-
-When you've written a sophisticated application, Ray.Di rich introspection API can describe the object graph in detail. The object-visual-grapher exposes this data as an easily understandable visualization. It can show the bindings and dependencies from several classes in a complex application in a unified diagram.
-
-![fake](https://user-images.githubusercontent.com/529021/72650686-866ec100-39c4-11ea-8b49-2d86d991dc6d.png)
-
-See more at https://github.com/koriym/Ray.ObjectGrapher
-
diff --git a/docs/performance_boost.md b/docs/performance_boost.md
deleted file mode 100644
index b285f979..00000000
--- a/docs/performance_boost.md
+++ /dev/null
@@ -1,47 +0,0 @@
-## Performance boost ##
-
-### Script injector
-
-`ScriptInjector` generates raw factory code for better performance and to clarify how the instance is created.
-
-```php
-
-use Ray\Di\ScriptInjector;
-use Ray\Compiler\DiCompiler;
-use Ray\Compiler\Exception\NotCompiled;
-
-try {
- $injector = new ScriptInjector($tmpDir);
- $instance = $injector->getInstance(ListerInterface::class);
-} catch (NotCompiled $e) {
- $compiler = new DiCompiler(new ListerModule, $tmpDir);
- $compiler->compile();
- $instance = $injector->getInstance(ListerInterface::class);
-}
-```
-Once an instance has been created, You can view the generated factory files in `$tmpDir`
-
-### Cache injector
-
-The injector is serializable.
-It also boosts the performance.
-
-```php
-
-// save
-$injector = new Injector(new ListerModule);
-$cachedInjector = serialize($injector);
-
-// load
-$injector = unserialize($cachedInjector);
-$lister = $injector->getInstance(ListerInterface::class);
-
-```
-
-### CachedInjectorFactory
-
-The `CachedInejctorFactory` can be used in a hybrid of the two injectors to achieve the best performance in both development and production.
-
-The injector is able to inject singleton objects **beyond the request**, greatly increasing the speed of testing. Successive PDO connections also do not run out of connection resources in the test.
-
-See [CachedInjectorFactory](https://github.com/ray-di/Ray.Compiler/issues/75) for more information.
diff --git a/phpcs.xml b/phpcs.xml
index 8c73a83a..525ff0a8 100755
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,7 +1,7 @@
+ xsi:noNamespaceSchemaLocation="./vendor-bin/tools/vendor/squizlabs/php_codesniffer/phpcs.xsd">
@@ -37,6 +37,9 @@
+
+
+
diff --git a/phpstan.neon b/phpstan.neon
index d3bc24ae..626dbea8 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -1,13 +1,13 @@
parameters:
level: max
paths:
- - src
- - tests
- excludes_analyse:
- - %currentWorkingDirectory%/tests/tmp/*
- - %currentWorkingDirectory%/tests/di/tmp/*
- - %currentWorkingDirectory%/tests/di/Fake/*
- - %currentWorkingDirectory%/tests/compiler/tmp/*
- - %currentWorkingDirectory%/tests/compiler/Fake/*
+ - src/di
+ - tests/di
+ - tests/type
+ excludePaths:
+ - tests/tmp/*
+ - tests/di/tmp/*
+ - tests/Di/tmp/*
+ - tests/di/Fake/*
checkGenericClassInNonGenericObjectType: false
-
+ checkMissingIterableValueType: false
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index b11caa3b..1048b47c 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -11,9 +11,6 @@
tests-php8
tests/di
-
- tests/compiler/
-
diff --git a/psalm.compiler.xml b/psalm.compiler.xml
deleted file mode 100644
index 7c641572..00000000
--- a/psalm.compiler.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/psalm.xml b/psalm.xml
index 178a0396..b2ac5c80 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -1,19 +1,15 @@
-
-
-
-
-
-
-
+
+
+
+
diff --git a/src/di/Provider.php b/src-deprecated/di/Provider.php
similarity index 70%
rename from src/di/Provider.php
rename to src-deprecated/di/Provider.php
index 0d06c05f..a62e5e47 100644
--- a/src/di/Provider.php
+++ b/src-deprecated/di/Provider.php
@@ -5,7 +5,7 @@
namespace Ray\Di;
/**
- * Alias for ProviderInterface
+ * @deprecated User ProviderInterface instead
*/
interface Provider extends ProviderInterface
{
diff --git a/src/compiler/Annotation/Compile.php b/src/compiler/Annotation/Compile.php
deleted file mode 100644
index cba66b3a..00000000
--- a/src/compiler/Annotation/Compile.php
+++ /dev/null
@@ -1,14 +0,0 @@
-privateProperty = $privateProperty;
- }
-
- /**
- * Add aop factory code if bindings are given
- *
- * @param array $node
- *
- * @param-out array $node
- */
- public function __invoke(Dependency $dependency, array &$node): void
- {
- $prop = $this->privateProperty;
- $newInstance = $prop($dependency, 'newInstance');
- $bind = $prop($newInstance, 'bind');
- $bind = $prop($bind, 'bind');
- /** @var string[][]|null $bindings */
- $bindings = $prop($bind, 'bindings', null);
- if (! is_array($bindings)) {
- return;
- }
-
- $methodBinding = $this->getMethodBinding($bindings);
- $bindingsProp = new Expr\PropertyFetch(new Expr\Variable('instance'), 'bindings');
- $bindingsAssign = new Assign($bindingsProp, new Expr\Array_($methodBinding));
- $this->setBindingAssignAfterInitialization($node, [$bindingsAssign], 1);
- }
-
- /**
- * @param array $array
- * @param array $insertValue
- *
- * @param-out array $array
- */
- private function setBindingAssignAfterInitialization(array &$array, array $insertValue, int $position): void
- {
- $array = array_merge(array_splice($array, 0, $position), $insertValue, $array);
- }
-
- /**
- * @param string[][] $bindings
- *
- * @return Expr\ArrayItem[]
- */
- private function getMethodBinding(array $bindings): array
- {
- $methodBinding = [];
- foreach ($bindings as $method => $interceptors) {
- $items = [];
- foreach ($interceptors as $interceptor) {
- // $singleton('FakeAopInterface-*');
- $dependencyIndex = "{$interceptor}-" . Name::ANY;
- $singleton = new Expr\FuncCall(new Expr\Variable('singleton'), [new Node\Arg(new Scalar\String_($dependencyIndex))]);
- // [$singleton('FakeAopInterface-*'), $singleton('FakeAopInterface-*');]
- $items[] = new Expr\ArrayItem($singleton);
- }
-
- $arr = new Expr\Array_($items);
- $methodBinding[] = new Expr\ArrayItem($arr, new Scalar\String_($method));
- }
-
- return $methodBinding;
- }
-}
diff --git a/src/compiler/CachedInjectorFactory.php b/src/compiler/CachedInjectorFactory.php
deleted file mode 100644
index 9d769275..00000000
--- a/src/compiler/CachedInjectorFactory.php
+++ /dev/null
@@ -1,62 +0,0 @@
- */
- private static $injectors = [];
-
- private function __construct()
- {
- }
-
- /**
- * @param callable(): AbstractModule $modules
- * @param array $savedSingletons
- */
- public static function getInstance(string $injectorId, string $scriptDir, callable $modules, ?CacheProvider $cache = null, array $savedSingletons = []): InjectorInterface
- {
- if (isset(self::$injectors[$injectorId])) {
- return self::$injectors[$injectorId];
- }
-
- /** @psalm-suppress DeprecatedClass */
- $cache = $cache ?? new NullCache();
- $cache->setNamespace($injectorId);
- $cachedInjector = $cache->fetch(InjectorInterface::class);
- if ($cachedInjector instanceof InjectorInterface) {
- return $cachedInjector;
- }
-
- $injector = self::getInjector($modules, $scriptDir, $savedSingletons);
- if ($injector instanceof ScriptInjector) {
- $cache->save(InjectorInterface::class, $injector);
- }
-
- self::$injectors[$injectorId] = $injector;
-
- return $injector;
- }
-
- /**
- * @param callable(): AbstractModule $modules
- * @param array $savedSingletons
- */
- private static function getInjector(callable $modules, string $scriptDir, array $savedSingletons): InjectorInterface
- {
- $injector = InjectorFactory::getInstance($modules, $scriptDir);
- foreach ($savedSingletons as $singleton) {
- $injector->getInstance($singleton);
- }
-
- return $injector;
- }
-}
diff --git a/src/compiler/Code.php b/src/compiler/Code.php
deleted file mode 100644
index 493d9306..00000000
--- a/src/compiler/Code.php
+++ /dev/null
@@ -1,34 +0,0 @@
-node = $node;
- $this->isSingleton = $isSingleton;
- $this->qualifiers = $qualifier;
- }
-
- public function __toString(): string
- {
- $prettyPrinter = new Standard();
-
- return $prettyPrinter->prettyPrintFile([$this->node]);
- }
-}
diff --git a/src/compiler/DependencyCode.php b/src/compiler/DependencyCode.php
deleted file mode 100644
index 358b2107..00000000
--- a/src/compiler/DependencyCode.php
+++ /dev/null
@@ -1,179 +0,0 @@
-factory = new BuilderFactory();
- $this->normalizer = new Normalizer();
- $this->factoryCompiler = new FactoryCode($container, new Normalizer(), $this, $injector);
- $this->privateProperty = new PrivateProperty();
- $this->aopCode = new AopCode($this->privateProperty);
- }
-
- /**
- * Return compiled dependency code
- */
- public function getCode(DependencyInterface $dependency, string $scriptDir = ''): Code
- {
- if ($dependency instanceof Dependency) {
- return $this->getDependencyCode($dependency);
- }
-
- if ($dependency instanceof Instance) {
- return $this->getInstanceCode($dependency);
- }
-
- if ($dependency instanceof DependencyProvider) {
- return $this->getProviderCode($dependency);
- }
-
- if ($dependency instanceof NullObjectDependency) {
- return $this->getDependencyCode($dependency->toNull($scriptDir));
- }
-
- throw new DomainException(get_class($dependency));
- }
-
- /**
- * {@inheritdoc}
- */
- public function setContext($context)
- {
- $this->context = $context;
- }
-
- public function setQaulifier(IpQualifier $qualifer): void
- {
- $this->qualifier = $qualifer;
- }
-
- public function getIsSingletonCode(bool $isSingleton): Expr\Assign
- {
- $bool = new Expr\ConstFetch(new Node\Name([$isSingleton ? 'true' : 'false']));
-
- return new Expr\Assign(new Expr\Variable('isSingleton'), $bool);
- }
-
- /**
- * Compile DependencyInstance
- */
- private function getInstanceCode(Instance $instance): Code
- {
- $node = ($this->normalizer)($instance->value);
-
- return new Code(new Node\Stmt\Return_($node), false);
- }
-
- /**
- * Compile generic object dependency
- */
- private function getDependencyCode(Dependency $dependency): Code
- {
- $prop = $this->privateProperty;
- $node = $this->getFactoryNode($dependency);
- ($this->aopCode)($dependency, $node);
- $isSingleton = $prop($dependency, 'isSingleton');
- $node[] = $this->getIsSingletonCode($isSingleton);
- $node[] = new Node\Stmt\Return_(new Node\Expr\Variable('instance'));
- $namespace = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode();
- $qualifer = $this->qualifier;
- $this->qualifier = null;
-
- return new Code($namespace, $isSingleton, $qualifer);
- }
-
- /**
- * Compile dependency provider
- */
- private function getProviderCode(DependencyProvider $provider): Code
- {
- $prop = $this->privateProperty;
- $dependency = $prop($provider, 'dependency');
- $node = $this->getFactoryNode($dependency);
- $provider->setContext($this);
- if ($this->context) {
- $node[] = $this->getSetContextCode($this->context); // $instance->setContext($this->context);
- }
-
- $isSingleton = $prop($provider, 'isSingleton');
- $node[] = $this->getIsSingletonCode($isSingleton);
- $node[] = new Stmt\Return_(new MethodCall(new Expr\Variable('instance'), 'get'));
- $node = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode();
- $qualifer = $this->qualifier;
- $this->qualifier = null;
-
- return new Code($node, $isSingleton, $qualifer);
- }
-
- private function getSetContextCode(string $context): MethodCall
- {
- $arg = new Node\Arg(new Node\Scalar\String_($context));
-
- return new MethodCall(new Expr\Variable('instance'), 'setContext', [$arg]);
- }
-
- /**
- * Return generic factory code
- *
- * This code is used by Dependency and DependencyProvider
- *
- * @return array
- */
- private function getFactoryNode(DependencyInterface $dependency): array
- {
- $prop = $this->privateProperty;
- $newInstance = $prop($dependency, 'newInstance');
- // class name
- $class = $prop($newInstance, 'class');
- $setterMethods = (array) $prop($prop($newInstance, 'setterMethods'), 'setterMethods');
- $arguments = (array) $prop($prop($newInstance, 'arguments'), 'arguments');
- $postConstruct = (string) $prop($dependency, 'postConstruct');
-
- return $this->factoryCompiler->getFactoryCode($class, $arguments, $setterMethods, $postConstruct);
- }
-}
diff --git a/src/compiler/DependencySaver.php b/src/compiler/DependencySaver.php
deleted file mode 100644
index 3e057117..00000000
--- a/src/compiler/DependencySaver.php
+++ /dev/null
@@ -1,61 +0,0 @@
-scriptDir = $scriptDir;
- $this->filePutContents = new FilePutContents();
- }
-
- public function __invoke(string $dependencyIndex, Code $code): void
- {
- $pearStyleName = str_replace('\\', '_', $dependencyIndex);
- $instanceScript = sprintf(ScriptInjector::INSTANCE, $this->scriptDir, $pearStyleName);
- ($this->filePutContents)($instanceScript, (string) $code . PHP_EOL);
- if ($code->qualifiers) {
- $this->saveQualifier($code->qualifiers);
- }
- }
-
- private function saveQualifier(IpQualifier $qualifer): void
- {
- $qualifier = $this->scriptDir . '/qualifer';
- ! file_exists($qualifier) && ! @mkdir($qualifier) && ! is_dir($qualifier);
- $class = $qualifer->param->getDeclaringClass();
- if (! $class instanceof ReflectionClass) {
- throw new LogicException(); // @codeCoverageIgnore
- }
-
- $fileName = sprintf(
- ScriptInjector::QUALIFIER,
- $this->scriptDir,
- str_replace('\\', '_', $class->name),
- $qualifer->param->getDeclaringFunction()->name,
- $qualifer->param->name
- );
- ($this->filePutContents)($fileName, serialize($qualifer->qualifier) . PHP_EOL);
- }
-}
diff --git a/src/compiler/DiCompileModule.php b/src/compiler/DiCompileModule.php
deleted file mode 100644
index f8a1bf63..00000000
--- a/src/compiler/DiCompileModule.php
+++ /dev/null
@@ -1,28 +0,0 @@
-doCompile = $doCompile;
- parent::__construct($module);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function configure(): void
- {
- $this->bind()->annotatedWith(Compile::class)->toInstance($this->doCompile);
- }
-}
diff --git a/src/compiler/DiCompiler.php b/src/compiler/DiCompiler.php
deleted file mode 100644
index 6a4d499c..00000000
--- a/src/compiler/DiCompiler.php
+++ /dev/null
@@ -1,95 +0,0 @@
-scriptDir = $scriptDir ?: sys_get_temp_dir();
- $this->container = $module->getContainer();
- $this->dependencyCompiler = new DependencyCode($this->container);
- $this->module = $module;
- $this->dependencySaver = new DependencySaver($scriptDir);
- $this->filePutContents = new FilePutContents();
- // Weave AssistedInterceptor and bind InjectorInterface for self
- $module->getContainer()->weaveAspects(new Compiler($scriptDir));
- (new Bind($this->container, InjectorInterface::class))->toInstance($this);
- (new Bind($this->container, ''))->annotatedWith(ScriptDir::class)->toInstance($scriptDir);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getInstance($interface, $name = Name::ANY)
- {
- $this->compile();
-
- return (new ScriptInjector($this->scriptDir))->getInstance($interface, $name);
- }
-
- /**
- * Compile all dependencies in container
- */
- public function compile(): void
- {
- $container = $this->container->getContainer();
- $scriptDir = $this->container->getInstance('', ScriptDir::class);
- assert(is_string($scriptDir));
- foreach ($container as $dependencyIndex => $dependency) {
- $code = $this->dependencyCompiler->getCode($dependency, $scriptDir);
- ($this->dependencySaver)($dependencyIndex, $code);
- }
-
- $this->savePointcuts($this->container);
- ($this->filePutContents)($this->scriptDir . ScriptInjector::MODULE, serialize($this->module));
- }
-
- public function dumpGraph(): void
- {
- $dumper = new GraphDumper($this->container, $this->scriptDir);
- $dumper();
- }
-
- public function savePointcuts(Container $container): void
- {
- $ref = (new ReflectionProperty($container, 'pointcuts'));
- $ref->setAccessible(true);
- $pointcuts = $ref->getValue($container);
- ($this->filePutContents)($this->scriptDir . ScriptInjector::AOP, serialize($pointcuts));
- }
-}
diff --git a/src/compiler/Exception/ClassNotFound.php b/src/compiler/Exception/ClassNotFound.php
deleted file mode 100644
index 0946c5a6..00000000
--- a/src/compiler/Exception/ClassNotFound.php
+++ /dev/null
@@ -1,9 +0,0 @@
-container = $container;
- $this->normalizer = $normalizer;
- $this->nodeFactory = new NodeFactory($normalizer, $this, $injector);
- $this->functionCompiler = new FunctionCode($container, new PrivateProperty(), $compiler);
- }
-
- /**
- * @param array $arguments
- * @param array $setterMethods
- *
- * @return array
- */
- public function getFactoryCode(string $class, array $arguments, array $setterMethods, string $postConstruct): array
- {
- $node = [];
- $instance = new Expr\Variable('instance');
- // constructor injection
- $constructorInjection = $this->getConstructorInjection($class, $arguments);
- $node[] = new Expr\Assign($instance, $constructorInjection);
- $setters = $this->nodeFactory->getSetterInjection($instance, $setterMethods);
- foreach ($setters as $setter) {
- $node[] = $setter;
- }
-
- if ($postConstruct) {
- $node[] = $this->nodeFactory->getPostConstruct($instance, $postConstruct);
- }
-
- return $node;
- }
-
- /**
- * Return method argument code
- *
- * @return Expr|Expr\FuncCall
- */
- public function getArgStmt(Argument $argument): NodeAbstract
- {
- $dependencyIndex = (string) $argument;
- if ($dependencyIndex === 'Ray\Di\InjectionPointInterface-' . Name::ANY) {
- return $this->getInjectionPoint();
- }
-
- $hasDependency = isset($this->container->getContainer()[$dependencyIndex]);
- if (! $hasDependency) {
- return $this->nodeFactory->getNode($argument);
- }
-
- $dependency = $this->container->getContainer()[$dependencyIndex];
- if ($dependency instanceof Instance) {
- return ($this->normalizer)($dependency->value);
- }
-
- return ($this->functionCompiler)($argument, $dependency);
- }
-
- /**
- * @param array $arguments
- */
- private function getConstructorInjection(string $class, array $arguments = []): Expr\New_
- {
- $args = [];
- foreach ($arguments as $argument) {
- // $argument = $argument->isDefaultAvailable() ? $argument->getDefaultValue() : $argument;
- $args[] = $this->getArgStmt($argument);
- }
-
- /** @var array $args */
- return new Expr\New_(new Node\Name\FullyQualified($class), $args);
- }
-
- /**
- * Return "$injectionPoint()"
- */
- private function getInjectionPoint(): Expr
- {
- return new Expr\FuncCall(new Expr\Variable('injectionPoint'));
- }
-}
diff --git a/src/compiler/FilePutContents.php b/src/compiler/FilePutContents.php
deleted file mode 100644
index 2e329440..00000000
--- a/src/compiler/FilePutContents.php
+++ /dev/null
@@ -1,33 +0,0 @@
-container = $container;
- $this->privateProperty = $privateProperty;
- $this->reader = ServiceLocator::getReader();
- $this->compiler = $compiler;
- }
-
- /**
- * Return arguments code for "$singleton" and "$prototype"
- */
- public function __invoke(Argument $argument, DependencyInterface $dependency): Expr\FuncCall
- {
- $prop = $this->privateProperty;
- $isSingleton = $prop($dependency, 'isSingleton');
- assert(is_bool($isSingleton));
- $func = $isSingleton ? 'singleton' : 'prototype';
- $args = $this->getInjectionFuncParams($argument);
-
- /** @var array $args */
- return new Expr\FuncCall(new Expr\Variable($func), $args);
- }
-
- /**
- * Return dependency index argument
- *
- * [class, method, param] is added if dependency is provider for DI context
- *
- * @return array
- */
- private function getInjectionFuncParams(Argument $argument): array
- {
- $dependencyIndex = (string) $argument;
- if ($this->container->getContainer()[$dependencyIndex] instanceof DependencyProvider) {
- return $this->getInjectionProviderParams($argument);
- }
-
- return [new Node\Arg(new Scalar\String_((string) $argument))];
- }
-
- /**
- * Return code for provider
- *
- * "$provider" needs [class, method, parameter] for InjectionPoint (Contextual Dependency Injection)
- *
- * @return array
- */
- private function getInjectionProviderParams(Argument $argument): array
- {
- $param = $argument->get();
- $class = $param->getDeclaringClass();
- if (! $class instanceof ReflectionClass) {
- throw new LogicException(); // @codeCoverageIgnore
- }
-
- $method = $param->getDeclaringFunction();
- assert($method instanceof ReflectionMethod);
- $this->setQualifiers($method, $param);
-
- return [
- new Node\Arg(new Scalar\String_((string) $argument)),
- new Expr\Array_([
- new Expr\ArrayItem(new Scalar\String_($class->name)),
- new Expr\ArrayItem(new Scalar\String_($method->name)),
- new Expr\ArrayItem(new Scalar\String_($param->name)),
- ]),
- ];
- }
-
- private function setQualifiers(ReflectionMethod $method, ReflectionParameter $param): void
- {
- $annotations = $this->reader->getMethodAnnotations($method);
- foreach ($annotations as $annotation) {
- $qualifier = $this->reader->getClassAnnotation(
- new ReflectionClass($annotation),
- Qualifier::class
- );
- if ($qualifier instanceof Qualifier) {
- $this->compiler->setQaulifier(new IpQualifier($param, $annotation));
- }
- }
- }
-}
diff --git a/src/compiler/GraphDumper.php b/src/compiler/GraphDumper.php
deleted file mode 100644
index a3a40a41..00000000
--- a/src/compiler/GraphDumper.php
+++ /dev/null
@@ -1,64 +0,0 @@
-container = $container;
- $this->scriptDir = $scriptDir;
- }
-
- public function __invoke(): void
- {
- $container = $this->container->getContainer();
- foreach ($container as $dependencyIndex => $dependency) {
- $isNotInjector = $dependencyIndex !== 'Ray\Di\InjectorInterface-' . Name::ANY;
- if ($isNotInjector) {
- $this->write((string) $dependencyIndex);
- }
- }
- }
-
- private function write(string $dependencyIndex): void
- {
- if ($dependencyIndex === 'Ray\Aop\MethodInvocation-') {
- return;
- }
-
- [$interface, $name] = explode('-', $dependencyIndex);
- $instance = (new ScriptInjector($this->scriptDir))->getInstance($interface, $name);
- $graph = (string) (new Printo($instance))
- ->setRange(Printo::RANGE_ALL)
- ->setLinkDistance(130)
- ->setCharge(-500);
- $graphDir = $this->scriptDir . '/graph/';
- if (! file_exists($graphDir)) {
- mkdir($graphDir);
- }
-
- $file = $graphDir . str_replace('\\', '_', $dependencyIndex) . '.html';
- file_put_contents($file, $graph, LOCK_EX);
- }
-}
diff --git a/src/compiler/InjectionPoint.php b/src/compiler/InjectionPoint.php
deleted file mode 100644
index 997a3c80..00000000
--- a/src/compiler/InjectionPoint.php
+++ /dev/null
@@ -1,105 +0,0 @@
-parameter = $parameter;
- $this->scriptDir = $scriptDir;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getParameter(): ReflectionParameter
- {
- return $this->parameter;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMethod(): \ReflectionMethod
- {
- $reflectionMethod = $this->parameter->getDeclaringFunction();
- assert($reflectionMethod instanceof ReflectionMethod);
-
- return $reflectionMethod;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getClass(): ReflectionClass
- {
- $class = $this->parameter->getDeclaringClass();
- assert($class instanceof ReflectionClass);
-
- return $class;
- }
-
- /**
- * {@inheritdoc}
- *
- * @return array<(object|null)>
- *
- * @psalm-suppress ImplementedReturnTypeMismatch
- */
- public function getQualifiers(): array
- {
- return [$this->getQualifier()];
- }
-
- /**
- * {@inheritdoc}
- *
- * @return object|null
- */
- public function getQualifier()
- {
- $class = $this->parameter->getDeclaringClass();
- assert($class instanceof ReflectionClass);
-
- $qualifierFile = sprintf(
- ScriptInjector::QUALIFIER,
- $this->scriptDir,
- str_replace('\\', '_', $class->name),
- $this->parameter->getDeclaringFunction()->name,
- $this->parameter->name
- );
- if (! file_exists($qualifierFile)) {
- return null;
- }
-
- $qualifier = file_get_contents($qualifierFile);
- if (is_bool($qualifier)) {
- throw new RuntimeException(); // @codeCoverageIgnore
- }
-
- return unserialize($qualifier, ['allowed_classes' => true]);
- }
-}
diff --git a/src/compiler/InjectorFactory.php b/src/compiler/InjectorFactory.php
deleted file mode 100644
index 7eb0f3ca..00000000
--- a/src/compiler/InjectorFactory.php
+++ /dev/null
@@ -1,48 +0,0 @@
-getInstance('', Compile::class);
- } catch (Unbound $e) {
- }
-
- return $isProd ? self::getScriptInjector($scriptDir, $module) : $rayInjector;
- }
-
- private static function getScriptInjector(string $scriptDir, AbstractModule $module): ScriptInjector
- {
- return new ScriptInjector($scriptDir, static function () use ($scriptDir, $module) {
- return new ScriptinjectorModule($scriptDir, $module);
- });
- }
-}
diff --git a/src/compiler/IpQualifier.php b/src/compiler/IpQualifier.php
deleted file mode 100644
index 19013266..00000000
--- a/src/compiler/IpQualifier.php
+++ /dev/null
@@ -1,29 +0,0 @@
-param = $param;
- $this->qualifier = $qualifier;
- }
-
- public function __toString(): string
- {
- return serialize($this->qualifier);
- }
-}
diff --git a/src/compiler/NodeFactory.php b/src/compiler/NodeFactory.php
deleted file mode 100644
index 5ffec237..00000000
--- a/src/compiler/NodeFactory.php
+++ /dev/null
@@ -1,161 +0,0 @@
-injector = $injector;
- $this->normalizer = $normalizer;
- $this->factoryCompiler = $factoryCompiler;
- $this->privateProperty = new PrivateProperty();
- }
-
- /**
- * Return on-demand dependency pull code for not compiled
- *
- * @return Expr|Expr\FuncCall
- */
- public function getNode(Argument $argument): Expr
- {
- $dependencyIndex = (string) $argument;
- if (! $this->injector instanceof ScriptInjector) {
- return $this->getDefault($argument);
- }
-
- try {
- $isSingleton = $this->injector->isSingleton($dependencyIndex);
- } catch (NotCompiled $e) {
- return $this->getDefault($argument);
- }
-
- $func = $isSingleton ? 'singleton' : 'prototype';
- $args = $this->getInjectionProviderParams($argument);
-
- /** @var array $args */
- return new Expr\FuncCall(new Expr\Variable($func), $args);
- }
-
- /**
- * @param SetterMethod[] $setterMethods
- *
- * @return Expr\MethodCall[]
- */
- public function getSetterInjection(Expr\Variable $instance, array $setterMethods): array
- {
- $setters = [];
- foreach ($setterMethods as $setterMethod) {
- $isOptional = ($this->privateProperty)($setterMethod, 'isOptional');
- $method = ($this->privateProperty)($setterMethod, 'method');
- $argumentsObject = ($this->privateProperty)($setterMethod, 'arguments');
- $arguments = ($this->privateProperty)($argumentsObject, 'arguments');
- /** @var array $args */
- $args = $this->getSetterParams($arguments, $isOptional);
- if (! $args) {
- continue;
- }
-
- $setters[] = new Expr\MethodCall($instance, $method, $args);
- }
-
- return $setters;
- }
-
- public function getPostConstruct(Expr\Variable $instance, string $postConstruct): Expr\MethodCall
- {
- return new Expr\MethodCall($instance, $postConstruct);
- }
-
- /**
- * Return default argument value
- */
- private function getDefault(Argument $argument): Expr
- {
- if ($argument->isDefaultAvailable()) {
- $default = $argument->getDefaultValue();
-
- return ($this->normalizer)($default);
- }
-
- throw new Unbound($argument->getMeta());
- }
-
- /**
- * Return code for provider
- *
- * "$provider" needs [class, method, parameter] for InjectionPoint (Contextual Dependency Injection)
- *
- * @return array
- */
- private function getInjectionProviderParams(Argument $argument)
- {
- $param = $argument->get();
- $class = $param->getDeclaringClass();
- if (! $class instanceof ReflectionClass) {
- throw new LogicException(); // @codeCoverageIgnore
- }
-
- return [
- new Node\Arg(new Scalar\String_((string) $argument)),
- new Expr\Array_([
- new Node\Expr\ArrayItem(new Scalar\String_($class->name)),
- new Node\Expr\ArrayItem(new Scalar\String_($param->getDeclaringFunction()->name)),
- new Node\Expr\ArrayItem(new Scalar\String_($param->name)),
- ]),
- ];
- }
-
- /**
- * Return setter method parameters
- *
- * Return false when no dependency given and @ Inject(optional=true) annotated to setter method.
- *
- * @param Argument[] $arguments
- *
- * @return false|Node\Expr[]
- */
- private function getSetterParams(array $arguments, bool $isOptional)
- {
- $args = [];
- foreach ($arguments as $argument) {
- try {
- $args[] = $this->factoryCompiler->getArgStmt($argument);
- } catch (Unbound $e) {
- if ($isOptional) {
- return false;
- }
- }
- }
-
- return $args;
- }
-}
diff --git a/src/compiler/Normalizer.php b/src/compiler/Normalizer.php
deleted file mode 100644
index 8dcc7870..00000000
--- a/src/compiler/Normalizer.php
+++ /dev/null
@@ -1,138 +0,0 @@
-getValueNode($value);
- }
-
- /**
- * Return array or object node
- *
- * @param array|mixed|object $value
- *
- * @return Scalar\String_|Scalar\LNumber|Scalar\DNumber|Expr\Array_|Expr\FuncCall
- */
- private function getValueNode($value): Expr
- {
- if (is_string($value)) {
- return new Scalar\String_($value);
- }
-
- if (is_int($value)) {
- return new Scalar\LNumber($value);
- }
-
- if (is_float($value)) {
- return new Scalar\DNumber($value);
- }
-
- return $this->getValueNodeNonAtomic($value);
- }
-
- /**
- * Return array or object node
- *
- * @param array|mixed|object $value
- *
- * @return Expr\Array_|Expr\FuncCall
- */
- private function getValueNodeNonAtomic($value): Expr
- {
- if (is_array($value)) {
- return $this->arrayValue($value);
- }
-
- if (is_object($value)) {
- return $this->normalizeObject($value);
- }
-
- throw new InvalidInstance();
- }
-
- /**
- * Return "unserialize($object)" node
- *
- * @param object $object
- */
- private function normalizeObject($object): Expr\FuncCall
- {
- if ($object instanceof InjectorInterface) {
- return new Expr\FuncCall(new Expr\Variable('injector'));
- }
-
- $serialize = new Scalar\String_(serialize($object));
-
- return new Expr\FuncCall(new Node\Name('unserialize'), [new Arg($serialize)]);
- }
-
- /**
- * Return array value node
- *
- * @param array $value
- */
- private function arrayValue($value): Expr\Array_
- {
- $items = [];
- $lastKey = -1;
- foreach ($value as $itemKey => $itemValue) {
- // for consecutive, numeric keys don't generate keys
- if ($lastKey !== null && ++$lastKey === $itemKey) {
- $items[] = new Expr\ArrayItem(
- $this->__invoke($itemValue)
- );
- } else {
- $lastKey = null;
- $items[] = new Expr\ArrayItem(
- $this->__invoke($itemValue),
- $this->__invoke($itemKey)
- );
- }
- }
-
- return new Expr\Array_($items);
- }
-}
diff --git a/src/compiler/OnDemandCompiler.php b/src/compiler/OnDemandCompiler.php
deleted file mode 100644
index 674ab7a8..00000000
--- a/src/compiler/OnDemandCompiler.php
+++ /dev/null
@@ -1,90 +0,0 @@
-scriptDir = $sctiptDir;
- $this->injector = $injector;
- $this->module = $module;
- }
-
- /**
- * Compile dependency on demand
- */
- public function __invoke(string $dependencyIndex, string $scriptDir): void
- {
- [$class] = explode('-', $dependencyIndex);
- $containerObject = $this->module->getContainer();
- try {
- new Bind($containerObject, $class);
- } catch (NotFound $e) {
- throw new Unbound($dependencyIndex, 0, $e);
- }
-
- $containerArray = $containerObject->getContainer();
- if (! isset($containerArray[$dependencyIndex])) {
- throw new Unbound($dependencyIndex, 0);
- }
-
- $dependency = $containerArray[$dependencyIndex];
- $pointCuts = $this->loadPointcuts();
- if ($dependency instanceof Dependency && is_array($pointCuts)) {
- $dependency->weaveAspects(new Compiler($this->scriptDir), $pointCuts);
- }
-
- $code = (new DependencyCode($containerObject, $this->injector))->getCode($dependency, $scriptDir);
- (new DependencySaver($this->scriptDir))($dependencyIndex, $code);
- }
-
- /**
- * @return array|false
- */
- private function loadPointcuts()
- {
- $pointcutsPath = $this->scriptDir . ScriptInjector::AOP;
- if (! file_exists($pointcutsPath)) {
- return false;
- }
-
- $serialized = file_get_contents($pointcutsPath);
- assert(! is_bool($serialized));
- $er = error_reporting(error_reporting() ^ E_NOTICE);
- $pointcuts = unserialize($serialized, ['allowed_classes' => true]);
- error_reporting($er);
-
- return $pointcuts;
- }
-}
diff --git a/src/compiler/PrivateProperty.php b/src/compiler/PrivateProperty.php
deleted file mode 100644
index 5b0ee44a..00000000
--- a/src/compiler/PrivateProperty.php
+++ /dev/null
@@ -1,34 +0,0 @@
-setAccessible(true);
-
- return $refProp->getValue($object);
- }
-}
diff --git a/src/compiler/ScriptInjector.php b/src/compiler/ScriptInjector.php
deleted file mode 100644
index 940744cf..00000000
--- a/src/compiler/ScriptInjector.php
+++ /dev/null
@@ -1,294 +0,0 @@
-
- */
- private $singletons = [];
-
- /** @var array */
- private $functions;
-
- /** @var callable */
- private $lazyModule;
-
- /** @var AbstractModule|null */
- private $module;
-
- /** @var ?array */
- private $container;
-
- /** @var bool */
- private $isModuleLocked = false;
-
- /** @var array */
- private static $scriptDirs = [];
-
- /**
- * @param string $scriptDir generated instance script folder path
- * @param callable $lazyModule callable variable which return AbstractModule instance
- *
- * @psalm-suppress UnresolvableInclude
- */
- public function __construct($scriptDir, ?callable $lazyModule = null)
- {
- $this->scriptDir = $scriptDir;
- $this->lazyModule = $lazyModule ?: static function (): NullModule {
- return new NullModule();
- };
- $this->registerLoader();
- $prototype =
- /**
- * @param array{0: string, 1: string, 2: string} $injectionPoint
- *
- * @return mixed
- */
- function (string $dependencyIndex, array $injectionPoint = ['', '', '']) {
- $this->ip = $injectionPoint; // @phpstan-ignore-line
- [$prototype, $singleton, $injectionPoint, $injector] = $this->functions;
-
- return require $this->getInstanceFile($dependencyIndex);
- };
- $singleton =
- /**
- * @param array{0: string, 1: string, 2: string} $injectionPoint
- *
- * @return mixed
- */
- function (string $dependencyIndex, $injectionPoint = ['', '', '']) {
- if (isset($this->singletons[$dependencyIndex])) {
- return $this->singletons[$dependencyIndex];
- }
-
- $this->ip = $injectionPoint;
- [$prototype, $singleton, $injectionPoint, $injector] = $this->functions;
-
- $instance = require $this->getInstanceFile($dependencyIndex);
- $this->singletons[$dependencyIndex] = $instance;
-
- return $instance;
- };
- $injectionPoint = function () use ($scriptDir): InjectionPoint {
- return new InjectionPoint(
- new ReflectionParameter([$this->ip[0], $this->ip[1]], $this->ip[2]),
- $scriptDir
- );
- };
- $injector = function (): self {
- return $this;
- };
- $this->functions = [$prototype, $singleton, $injectionPoint, $injector];
- }
-
- /**
- * @return list
- */
- public function __sleep()
- {
- $this->saveModule();
-
- return ['scriptDir', 'singletons'];
- }
-
- public function __wakeup()
- {
- $this->__construct(
- $this->scriptDir,
- function () {
- return $this->getModule();
- }
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getInstance($interface, $name = Name::ANY)
- {
- $dependencyIndex = $interface . '-' . $name;
- if (isset($this->singletons[$dependencyIndex])) {
- return $this->singletons[$dependencyIndex];
- }
-
- [$prototype, $singleton, $injectionPoint, $injector] = $this->functions;
- /** @psalm-suppress UnresolvableInclude */
- $instance = require $this->getInstanceFile($dependencyIndex);
- /** @psalm-suppress UndefinedVariable */
- $isSingleton = isset($isSingleton) && $isSingleton; // @phpstan-ignore-line
- if ($isSingleton) { // @phpstan-ignore-line
- $this->singletons[$dependencyIndex] = $instance;
- }
-
- return $instance;
- }
-
- public function clear(): void
- {
- $unlink = static function (string $path) use (&$unlink): void {
- foreach ((array) glob(rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*') as $f) {
- $file = (string) $f;
- is_dir($file) ? $unlink($file) : unlink($file);
- @rmdir($file);
- }
- };
- $unlink($this->scriptDir);
- }
-
- public function isSingleton(string $dependencyIndex): bool
- {
- if (! $this->container) {
- $module = $this->getModule();
- /** @var AbstractModule $module */
- $this->container = $module->getContainer()->getContainer();
- }
-
- if (! isset($this->container[$dependencyIndex])) {
- throw new Unbound($dependencyIndex);
- }
-
- $dependency = $this->container[$dependencyIndex];
-
- return $dependency instanceof Dependency ? (new PrivateProperty())($dependency, 'isSingleton') : false;
- }
-
- private function getModule(): AbstractModule
- {
- $modulePath = $this->scriptDir . self::MODULE;
- if (! file_exists($modulePath)) {
- return new NullModule();
- }
-
- $serialized = file_get_contents($modulePath);
- assert(! is_bool($serialized));
- $er = error_reporting(error_reporting() ^ E_NOTICE);
- $module = unserialize($serialized, ['allowed_classes' => true]);
- error_reporting($er);
- assert($module instanceof AbstractModule);
-
- return $module;
- }
-
- /**
- * Return compiled script file name
- */
- private function getInstanceFile(string $dependencyIndex): string
- {
- $file = sprintf(self::INSTANCE, $this->scriptDir, str_replace('\\', '_', $dependencyIndex));
- if (file_exists($file)) {
- return $file;
- }
-
- $this->compileOnDemand($dependencyIndex);
- assert(file_exists($file));
-
- return $file;
- }
-
- private function saveModule(): void
- {
- if ($this->isModuleLocked || file_exists($this->scriptDir . self::MODULE)) {
- return;
- }
-
- $this->isModuleLocked = true;
- $module = $this->module instanceof AbstractModule ? $this->module : ($this->lazyModule)();
- (new FilePutContents())($this->scriptDir . self::MODULE, serialize($module));
- }
-
- private function registerLoader(): void
- {
- if (in_array($this->scriptDir, self::$scriptDirs, true)) {
- return;
- }
-
- if (self::$scriptDirs === []) {
- spl_autoload_register(
- static function (string $class): void {
- foreach (self::$scriptDirs as $scriptDir) {
- $file = sprintf('%s/%s.php', $scriptDir, str_replace('\\', '_', $class));
- if (file_exists($file)) {
- require $file; // @codeCoverageIgnore
- }
- }
- }
- );
- }
-
- self::$scriptDirs[] = $this->scriptDir;
- }
-
- private function compileOnDemand(string $dependencyIndex): void
- {
- if (! $this->module instanceof AbstractModule) {
- $this->module = ($this->lazyModule)();
- }
-
- $isFirstCompile = ! file_exists($this->scriptDir . self::AOP);
- if ($isFirstCompile) {
- (new DiCompiler(($this->lazyModule)(), $this->scriptDir))->savePointcuts($this->module->getContainer());
- $this->saveModule();
- }
-
- assert($this->module instanceof AbstractModule);
- (new Bind($this->module->getContainer(), ''))->annotatedWith(ScriptDir::class)->toInstance($this->scriptDir);
- (new OnDemandCompiler($this, $this->scriptDir, $this->module))($dependencyIndex, $this->scriptDir);
- }
-}
diff --git a/src/compiler/ScriptinjectorModule.php b/src/compiler/ScriptinjectorModule.php
deleted file mode 100644
index 1008c5a1..00000000
--- a/src/compiler/ScriptinjectorModule.php
+++ /dev/null
@@ -1,28 +0,0 @@
-scriptDir = $scriptDir;
- parent::__construct($module);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function configure(): void
- {
- $this->bind(InjectorInterface::class)->toInstance(new ScriptInjector($this->scriptDir));
- }
-}
diff --git a/src/di/AbstractModule.php b/src/di/AbstractModule.php
index d541066f..87f1e7bf 100644
--- a/src/di/AbstractModule.php
+++ b/src/di/AbstractModule.php
@@ -11,6 +11,8 @@
use Ray\Aop\PriorityPointcut;
use function assert;
+use function class_exists;
+use function interface_exists;
abstract class AbstractModule
{
@@ -79,7 +81,14 @@ public function bindInterceptor(AbstractMatcher $classMatcher, AbstractMatcher $
$pointcut = new Pointcut($classMatcher, $methodMatcher, $interceptors);
$this->getContainer()->addPointcut($pointcut);
foreach ($interceptors as $interceptor) {
- (new Bind($this->getContainer(), $interceptor))->to($interceptor)->in(Scope::SINGLETON);
+ if (class_exists($interceptor)) {
+ (new Bind($this->getContainer(), $interceptor))->to($interceptor)->in(Scope::SINGLETON);
+
+ return;
+ }
+
+ assert(interface_exists($interceptor));
+ (new Bind($this->getContainer(), $interceptor))->in(Scope::SINGLETON);
}
}
diff --git a/src/di/Argument.php b/src/di/Argument.php
index 7bbd38d4..8ebf943b 100644
--- a/src/di/Argument.php
+++ b/src/di/Argument.php
@@ -88,7 +88,30 @@ public function getMeta(): string
return $this->meta;
}
- public function serialize(): string
+ /**
+ * {@inheritDoc}
+ */
+ public function serialize()
+ {
+ return serialize($this->__serialize());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @psalm-param string $serializedData
+ */
+ public function unserialize($serializedData)
+ {
+ /** @var array{0: string, 1: bool, 2: string, 3: string, 4: string, 5: array{0: string, 1: string, 2:string}} $array */
+ $array = unserialize($serializedData, ['allowed_classes' => false]);
+ $this->__unserialize($array);
+ }
+
+ /**
+ * @return array
+ */
+ public function __serialize(): array
{
$method = $this->reflection->getDeclaringFunction();
assert($method instanceof ReflectionMethod);
@@ -98,24 +121,20 @@ public function serialize(): string
$this->reflection->getName(),
];
- return serialize([
+ return [
$this->index,
$this->isDefaultAvailable,
$this->default,
$this->meta,
$ref,
- ]);
+ ];
}
/**
- * @param string $serialized
- *
- * @throws ReflectionException
+ * @param array{0: string, 1: bool, 2: string, 3: string, 4: string, 5: array{0: string, 1: string, 2:string}} $unserialized
*/
- public function unserialize($serialized): void
+ public function __unserialize(array $unserialized): void
{
- /** @var array{0: string, 1: bool, 2: string, 3: string, 4: string, 5: array{0: string, 1: string, 2:string}} $unserialized */
- $unserialized = unserialize($serialized, ['allowed_classes' => false]);
[
$this->index,
$this->isDefaultAvailable,
diff --git a/src/di/AspectBind.php b/src/di/AspectBind.php
index f8fab815..c1ee53e6 100644
--- a/src/di/AspectBind.php
+++ b/src/di/AspectBind.php
@@ -8,7 +8,6 @@
use Ray\Aop\MethodInterceptor;
use function assert;
-use function is_string;
final class AspectBind
{
@@ -32,7 +31,7 @@ public function inject(Container $container): array
foreach ($bindings as $methodName => $interceptorClassNames) {
$interceptors = [];
foreach ($interceptorClassNames as $interceptorClassName) {
- assert(is_string($interceptorClassName));
+ /** @var class-string $interceptorClassName */
/** @psalm-suppress MixedAssignment */
$interceptor = $container->getInstance($interceptorClassName, Name::ANY);
assert($interceptor instanceof MethodInterceptor);
diff --git a/src/di/AssistedInjectInterceptor.php b/src/di/AssistedInjectInterceptor.php
index 259e5791..c3de1013 100644
--- a/src/di/AssistedInjectInterceptor.php
+++ b/src/di/AssistedInjectInterceptor.php
@@ -59,7 +59,7 @@ public function invoke(MethodInvocation $invocation)
$callable = [$invocation->getThis(), $invocation->getMethod()->getName()];
assert(is_callable($callable));
- return call_user_func_array($callable, $namedArguments); // @phpstan-ignore-line PHP8 named arguments
+ return call_user_func_array($callable, $namedArguments);
}
/**
@@ -92,6 +92,7 @@ private function getDependency(ReflectionParameter $param)
$typeName = $type ? $type->getName() : '';
$interface = in_array($typeName, Argument::UNBOUND_TYPE) ? '' : $typeName;
+ /** @var class-string $interface */
return $this->injector->getInstance($interface, $named);
}
diff --git a/src/di/AssistedInterceptor.php b/src/di/AssistedInterceptor.php
index 6b9ba09c..3d640f1e 100644
--- a/src/di/AssistedInterceptor.php
+++ b/src/di/AssistedInterceptor.php
@@ -11,8 +11,12 @@
use Ray\Di\Di\Named;
use ReflectionNamedType;
use ReflectionParameter;
+use ReflectionType;
+use function assert;
+use function class_exists;
use function in_array;
+use function interface_exists;
use function parse_str;
/**
@@ -70,9 +74,10 @@ public function injectAssistedParameters(ReflectionMethod $method, Assisted $ass
}
$type = $parameter->getType();
- $interface = $type instanceof ReflectionNamedType && ! in_array($type->getName(), Argument::UNBOUND_TYPE, true) ? $type->getName() : '';
+ $interface = $this->getInterface($type);
$name = $this->getName($method, $parameter);
$pos = $parameter->getPosition();
+ assert(class_exists($interface) || interface_exists($interface) || $interface === '');
/** @psalm-suppress MixedAssignment */
$arguments[$pos] = $this->injector->getInstance($interface, $name);
}
@@ -98,4 +103,9 @@ private function getName(ReflectionMethod $method, ReflectionParameter $paramete
return Name::ANY;
}
+
+ private function getInterface(?ReflectionType $type): string
+ {
+ return $type instanceof ReflectionNamedType && ! in_array($type->getName(), Argument::UNBOUND_TYPE, true) ? $type->getName() : '';
+ }
}
diff --git a/src/di/Bind.php b/src/di/Bind.php
index ba085072..0f9cffe1 100644
--- a/src/di/Bind.php
+++ b/src/di/Bind.php
@@ -169,7 +169,7 @@ public function toNull(): self
*/
public function in(string $scope): self
{
- if ($this->bound instanceof Dependency || $this->bound instanceof DependencyProvider) {
+ if ($this->bound instanceof Dependency || $this->bound instanceof DependencyProvider || $this->bound instanceof NullDependency) {
$this->bound->setScope($scope);
}
diff --git a/src/di/BindValidator.php b/src/di/BindValidator.php
index 79e671b7..83b23c56 100644
--- a/src/di/BindValidator.php
+++ b/src/di/BindValidator.php
@@ -4,6 +4,8 @@
namespace Ray\Di;
+use Ray\Aop\MethodInterceptor;
+use Ray\Aop\NullInterceptor;
use Ray\Di\Exception\InvalidProvider;
use Ray\Di\Exception\InvalidType;
use Ray\Di\Exception\NotFound;
@@ -36,7 +38,7 @@ public function to(string $interface, string $class): ReflectionClass
throw new NotFound($class);
}
- if (interface_exists($interface) && ! (new ReflectionClass($class))->implementsInterface($interface)) {
+ if (! $this->isNullInterceptorBinding($class, $interface) && interface_exists($interface) && ! (new ReflectionClass($class))->implementsInterface($interface)) {
throw new InvalidType("[{$class}] is no implemented [{$interface}] interface");
}
@@ -65,4 +67,9 @@ public function toProvider(string $provider): ReflectionClass
return new ReflectionClass($provider);
}
+
+ private function isNullInterceptorBinding(string $class, string $interface): bool
+ {
+ return $class === NullInterceptor::class && interface_exists($interface) && (new ReflectionClass($interface))->implementsInterface(MethodInterceptor::class);
+ }
}
diff --git a/src/di/Container.php b/src/di/Container.php
index 3ac4f822..cc9e6557 100644
--- a/src/di/Container.php
+++ b/src/di/Container.php
@@ -10,6 +10,7 @@
use Ray\Aop\Pointcut;
use Ray\Di\Exception\Unbound;
use Ray\Di\Exception\Untargeted;
+use Ray\Di\MultiBinding\MultiBindings;
use ReflectionClass;
use function array_merge;
@@ -17,20 +18,28 @@
use function explode;
use function ksort;
-final class Container
+final class Container implements InjectorInterface
{
+ /** @var MultiBindings */
+ public $multiBindings;
+
/** @var DependencyInterface[] */
private $container = [];
/** @var array */
private $pointcuts = [];
+ public function __construct()
+ {
+ $this->multiBindings = new MultiBindings();
+ }
+
/**
* @return list
*/
public function __sleep()
{
- return ['container', 'pointcuts'];
+ return ['container', 'pointcuts', 'multiBindings'];
}
/**
@@ -51,14 +60,14 @@ public function addPointcut(Pointcut $pointcut): void
}
/**
- * Return instance by interface + name(interface namespace)
- *
- * @param class-string|string $interface
- *
- * @return mixed
+ * {@inheritDoc}
*/
- public function getInstance(string $interface, string $name)
+ public function getInstance($interface, $name = Name::ANY)
{
+ /**
+ * @psalm-var T is object ? T : mixed
+ * @phpstan-var mixed
+ */
return $this->getDependency($interface . '-' . $name);
}
@@ -161,6 +170,7 @@ public function getPointcuts(): array
*/
public function merge(self $container): void
{
+ $this->multiBindings->merge($container->multiBindings);
$this->container += $container->getContainer();
$this->pointcuts = array_merge($this->pointcuts, $container->getPointcuts());
}
diff --git a/src/di/ContainerFactory.php b/src/di/ContainerFactory.php
new file mode 100644
index 00000000..241b9c1b
--- /dev/null
+++ b/src/di/ContainerFactory.php
@@ -0,0 +1,45 @@
+|null $module Module(s)
+ */
+ public function __invoke($module, string $classDir): Container
+ {
+ $module = $module ?? new NullModule();
+ $builtInModules = [
+ new AssistedModule(),
+ new ProviderSetModule(),
+ new MultiBindingModule(),
+ ];
+ $modules = array_merge($builtInModules, is_array($module) ? $module : [$module]);
+ $baseModule = array_shift($modules);
+ foreach ($modules as $module) {
+ $baseModule->install($module);
+ }
+
+ $container = $baseModule->getContainer();
+ $container->map(static function (DependencyInterface $dependency) use ($classDir) {
+ if ($dependency instanceof NullObjectDependency) {
+ return $dependency->toNull($classDir);
+ }
+
+ return $dependency;
+ });
+ $container->weaveAspects(new Compiler($classDir));
+
+ return $container;
+ }
+}
diff --git a/src/di/Dependency.php b/src/di/Dependency.php
index b315aa77..0d5493ec 100644
--- a/src/di/Dependency.php
+++ b/src/di/Dependency.php
@@ -125,6 +125,10 @@ public function weaveAspects(CompilerInterface $compiler, array $pointcuts): voi
$class = (string) $this->newInstance;
/** @psalm-suppress RedundantConditionGivenDocblockType */
assert(class_exists($class));
+ if ((new ReflectionClass($class))->isFinal()) {
+ return;
+ }
+
$isInterceptor = (new ReflectionClass($class))->implementsInterface(MethodInterceptor::class);
$isWeaved = (new ReflectionClass($class))->implementsInterface(WeavedInterface::class);
if ($isInterceptor || $isWeaved) {
diff --git a/src/di/Di/Named.php b/src/di/Di/Named.php
index 33140cd5..312a928e 100644
--- a/src/di/Di/Named.php
+++ b/src/di/Di/Named.php
@@ -14,7 +14,7 @@
* @Target("METHOD")
* @NamedArgumentConstructor
*/
-#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_METHOD)]
+#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_METHOD | Attribute::TARGET_PROPERTY)]
final class Named
{
/** @var string */
diff --git a/src/di/Di/Set.php b/src/di/Di/Set.php
new file mode 100644
index 00000000..68cb90ec
--- /dev/null
+++ b/src/di/Di/Set.php
@@ -0,0 +1,32 @@
+interface = $interface;
+ $this->name = $name;
+ }
+}
diff --git a/src/di/Exception/SetNotFound.php b/src/di/Exception/SetNotFound.php
new file mode 100644
index 00000000..ecec8285
--- /dev/null
+++ b/src/di/Exception/SetNotFound.php
@@ -0,0 +1,11 @@
+reader, $this->pClass, $this->pFunction, $this->pName];
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @param array{0: Reader, 1: string, 2: string, 3: string} $array
+ */
+ public function __unserialize(array $array): void
+ {
+ [$this->reader, $this->pClass, $this->pFunction, $this->pName] = $array;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function serialize()
{
- return serialize([$this->reader, $this->pClass, $this->pFunction, $this->pName]);
+ return serialize($this->__serialize());
}
/**
- * @param string $serialized
+ * {@inheritDoc}
+ *
+ * @psalm-param string $serializedData
*/
- public function unserialize($serialized): void
+ public function unserialize($serializedData)
{
- /** @var array{0: Reader, 1: string, 2: string, 3: string} $unserialized */
- $unserialized = unserialize($serialized, ['allowed_classes' => [AnnotationReader::class]]);
- [$this->reader, $this->pClass, $this->pFunction, $this->pName] = $unserialized;
+ /** @var array{0: Reader, 1: string, 2: string, 3: string} $array */
+ $array = unserialize($serializedData, ['allowed_classes' => [Reader::class]]);
+ $this->__unserialize($array);
}
}
diff --git a/src/di/Injector.php b/src/di/Injector.php
index b31f4440..2b5b589d 100644
--- a/src/di/Injector.php
+++ b/src/di/Injector.php
@@ -28,27 +28,15 @@ class Injector implements InjectorInterface
private $container;
/**
- * @param AbstractModule $module Binding module
- * @param string $tmpDir Temp directory for generated class
+ * @param AbstractModule|non-empty-array|null $module Module(s)
+ * @param string $tmpDir Temp directory for generated class
*/
- public function __construct(?AbstractModule $module = null, string $tmpDir = '')
+ public function __construct($module = null, string $tmpDir = '')
{
- $module = $module ?? new NullModule();
- $module->install(new AssistedModule());
$this->classDir = is_dir($tmpDir) ? $tmpDir : sys_get_temp_dir();
- $this->container = $module->getContainer();
- $this->container->map(function (DependencyInterface $dependency) {
- if ($dependency instanceof NullObjectDependency) {
- return $dependency->toNull($this->classDir);
- }
-
- return $dependency;
- });
- $this->container->weaveAspects(new Compiler($this->classDir));
-
- // builtin injection
+ $this->container = (new ContainerFactory())($module, $this->classDir);
+ // Bind injector (built-in bindings)
(new Bind($this->container, InjectorInterface::class))->toInstance($this);
- (new Bind($this->container, ''))->annotatedWith(ScriptDir::class)->toInstance($this->classDir);
$this->container->sort();
}
@@ -68,12 +56,7 @@ function (string $class): void {
}
/**
- * Return instance
- *
- * @param class-string|string $interface
- * @param string $name
- *
- * @return mixed instance
+ * {@inheritDoc}
*/
public function getInstance($interface, $name = Name::ANY)
{
@@ -81,6 +64,7 @@ public function getInstance($interface, $name = Name::ANY)
/** @psalm-suppress MixedAssignment */
$instance = $this->container->getInstance($interface, $name);
} catch (Untargeted $e) {
+ /** @psalm-var class-string $interface */
$this->bind($interface);
/** @psalm-suppress MixedAssignment */
$instance = $this->getInstance($interface, $name);
@@ -93,11 +77,12 @@ public function getInstance($interface, $name = Name::ANY)
throw new Unbound($message);
}
+ /** @psalm-suppress MixedReturnStatement */
return $instance;
}
/**
- * @phpstan-param class-string|string $class
+ * @param class-string $class
*
* @throws AnnotationException
*/
diff --git a/src/di/InjectorInterface.php b/src/di/InjectorInterface.php
index 1d187be4..a373eed8 100644
--- a/src/di/InjectorInterface.php
+++ b/src/di/InjectorInterface.php
@@ -4,15 +4,28 @@
namespace Ray\Di;
+/**
+ * Builds the graphs of objects that make up your application
+ *
+ * The injector tracks the dependencies for each type and uses bindings to inject them.
+ * This is the core of Ray.Di, although you rarely interact with it directly.
+ * This "behind-the-scenes" operation is what distinguishes dependency injection from its cousin, the service locator pattern.
+ */
interface InjectorInterface
{
/**
- * Return instance by interface + name (interface namespace)
+ * Return object graph
*
- * @param string $interface
- * @param string $name
+ * @param class-string $interface interface name|class name|empty-string
+ * @param string $name interface name space
+ * @psalm-param ''|class-string $interface
+ * @phpstan-param ''|class-string $interface
*
- * @return mixed
+ * @return T
+ * @psalm-return (T is object ? T : mixed)
+ * @phpstan-return mixed
+ *
+ * @psalm-template T of object
*/
- public function getInstance($interface, $name = Name::ANY);
+ public function getInstance($interface, $name = Name::ANY); // @phpstan-ignore-line
}
diff --git a/src/di/MethodInvocationProvider.php b/src/di/MethodInvocationProvider.php
index bee2972a..76b10724 100644
--- a/src/di/MethodInvocationProvider.php
+++ b/src/di/MethodInvocationProvider.php
@@ -7,7 +7,7 @@
use Ray\Aop\MethodInvocation;
use Ray\Di\Exception\MethodInvocationNotAvailable;
-class MethodInvocationProvider implements ProviderInterface
+final class MethodInvocationProvider implements ProviderInterface
{
/** @var ?MethodInvocation */
private $invocation;
diff --git a/src/di/MultiBinder.php b/src/di/MultiBinder.php
new file mode 100644
index 00000000..baf7f25a
--- /dev/null
+++ b/src/di/MultiBinder.php
@@ -0,0 +1,98 @@
+container = $module->getContainer();
+ $this->multiBindings = $this->container->multiBindings;
+ $this->interface = $interface;
+ $this->container->add(
+ (new Bind($this->container, MultiBindings::class))->toInstance($this->multiBindings)
+ );
+ }
+
+ public static function newInstance(AbstractModule $module, string $interface): self
+ {
+ return new self($module, $interface);
+ }
+
+ public function addBinding(?string $key = null): self
+ {
+ $this->key = $key;
+
+ return $this;
+ }
+
+ public function setBinding(?string $key = null): self
+ {
+ $this->container->multiBindings->exchangeArray([]);
+ $this->key = $key;
+
+ return $this;
+ }
+
+ /**
+ * @param class-string $class
+ */
+ public function to(string $class): void
+ {
+ $this->bind(new LazyTo($class), $this->key);
+ }
+
+ /**
+ * @param class-string $provider
+ */
+ public function toProvider(string $provider): void
+ {
+ $this->bind(new LazyProvider($provider), $this->key);
+ }
+
+ /**
+ * @param mixed $instance
+ */
+ public function toInstance($instance): void
+ {
+ $this->bind(new LazyInstance($instance), $this->key);
+ }
+
+ private function bind(LazyInteterface $lazy, ?string $key): void
+ {
+ $bindings = [];
+ if ($this->multiBindings->offsetExists($this->interface)) {
+ $bindings = $this->multiBindings->offsetGet($this->interface);
+ }
+
+ if ($key === null) {
+ $bindings[] = $lazy;
+ $this->multiBindings->offsetSet($this->interface, $bindings); // @phpstan-ignore-line
+
+ return;
+ }
+
+ $bindings[$key] = $lazy;
+ $this->multiBindings->offsetSet($this->interface, $bindings);
+ }
+}
diff --git a/src/di/MultiBinding/LazyInstance.php b/src/di/MultiBinding/LazyInstance.php
new file mode 100644
index 00000000..9ab8c9ee
--- /dev/null
+++ b/src/di/MultiBinding/LazyInstance.php
@@ -0,0 +1,34 @@
+instance = $class;
+ }
+
+ /**
+ * @return T
+ */
+ public function __invoke(InjectorInterface $injector)
+ {
+ unset($injector);
+
+ return $this->instance;
+ }
+}
diff --git a/src/di/MultiBinding/LazyInteterface.php b/src/di/MultiBinding/LazyInteterface.php
new file mode 100644
index 00000000..7768c335
--- /dev/null
+++ b/src/di/MultiBinding/LazyInteterface.php
@@ -0,0 +1,15 @@
+ */
+ private $class;
+
+ /**
+ * @param class-string $class
+ */
+ public function __construct(string $class)
+ {
+ $this->class = $class;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function __invoke(InjectorInterface $injector)
+ {
+ $provider = $injector->getInstance($this->class);
+ assert($provider instanceof ProviderInterface);
+
+ return $provider->get();
+ }
+}
diff --git a/src/di/MultiBinding/LazyTo.php b/src/di/MultiBinding/LazyTo.php
new file mode 100644
index 00000000..c9aff8d7
--- /dev/null
+++ b/src/di/MultiBinding/LazyTo.php
@@ -0,0 +1,32 @@
+ */
+ private $class;
+
+ /**
+ * @param class-string $class
+ */
+ public function __construct(string $class)
+ {
+ $this->class = $class;
+ }
+
+ /**
+ * @return T
+ */
+ public function __invoke(InjectorInterface $injector)
+ {
+ return $injector->getInstance($this->class); // @phpstan-ignore-line
+ }
+}
diff --git a/src/di/MultiBinding/Map.php b/src/di/MultiBinding/Map.php
new file mode 100644
index 00000000..17f4cbf0
--- /dev/null
+++ b/src/di/MultiBinding/Map.php
@@ -0,0 +1,113 @@
+
+ */
+final class Map implements IteratorAggregate, ArrayAccess, Countable
+{
+ /** @var array $lazies */
+ private $lazies;
+
+ /** @var InjectorInterface */
+ private $injector;
+
+ /**
+ * @param array $lazies
+ */
+ public function __construct(array $lazies, InjectorInterface $injector)
+ {
+ $this->lazies = $lazies;
+ $this->injector = $injector;
+ }
+
+ /**
+ * @param array-key $offset
+ *
+ * @codeCoverageIgnore
+ */
+ #[ReturnTypeWillChange]
+ public function offsetExists($offset): bool
+ {
+ return array_key_exists($offset, $this->lazies);
+ }
+
+ /**
+ * @param array-key $offset
+ *
+ * @return T
+ *
+ * @codeCoverageIgnore
+ */
+ #[ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ /** @var T $instance */
+ $instance = ($this->lazies[$offset])($this->injector);
+
+ return $instance;
+ }
+
+ /**
+ * @param array-key $offset
+ * @param mixed $value
+ *
+ * @return never
+ *
+ * @codeCoverageIgnore
+ */
+ #[ReturnTypeWillChange]
+ public function offsetSet($offset, $value)
+ {
+ unset($offset, $value);
+
+ throw new LogicException();
+ }
+
+ /**
+ * @param array-key $offset
+ *
+ * @return never
+ *
+ * @codeCoverageIgnore
+ */
+ #[ReturnTypeWillChange]
+ public function offsetUnset($offset)
+ {
+ unset($offset);
+
+ throw new LogicException();
+ }
+
+ /** @return Generator */
+ public function getIterator(): Iterator
+ {
+ foreach ($this->lazies as $key => $lazy) {
+ /** @var T $object */
+ $object = ($lazy)($this->injector);
+
+ yield $key => $object;
+ }
+ }
+
+ public function count(): int
+ {
+ return count($this->lazies);
+ }
+}
diff --git a/src/di/MultiBinding/MapProvider.php b/src/di/MultiBinding/MapProvider.php
new file mode 100644
index 00000000..ebf86856
--- /dev/null
+++ b/src/di/MultiBinding/MapProvider.php
@@ -0,0 +1,53 @@
+multiBindings = $multiBindings;
+ $this->ip = $ip;
+ $this->injector = $injector;
+ $this->reader = $reader;
+ }
+
+ public function get(): Map
+ {
+ /** @var ?Set $set */
+ $set = $this->reader->getParametrAnnotation($this->ip->getParameter(), Set::class);
+ if ($set === null) {
+ throw new SetNotFound((string) $this->ip->getParameter());
+ }
+
+ /** @var array> $lazies */
+ $lazies = $this->multiBindings[$set->interface];
+
+ return new Map($lazies, $this->injector);
+ }
+}
diff --git a/src/di/MultiBinding/MultiBindingModule.php b/src/di/MultiBinding/MultiBindingModule.php
new file mode 100644
index 00000000..a0fcb12e
--- /dev/null
+++ b/src/di/MultiBinding/MultiBindingModule.php
@@ -0,0 +1,19 @@
+bind(ParamReaderInterface::class)->to(ParamReader::class)->in(Scope::SINGLETON);
+ $this->bind(Map::class)->toProvider(MapProvider::class);
+ }
+}
diff --git a/src/di/MultiBinding/MultiBindings.php b/src/di/MultiBinding/MultiBindings.php
new file mode 100644
index 00000000..f0b1b84c
--- /dev/null
+++ b/src/di/MultiBinding/MultiBindings.php
@@ -0,0 +1,22 @@
+>
+ */
+final class MultiBindings extends ArrayObject
+{
+ public function merge(self $multiBindings): void
+ {
+ $this->exchangeArray(
+ array_merge_recursive($this->getArrayCopy(), $multiBindings->getArrayCopy())
+ );
+ }
+}
diff --git a/src/di/Name.php b/src/di/Name.php
index bc5f345e..8205b377 100644
--- a/src/di/Name.php
+++ b/src/di/Name.php
@@ -16,7 +16,6 @@
use function class_exists;
use function explode;
use function get_class;
-use function is_object;
use function is_string;
use function preg_match;
use function substr;
@@ -62,11 +61,6 @@ public function __construct($name = null)
/**
* Create instance from PHP8 attributes
*
- * @psalm-suppress MixedAssignment
- * @psalm-suppress UndefinedMethod
- * @psalm-suppress MixedMethodCall
- * @psalm-suppress MixedArrayAccess
- *
* psalm does not know ReflectionAttribute?? PHPStan produces no type error here.
*/
public static function withAttributes(ReflectionMethod $method): ?self
@@ -74,7 +68,7 @@ public static function withAttributes(ReflectionMethod $method): ?self
$params = $method->getParameters();
$names = [];
foreach ($params as $param) {
- /** @var array{0: ReflectionAttribute}|null $attributes */
+ /** @var array $attributes */
$attributes = $param->getAttributes();
if ($attributes) {
$names[$param->name] = self::getName($attributes);
@@ -89,15 +83,15 @@ public static function withAttributes(ReflectionMethod $method): ?self
}
/**
- * @param array{0: ReflectionAttribute} $attributes
+ * @param non-empty-array $attributes
*
* @throws ReflectionException
*/
private static function getName(array $attributes): string
{
$refAttribute = $attributes[0];
+ /** @var Named|object $attribute */
$attribute = $refAttribute->newInstance();
- assert(is_object($attribute));
if ($attribute instanceof Named) {
return $attribute->value;
}
diff --git a/src/di/ProviderInterface.php b/src/di/ProviderInterface.php
index a56fde51..2ebfbb85 100644
--- a/src/di/ProviderInterface.php
+++ b/src/di/ProviderInterface.php
@@ -5,14 +5,12 @@
namespace Ray\Di;
/**
- * Interface for instance provider. (lazy-loading)
+ * @template T of mixed
*/
interface ProviderInterface
{
/**
- * Get an instance
- *
- * @return mixed
+ * @return T
*/
public function get();
}
diff --git a/src/di/ProviderSetModule.php b/src/di/ProviderSetModule.php
new file mode 100644
index 00000000..94e64c3e
--- /dev/null
+++ b/src/di/ProviderSetModule.php
@@ -0,0 +1,13 @@
+bind(ProviderInterface::class)->toProvider(ProviderSetProvider::class);
+ }
+}
diff --git a/src/di/ProviderSetProvider.php b/src/di/ProviderSetProvider.php
new file mode 100644
index 00000000..8cf3775b
--- /dev/null
+++ b/src/di/ProviderSetProvider.php
@@ -0,0 +1,66 @@
+ip = $ip;
+ $this->injector = $injector;
+ $this->reader = $reader;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function get()
+ {
+ /** @var ?Set $set */
+ $set = $this->reader->getParametrAnnotation($this->ip->getParameter(), Set::class);
+ if ($set === null) {
+ throw new SetNotFound((string) $this->ip->getParameter());
+ }
+
+ return new class ($this->injector, $set) implements ProviderInterface
+ {
+ /** @var InjectorInterface */
+ private $injector;
+
+ /** @var Set */
+ private $set;
+
+ public function __construct(InjectorInterface $injector, Set $set)
+ {
+ $this->injector = $injector;
+ $this->set = $set;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function get()
+ {
+ return $this->injector->getInstance($this->set->interface, $this->set->name);
+ }
+ };
+ }
+}
diff --git a/src/di/SpyCompiler.php b/src/di/SpyCompiler.php
index 89f03389..d183c921 100644
--- a/src/di/SpyCompiler.php
+++ b/src/di/SpyCompiler.php
@@ -6,7 +6,6 @@
use Ray\Aop\BindInterface;
use Ray\Aop\CompilerInterface;
-use stdClass;
use function array_keys;
use function implode;
@@ -19,12 +18,14 @@
final class SpyCompiler implements CompilerInterface
{
/**
- * {@inheritdoc}
+ * {@inheritDoc}
+ *
+ * @psalm-suppress InvalidReturnType
+ * @template T of object
*/
public function newInstance(string $class, array $args, BindInterface $bind)
{
- // never called
- return new stdClass();
+ // never called // @phpstan-ignore-line
}
/**
@@ -80,6 +81,10 @@ private function getInterceptors(BindInterface $bind): string
$log = ' (aop)';
foreach ($bindings as $method => $interceptors) {
+ /**
+ * @phpstan-var array $interceptors
+ * @psalm-ignore-var
+ */
$log .= sprintf(
' +%s(%s)',
$method,
diff --git a/tests-php8/AssistedInjectTest.php b/tests-php8/AssistedInjectTest.php
index 3af6851e..3dba84ec 100644
--- a/tests-php8/AssistedInjectTest.php
+++ b/tests-php8/AssistedInjectTest.php
@@ -66,4 +66,22 @@ public function testAssistedCustomeInject(): void
$i = $assistedConsumer->assistCustomeAssistedInject();
$this->assertSame(1, $i);
}
+
+ /**
+ * @requires PHP 8.1
+ */
+ public function testConstructorPropertyPromotion(): void
+ {
+ $injector = new Injector(
+ new class extends AbstractModule
+ {
+ protected function configure()
+ {
+ $this->bind()->annotatedWith('abc')->toInstance('abc');
+ }
+ }
+ );
+ $fake = $injector->getInstance(FakePropConstruct::class);
+ $this->assertSame('abc', $fake->abc);
+ }
}
diff --git a/tests/compiler/CachedFactoryTest.php b/tests/compiler/CachedFactoryTest.php
deleted file mode 100644
index eef893a3..00000000
--- a/tests/compiler/CachedFactoryTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-getInjector('dev');
- $injector2 = $this->getInjector('dev');
- $this->assertSame(spl_object_hash($injector1), spl_object_hash($injector2));
- }
-
- public function testInstanceCachedInFileCache(): void
- {
- $injector1 = $this->getInjector('prod');
- $this->assertFalse(DevCache::$wasHit);
- $injector2 = $this->getInjector('prod');
- $this->assertFalse(DevCache::$wasHit);
- $this->assertSame(spl_object_hash($injector1), spl_object_hash($injector2));
- $injector2->getInstance(FakeRobotInterface::class);
- }
-
- /**
- * @param 'dev'|'prod' $context
- */
- private function getInjector(string $context): InjectorInterface
- {
- if ($context === 'dev') {
- return CachedInjectorFactory::getInstance(
- 'dev',
- __DIR__ . '/tmp/dev',
- static function (): AbstractModule {
- return new FakeToBindPrototypeModule();
- }
- );
- }
-
- return CachedInjectorFactory::getInstance(
- 'prod',
- __DIR__ . '/tmp/prod',
- static function (): AbstractModule {
- $module = new FakeToBindSingletonModule();
- $module->install(new DiCompileModule(true));
-
- return $module;
- },
- new DevCache(new NullCache()),
- [FakeRobotInterface::class] // FakeRobotInterface object is cached in an injector.
- );
- }
-}
diff --git a/tests/compiler/DependencyCompilerTest.php b/tests/compiler/DependencyCompilerTest.php
deleted file mode 100644
index 60078154..00000000
--- a/tests/compiler/DependencyCompilerTest.php
+++ /dev/null
@@ -1,149 +0,0 @@
-getCode($dependencyInstance);
- $expected = <<<'EOT'
-assertSame($expected, (string) $code);
- }
-
- public function testInstanceCompileInt(): void
- {
- $dependencyInstance = new Instance(1);
- $code = (new DependencyCode(new Container()))->getCode($dependencyInstance);
- $expected = <<<'EOT'
-assertSame($expected, (string) $code);
- }
-
- public function testInstanceCompileArray(): void
- {
- $dependencyInstance = new Instance([1, 2, 3]);
- $code = (new DependencyCode(new Container()))->getCode($dependencyInstance);
- $expected = <<<'EOT'
-assertSame($expected, (string) $code);
- }
-
- public function testDependencyCompile(): void
- {
- $container = (new FakeCarModule())->getContainer();
- $dependency = $container->getContainer()['Ray\Compiler\FakeCarInterface-' . Name::ANY];
- $code = (new DependencyCode($container))->getCode($dependency);
- $expectedTemplate = <<<'EOT'
-setTires($prototype('Ray\\Compiler\\FakeTyreInterface-{ANY}'), $prototype('Ray\\Compiler\\FakeTyreInterface-{ANY}'), null);
-$instance->setHardtop($prototype('Ray\\Compiler\\FakeHardtopInterface-{ANY}'));
-$instance->setMirrors($singleton('Ray\\Compiler\\FakeMirrorInterface-right'), $singleton('Ray\\Compiler\\FakeMirrorInterface-left'));
-$instance->setSpareMirror($singleton('Ray\\Compiler\\FakeMirrorInterface-right'));
-$instance->setHandle($prototype('Ray\\Compiler\\FakeHandleInterface-{ANY}', array('Ray\\Compiler\\FakeCar', 'setHandle', 'handle')));
-$instance->postConstruct();
-$isSingleton = false;
-return $instance;
-EOT;
- $expected = str_replace('{ANY}', Name::ANY, $expectedTemplate);
- $this->assertSame($expected, (string) $code);
- }
-
- public function testDependencyProviderCompile(): void
- {
- $container = (new FakeCarModule())->getContainer();
- $dependency = $container->getContainer()['Ray\Compiler\FakeHandleInterface-' . Name::ANY];
- $code = (new DependencyCode($container))->getCode($dependency);
- $expected = <<<'EOT'
-get();
-EOT;
- $this->assertSame($expected, (string) $code);
- }
-
- public function testDependencyInstanceCompile(): void
- {
- $container = (new FakeCarModule())->getContainer();
- $dependency = $container->getContainer()['-logo'];
- $code = (new DependencyCode($container))->getCode($dependency);
- $expected = <<<'EOT'
-assertSame($expected, (string) $code);
- }
-
- public function testDependencyObjectInstanceCompile(): void
- {
- $container = (new FakeCarModule())->getContainer();
- $dependency = new Instance(new FakeEngine());
- $code = (new DependencyCode($container))->getCode($dependency);
- $expected = <<<'EOT'
-assertSame($expected, (string) $code);
- }
-
- public function testDomainException(): void
- {
- $this->expectException(DomainException::class);
- (new DependencyCode(new Container()))->getCode(new FakeInvalidDependency());
- }
-
- public function testContextualProviderCompile(): void
- {
- $container = (new FakeContextualModule('context'))->getContainer();
- $dependency = $container->getContainer()['Ray\Compiler\FakeRobotInterface-' . Name::ANY];
- $code = (new DependencyCode($container))->getCode($dependency);
- $expected = <<<'EOT'
-setContext('context');
-$isSingleton = false;
-return $instance->get();
-EOT;
- $this->assertSame($expected, (string) $code);
- }
-}
diff --git a/tests/compiler/DevCache.php b/tests/compiler/DevCache.php
deleted file mode 100644
index fd281dc4..00000000
--- a/tests/compiler/DevCache.php
+++ /dev/null
@@ -1,83 +0,0 @@
-cache = $cache;
- }
-
- /**
- * @param string $id
- *
- * @return false|mixed
- */
- public function doFetch($id)
- {
- $data = $this->cache->fetch($id);
- self::$wasHit = (bool) $data;
-
- return $data;
- }
-
- /**
- * @param string $id
- *
- * @return bool
- */
- public function doContains($id)
- {
- return $this->cache->contains($id);
- }
-
- /**
- * @param string $id
- * @param string $data
- * @param int $lifeTime
- *
- * @return bool
- */
- public function doSave($id, $data, $lifeTime = 0)
- {
- return $this->cache->save($id, $data, $lifeTime);
- }
-
- /**
- * @param string $id
- *
- * @return bool
- */
- public function doDelete($id)
- {
- return $this->cache->delete($id);
- }
-
- /**
- * @return ?array
- */
- public function doGetStats()
- {
- return $this->cache->getStats();
- }
-
- /**
- * @return bool
- */
- public function doFlush()
- {
- return true;
- }
-}
diff --git a/tests/compiler/DiCompilerTest.php b/tests/compiler/DiCompilerTest.php
deleted file mode 100644
index 2e28ce98..00000000
--- a/tests/compiler/DiCompilerTest.php
+++ /dev/null
@@ -1,136 +0,0 @@
-expectException(Unbound::class);
- $injector = new ScriptInjector(__DIR__ . '/tmp');
- $injector->getInstance(FakeCarInterface::class);
- }
-
- public function testCompile(): void
- {
- $compiler = new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp');
- $compiler->compile();
- $any = Name::ANY;
- $files = [
- "Ray_Compiler_FakeCarInterface-{$any}.php",
- "Ray_Compiler_FakeEngineInterface-{$any}.php",
- "Ray_Compiler_FakeHandleInterface-{$any}.php",
- "Ray_Compiler_FakeHardtopInterface-{$any}.php",
- 'Ray_Compiler_FakeMirrorInterface-right.php',
- 'Ray_Compiler_FakeMirrorInterface-left.php',
- "Ray_Compiler_FakeTyreInterface-{$any}.php",
- ];
- foreach ($files as $file) {
- $filePath = __DIR__ . '/tmp/' . $file;
- $this->assertFileExists($filePath, $filePath);
- }
-
- $injector = new ScriptInjector(__DIR__ . '/tmp');
- $car = $injector->getInstance(FakeCarInterface::class);
- $this->assertInstanceOf(FakeCar::class, $car);
- }
-
- public function testsGetInstance(): void
- {
- $compiler = new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp');
- $car = $compiler->getInstance(FakeCarInterface::class);
- $this->assertInstanceOf(FakeCar::class, $car);
- }
-
- public function testAopCompile(): void
- {
- $compiler = new DiCompiler(new FakeAopModule(), __DIR__ . '/tmp');
- $compiler->compile();
- $any = Name::ANY;
- $files = [
- "Ray_Compiler_FakeAopInterface-{$any}.php",
- "Ray_Compiler_FakeDoubleInterceptor-{$any}.php",
- ];
- foreach ($files as $file) {
- $this->assertFileExists(__DIR__ . '/tmp/' . $file);
- }
-
- $this->testAopCompileFile();
- }
-
- /**
- * @depends testAopCompile
- */
- public function testAopCompileFile(): void
- {
- $script = new ScriptInjector(__DIR__ . '/tmp');
- $instance = $script->getInstance(FakeAopInterface::class);
- assert($instance instanceof FakeAop);
- $this->assertInstanceOf(FakeAop::class, $instance);
- $this->assertInstanceOf(WeavedInterface::class, $instance);
- $result = $instance->returnSame(1);
- $expected = 2;
- $this->assertSame($expected, $result);
- }
-
- public function testInjectionPoint(): void
- {
- $compiler = new DiCompiler(new FakeLoggerModule(), __DIR__ . '/tmp');
- $compiler->compile();
- $injector = new ScriptInjector(__DIR__ . '/tmp');
- $loggerConsumer = $injector->getInstance(FakeLoggerConsumer::class);
- assert($loggerConsumer->logger instanceof FakeLogger);
- $this->assertSame('Ray\Compiler\FakeLoggerConsumer', $loggerConsumer->logger->name);
- $this->assertSame('MEMORY', $loggerConsumer->logger->type);
- }
-
- public function testDump(): void
- {
- $compiler = new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp');
- $compiler->dumpGraph();
- $any = Name::ANY;
- $this->assertFileExists(__DIR__ . '/tmp/graph/Ray_Compiler_FakeCarInterface-' . $any . '.html');
- }
-
- /**
- * @return array|float|int|string|true|null)>>
- */
- public function instanceProvider(): array
- {
- return [
- ['bool', true],
- ['null', null],
- ['int', 1],
- ['float', 1.0],
- ['string', 'ray'],
- ['no_index_array', [1, 2]],
- ['assoc', ['a' => 1]],
- ];
- }
-
- /**
- * @param array<(int|string), int>|float|int|string|true|null $expected
- *
- * @dataProvider instanceProvider
- */
- public function testInstance(string $name, $expected): void
- {
- $compiler = new DiCompiler(new FakeInstanceModule(), __DIR__ . '/tmp');
- $compiler->compile();
- $injector = new ScriptInjector(__DIR__ . '/tmp');
- $result = $injector->getInstance('', $name);
- $this->assertSame($expected, $result);
- $object = $injector->getInstance('', 'object');
- $this->assertInstanceOf(DateTime::class, $object);
- }
-}
diff --git a/tests/compiler/Fake/.placefolder b/tests/compiler/Fake/.placefolder
deleted file mode 100644
index e69de29b..00000000
diff --git a/tests/compiler/Fake/FakeAop.php b/tests/compiler/Fake/FakeAop.php
deleted file mode 100644
index 8b86a066..00000000
--- a/tests/compiler/Fake/FakeAop.php
+++ /dev/null
@@ -1,13 +0,0 @@
-bind(FakeAopInterface::class)->to(FakeAop::class);
- $this->bindInterceptor(
- $this->matcher->any(),
- $this->matcher->any(),
- [FakeDoubleInterceptor::class]
- );
- }
-}
diff --git a/tests/compiler/Fake/FakeCar.php b/tests/compiler/Fake/FakeCar.php
deleted file mode 100644
index 3ad4a3b9..00000000
--- a/tests/compiler/Fake/FakeCar.php
+++ /dev/null
@@ -1,90 +0,0 @@
-frontTyre = $frontTyre;
- $this->rearTyre = $rearTyre;
- $this->null = $null;
- }
-
- /**
- * @Inject(optional=true)
- */
- public function setHardtop(FakeHardtopInterface $hardtop)
- {
- $this->hardtop = $hardtop;
- }
-
- /**
- * @Inject
- * @Named("rightMirror=right,leftMirror=left")
- */
- public function setMirrors(FakeMirrorInterface $rightMirror, FakeMirrorInterface $leftMirror)
- {
- $this->rightMirror = $rightMirror;
- $this->leftMirror = $leftMirror;
- }
-
- /**
- * @Inject
- * @Named("right")
- */
- public function setSpareMirror(FakeMirrorInterface $rightMirror)
- {
- $this->spareMirror = $rightMirror;
- }
-
- /**
- * @Inject
- */
- public function setHandle(FakeHandleInterface $handle)
- {
- $this->handle = $handle;
- }
-
- /**
- * Inject annotation at constructor is just for human, not mandatory.
- */
- public function __construct(FakeEngineInterface $engine)
- {
- $this->engine = $engine;
- }
-
- /**
- * @PostConstruct
- */
- public function postConstruct()
- {
- $isEngineInstalled = $this->engine instanceof FakeEngine;
- $isTyreInstalled = $this->frontTyre instanceof FakeTyre;
- if ($isEngineInstalled && $isTyreInstalled) {
- $this->isConstructed = true;
- }
- }
-}
diff --git a/tests/compiler/Fake/FakeCar2.php b/tests/compiler/Fake/FakeCar2.php
deleted file mode 100644
index 0570aaad..00000000
--- a/tests/compiler/Fake/FakeCar2.php
+++ /dev/null
@@ -1,15 +0,0 @@
-robot = $robot;
- }
-}
diff --git a/tests/compiler/Fake/FakeCarEngine.php b/tests/compiler/Fake/FakeCarEngine.php
deleted file mode 100644
index 1a8da907..00000000
--- a/tests/compiler/Fake/FakeCarEngine.php
+++ /dev/null
@@ -1,9 +0,0 @@
-bind(FakeCarInterface::class)->to(FakeCar::class); // dependent
- $this->bind(FakeEngineInterface::class)->to(FakeEngine::class); // constructor
- $this->bind(FakeHardtopInterface::class)->to(FakeHardtop::class); // optional setter
- $this->bind(FakeTyreInterface::class)->to(FakeTyre::class); // setter
- $this->bind(FakeMirrorInterface::class)->annotatedWith('right')->to(FakeMirrorRight::class)->in(Scope::SINGLETON); // named binding
- $this->bind(FakeMirrorInterface::class)->annotatedWith('left')->to(FakeMirrorLeft::class)->in(Scope::SINGLETON); // named binding
- $this->bind('')->annotatedWith('logo')->toInstance('momo');
- $this->bind(FakeHandleInterface::class)->toProvider(FakeHandleProvider::class);
- $this->bindInterceptor(
- $this->matcher->any(),
- $this->matcher->any(),
- [FakeInterceptor::class]
- );
- $this->bind(FakeCar::class);
- $this->bind(FakeRobot::class);
- }
-}
diff --git a/tests/compiler/Fake/FakeConstantInterface.php b/tests/compiler/Fake/FakeConstantInterface.php
deleted file mode 100644
index da193c65..00000000
--- a/tests/compiler/Fake/FakeConstantInterface.php
+++ /dev/null
@@ -1,9 +0,0 @@
-context = $context;
- }
-
- protected function configure()
- {
- $this->bind(FakeRobotInterface::class)->toProvider(FakeContextualProvider::class, $this->context);
- }
-}
diff --git a/tests/compiler/Fake/FakeContextualProvider.php b/tests/compiler/Fake/FakeContextualProvider.php
deleted file mode 100644
index fa2f52c9..00000000
--- a/tests/compiler/Fake/FakeContextualProvider.php
+++ /dev/null
@@ -1,26 +0,0 @@
-context = $context;
- }
-
- public function get()
- {
- return new FakeContextualRobot($this->context);
- }
-}
diff --git a/tests/compiler/Fake/FakeContextualRobot.php b/tests/compiler/Fake/FakeContextualRobot.php
deleted file mode 100644
index 79aab9e1..00000000
--- a/tests/compiler/Fake/FakeContextualRobot.php
+++ /dev/null
@@ -1,15 +0,0 @@
-context = $context;
- }
-}
diff --git a/tests/compiler/Fake/FakeDependPrototype.php b/tests/compiler/Fake/FakeDependPrototype.php
deleted file mode 100644
index 2d2fc049..00000000
--- a/tests/compiler/Fake/FakeDependPrototype.php
+++ /dev/null
@@ -1,16 +0,0 @@
-car = $car;
- }
-}
diff --git a/tests/compiler/Fake/FakeDependSingleton.php b/tests/compiler/Fake/FakeDependSingleton.php
deleted file mode 100644
index 4c7c4538..00000000
--- a/tests/compiler/Fake/FakeDependSingleton.php
+++ /dev/null
@@ -1,16 +0,0 @@
-robot = $robot;
- }
-}
diff --git a/tests/compiler/Fake/FakeDevModule.php b/tests/compiler/Fake/FakeDevModule.php
deleted file mode 100644
index df37ac65..00000000
--- a/tests/compiler/Fake/FakeDevModule.php
+++ /dev/null
@@ -1,15 +0,0 @@
-bind(FakeRobotInterface::class)->to(FakeDevRobot::class);
- }
-}
diff --git a/tests/compiler/Fake/FakeDevRobot.php b/tests/compiler/Fake/FakeDevRobot.php
deleted file mode 100644
index ed98d694..00000000
--- a/tests/compiler/Fake/FakeDevRobot.php
+++ /dev/null
@@ -1,9 +0,0 @@
-proceed();
-
- return $result * 2;
- }
-}
diff --git a/tests/compiler/Fake/FakeEngine.php b/tests/compiler/Fake/FakeEngine.php
deleted file mode 100644
index a124a92b..00000000
--- a/tests/compiler/Fake/FakeEngine.php
+++ /dev/null
@@ -1,9 +0,0 @@
-injector = $injector;
- }
-}
diff --git a/tests/compiler/Fake/FakeHandle.php b/tests/compiler/Fake/FakeHandle.php
deleted file mode 100644
index 6d06003e..00000000
--- a/tests/compiler/Fake/FakeHandle.php
+++ /dev/null
@@ -1,10 +0,0 @@
-logo = $logo;
- }
-
- public function get()
- {
- $handle = new FakeHandle();
- $handle->logo = $this->logo;
-
- return $handle;
- }
-}
diff --git a/tests/compiler/Fake/FakeHardtop.php b/tests/compiler/Fake/FakeHardtop.php
deleted file mode 100644
index 9ca1fdf6..00000000
--- a/tests/compiler/Fake/FakeHardtop.php
+++ /dev/null
@@ -1,9 +0,0 @@
-bind()->annotatedWith('bool')->toInstance(true);
- $this->bind()->annotatedWith('null')->toInstance(null);
- $this->bind()->annotatedWith('int')->toInstance(1);
- $this->bind()->annotatedWith('float')->toInstance(1.0);
- $this->bind()->annotatedWith('string')->toInstance('ray');
- $this->bind()->annotatedWith('no_index_array')->toInstance([1, 2]);
- $this->bind()->annotatedWith('assoc')->toInstance(['a' => 1]);
- $this->bind()->annotatedWith('object')->toInstance(new DateTime());
- }
-}
diff --git a/tests/compiler/Fake/FakeInterceptor.php b/tests/compiler/Fake/FakeInterceptor.php
deleted file mode 100644
index cb0a413d..00000000
--- a/tests/compiler/Fake/FakeInterceptor.php
+++ /dev/null
@@ -1,20 +0,0 @@
-getArguments();
-
- return $invocation->proceed();
- }
-}
diff --git a/tests/compiler/Fake/FakeInvalidDependency.php b/tests/compiler/Fake/FakeInvalidDependency.php
deleted file mode 100644
index 8c3fbc1c..00000000
--- a/tests/compiler/Fake/FakeInvalidDependency.php
+++ /dev/null
@@ -1,28 +0,0 @@
-name = $name;
- $this->type = $type;
- }
-}
diff --git a/tests/compiler/Fake/FakeLoggerConsumer.php b/tests/compiler/Fake/FakeLoggerConsumer.php
deleted file mode 100644
index 2f3646ab..00000000
--- a/tests/compiler/Fake/FakeLoggerConsumer.php
+++ /dev/null
@@ -1,29 +0,0 @@
-injector = $injector;
- }
-
- /**
- * @FakeLoggerInject(type="MEMORY")
- */
- public function setLogger(FakeLoggerInterface $logger)
- {
- $this->logger = $logger;
- }
-}
diff --git a/tests/compiler/Fake/FakeLoggerInject.php b/tests/compiler/Fake/FakeLoggerInject.php
deleted file mode 100644
index 42a29699..00000000
--- a/tests/compiler/Fake/FakeLoggerInject.php
+++ /dev/null
@@ -1,25 +0,0 @@
-bind(FakeLoggerInterface::class)->annotatedWith(FakeLoggerInject::class)->toProvider(FakeLoggerPointProvider::class);
- $this->bind(FakeLoggerConsumer::class);
- }
-}
diff --git a/tests/compiler/Fake/FakeLoggerPointProvider.php b/tests/compiler/Fake/FakeLoggerPointProvider.php
deleted file mode 100644
index e839f65e..00000000
--- a/tests/compiler/Fake/FakeLoggerPointProvider.php
+++ /dev/null
@@ -1,31 +0,0 @@
-ip = $ip;
- }
-
- public function get()
- {
- $class = $this->ip->getClass()->getName();
- $this->qualifiers = $this->ip->getQualifiers();
- $fakeLoggerInject = $this->qualifiers[0];
-
- /** @var FakeLoggerInject $fakeLoggerInject */
- return new FakeLogger($class, $fakeLoggerInject->type);
- }
-}
diff --git a/tests/compiler/Fake/FakeMirrorInterface.php b/tests/compiler/Fake/FakeMirrorInterface.php
deleted file mode 100644
index 25ce90a7..00000000
--- a/tests/compiler/Fake/FakeMirrorInterface.php
+++ /dev/null
@@ -1,9 +0,0 @@
-bind(FakeTyreInterface::class)->toNull();
- }
-}
diff --git a/tests/compiler/Fake/FakeOptional.php b/tests/compiler/Fake/FakeOptional.php
deleted file mode 100644
index 91c625fb..00000000
--- a/tests/compiler/Fake/FakeOptional.php
+++ /dev/null
@@ -1,20 +0,0 @@
-robot = $robot;
- }
-}
diff --git a/tests/compiler/Fake/FakeProdModule.php b/tests/compiler/Fake/FakeProdModule.php
deleted file mode 100644
index f62400c6..00000000
--- a/tests/compiler/Fake/FakeProdModule.php
+++ /dev/null
@@ -1,15 +0,0 @@
-install(new DiCompileModule(true));
- }
-}
diff --git a/tests/compiler/Fake/FakeRobot.php b/tests/compiler/Fake/FakeRobot.php
deleted file mode 100644
index bf41206c..00000000
--- a/tests/compiler/Fake/FakeRobot.php
+++ /dev/null
@@ -1,9 +0,0 @@
-bind(FakeRobotInterface::class)->to(FakeRobot::class);
- }
-}
diff --git a/tests/compiler/Fake/FakeToBindSingletonModule.php b/tests/compiler/Fake/FakeToBindSingletonModule.php
deleted file mode 100644
index e9553596..00000000
--- a/tests/compiler/Fake/FakeToBindSingletonModule.php
+++ /dev/null
@@ -1,16 +0,0 @@
-bind(FakeRobotInterface::class)->to(FakeRobot::class)->in(Scope::SINGLETON);
- }
-}
diff --git a/tests/compiler/Fake/FakeToInstancePrototypeModule.php b/tests/compiler/Fake/FakeToInstancePrototypeModule.php
deleted file mode 100644
index 79c4bce4..00000000
--- a/tests/compiler/Fake/FakeToInstancePrototypeModule.php
+++ /dev/null
@@ -1,15 +0,0 @@
-bind(FakeRobotInterface::class)->toInstance(new FakeRobot());
- }
-}
diff --git a/tests/compiler/Fake/FakeToInstanceSingletonModule.php b/tests/compiler/Fake/FakeToInstanceSingletonModule.php
deleted file mode 100644
index 16dc7eff..00000000
--- a/tests/compiler/Fake/FakeToInstanceSingletonModule.php
+++ /dev/null
@@ -1,16 +0,0 @@
-bind(FakeRobotInterface::class)->toInstance(new FakeRobot())->toInstance(Scope::SINGLETON);
- }
-}
diff --git a/tests/compiler/Fake/FakeToProviderPrototypeModule.php b/tests/compiler/Fake/FakeToProviderPrototypeModule.php
deleted file mode 100644
index aa50e8a3..00000000
--- a/tests/compiler/Fake/FakeToProviderPrototypeModule.php
+++ /dev/null
@@ -1,15 +0,0 @@
-bind(FakeRobotInterface::class)->toProvider(FakeRobotProvider::class);
- }
-}
diff --git a/tests/compiler/Fake/FakeToProviderSingletonModule.php b/tests/compiler/Fake/FakeToProviderSingletonModule.php
deleted file mode 100644
index 07618fac..00000000
--- a/tests/compiler/Fake/FakeToProviderSingletonModule.php
+++ /dev/null
@@ -1,16 +0,0 @@
-bind(FakeRobotInterface::class)->toProvider(FakeRobotProvider::class)->in(Scope::SINGLETON);
- }
-}
diff --git a/tests/compiler/Fake/FakeTyre.php b/tests/compiler/Fake/FakeTyre.php
deleted file mode 100644
index b914afea..00000000
--- a/tests/compiler/Fake/FakeTyre.php
+++ /dev/null
@@ -1,9 +0,0 @@
-setHandle(new FakeHandle());
-$instance->postConstruct();
-
-return $instance;
diff --git a/tests/compiler/Fake/script/instance.php b/tests/compiler/Fake/script/instance.php
deleted file mode 100644
index 7f887f4b..00000000
--- a/tests/compiler/Fake/script/instance.php
+++ /dev/null
@@ -1,5 +0,0 @@
-parse(file_get_contents(__DIR__ . "/{$file}"));
- var_dump($stmts);
-} catch (PhpParser\Error $e) {
- echo 'Parse Error: ', $e->getMessage();
-}
diff --git a/tests/compiler/Fake/script/singleton.php b/tests/compiler/Fake/script/singleton.php
deleted file mode 100644
index e026bfac..00000000
--- a/tests/compiler/Fake/script/singleton.php
+++ /dev/null
@@ -1,5 +0,0 @@
-getInstance(FakeRobotInterface::class);
- $this->assertInstanceOf(FakeRobot::class, $instance);
- $this->assertInstanceOf(Injector::class, $injector);
- }
-
- public function getInstanceScriptInjector(): void
- {
- $injector = InjectorFactory::getInstance(
- static function (): AbstractModule {
- $modue = new FakeToBindPrototypeModule();
- $modue->install(new FakeProdModule());
-
- return $modue;
- },
- __DIR__ . '/tmp/base'
- );
- $instance = $injector->getInstance(FakeRobotInterface::class);
- $this->assertInstanceOf(FakeRobot::class, $instance);
- $this->assertInstanceOf(ScriptInjector::class, $injector);
- }
-
- public function testInjectComplexModule(): void
- {
- $injector = InjectorFactory::getInstance(
- static function (): AbstractModule {
- return new FakeCarModule();
- },
- __DIR__ . '/tmp/car'
- );
- $instance = $injector->getInstance(FakeCarInterface::class);
- $this->assertInstanceOf(FakeCar::class, $instance);
- }
-
- public function testInjectionPoint(): void
- {
- $injector = InjectorFactory::getInstance(
- static function (): AbstractModule {
- return new FakeLoggerModule();
- },
- __DIR__ . '/tmp/logger'
- );
- $instance = $injector->getInstance(FakeLoggerConsumer::class);
- $this->assertInstanceOf(FakeLoggerConsumer::class, $instance);
- }
-}
diff --git a/tests/compiler/NormalizerTest.php b/tests/compiler/NormalizerTest.php
deleted file mode 100644
index 2ec1bf6f..00000000
--- a/tests/compiler/NormalizerTest.php
+++ /dev/null
@@ -1,36 +0,0 @@
-assertInstanceOf(String_::class, $string);
- $this->assertSame('ray', $string->value);
- }
-
- public function testInvalidValue(): void
- {
- $this->expectException(InvalidInstance::class);
-
- $normalizer = new Normalizer();
- $resource = fopen(__FILE__, 'r');
- $normalizer($resource);
- }
-}
diff --git a/tests/compiler/ScriptInjectorNullObjectTest.php b/tests/compiler/ScriptInjectorNullObjectTest.php
deleted file mode 100644
index 23bc2d34..00000000
--- a/tests/compiler/ScriptInjectorNullObjectTest.php
+++ /dev/null
@@ -1,29 +0,0 @@
-getInstance(FakeTyreInterface::class);
- $this->assertInstanceOf(FakeTyreInterface::class, $instance);
-
- return $injector;
- }
-}
diff --git a/tests/compiler/ScriptInjectorTest.php b/tests/compiler/ScriptInjectorTest.php
deleted file mode 100644
index 59de536f..00000000
--- a/tests/compiler/ScriptInjectorTest.php
+++ /dev/null
@@ -1,271 +0,0 @@
-injector = new ScriptInjector(__DIR__ . '/tmp');
- }
-
- public function testGetInstance(): FakeCar
- {
- $diCompiler = new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp');
- $diCompiler->compile();
- $car = $this->injector->getInstance(FakeCarInterface::class);
- $this->assertInstanceOf(FakeCar::class, $car);
-
- return $car;
- }
-
- /**
- * @depends testGetInstance
- */
- public function testDefaultValueInjected(FakeCar $car): void
- {
- $this->assertNull($car->null);
- }
-
- public function testCompileException(): void
- {
- $this->expectException(Unbound::class);
- $script = new ScriptInjector(__DIR__ . '/tmp');
- $script->getInstance('invalid-class');
- }
-
- public function testToPrototype(): void
- {
- (new DiCompiler(new FakeToBindPrototypeModule(), __DIR__ . '/tmp'))->compile();
- $instance1 = $this->injector->getInstance(FakeRobotInterface::class);
- $instance2 = $this->injector->getInstance(FakeRobotInterface::class);
- $this->assertNotSame(spl_object_hash($instance1), spl_object_hash($instance2));
- }
-
- public function testToSingleton(): void
- {
- (new DiCompiler(new FakeToBindSingletonModule(), __DIR__ . '/tmp'))->compile();
- $instance1 = $this->injector->getInstance(FakeRobotInterface::class);
- $instance2 = $this->injector->getInstance(FakeRobotInterface::class);
- $this->assertSame($instance1, $instance2);
- }
-
- public function testToProviderPrototype(): void
- {
- (new DiCompiler(new FakeToProviderPrototypeModule(), __DIR__ . '/tmp'))->compile();
- $instance1 = $this->injector->getInstance(FakeRobotInterface::class);
- $instance2 = $this->injector->getInstance(FakeRobotInterface::class);
- $this->assertNotSame($instance1, $instance2);
- }
-
- public function testToProviderSingleton(): void
- {
- (new DiCompiler(new FakeToProviderSingletonModule(), __DIR__ . '/tmp'))->compile();
- $instance1 = $this->injector->getInstance(FakeRobotInterface::class);
- $instance2 = $this->injector->getInstance(FakeRobotInterface::class);
- $this->assertSame($instance1, $instance2);
- }
-
- public function testToInstancePrototype(): void
- {
- (new DiCompiler(new FakeToInstancePrototypeModule(), __DIR__ . '/tmp'))->compile();
- $instance1 = $this->injector->getInstance(FakeRobotInterface::class);
- $instance2 = $this->injector->getInstance(FakeRobotInterface::class);
- $this->assertNotSame($instance1, $instance2);
- }
-
- public function testToInstanceSingleton(): void
- {
- (new DiCompiler(new FakeToInstanceSingletonModule(), __DIR__ . '/tmp'))->compile();
- $instance1 = $this->injector->getInstance(FakeRobotInterface::class);
- $instance2 = $this->injector->getInstance(FakeRobotInterface::class);
- $this->assertSame($instance1, $instance2);
- }
-
- public function testSerializable(): void
- {
- $diCompiler = new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp');
- $diCompiler->compile();
- $injector = unserialize(serialize($this->injector));
- $car = $injector->getInstance(FakeCarInterface::class);
- $this->assertInstanceOf(ScriptInjector::class, $injector);
- $this->assertInstanceOf(FakeCar::class, $car);
- }
-
- public function testAop(): void
- {
- $compiler = new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp');
- $compiler->compile();
- $injector = new ScriptInjector(__DIR__ . '/tmp');
- $instance1 = $injector->getInstance(FakeCarInterface::class);
- $instance2 = $injector->getInstance(FakeCar::class);
- $instance3 = $injector->getInstance(FakeCar2::class);
- assert($instance3 instanceof FakeCar2);
- $this->assertInstanceOf(WeavedInterface::class, $instance1);
- $this->assertInstanceOf(WeavedInterface::class, $instance2);
- $this->assertInstanceOf(WeavedInterface::class, $instance3);
- $this->assertInstanceOf(FakeRobot::class, $instance3->robot);
- }
-
- public function testOnDemandSingleton(): void
- {
- (new DiCompiler(new FakeToBindSingletonModule(), __DIR__ . '/tmp'))->compile();
- $dependSingleton1 = $this->injector->getInstance(FakeDependSingleton::class);
- assert($dependSingleton1 instanceof FakeDependSingleton);
- $dependSingleton2 = $this->injector->getInstance(FakeDependSingleton::class);
- assert($dependSingleton2 instanceof FakeDependSingleton);
- $hash1 = spl_object_hash($dependSingleton1->robot);
- $hash2 = spl_object_hash($dependSingleton2->robot);
- $this->assertSame($hash1, $hash2);
- }
-
- public function testOnDemandPrototype(): void
- {
- (new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp'))->compile();
- $fakeDependPrototype1 = $this->injector->getInstance(FakeDependPrototype::class);
- assert($fakeDependPrototype1 instanceof FakeDependPrototype);
- $fakeDependPrototype2 = $this->injector->getInstance(FakeDependPrototype::class);
- assert($fakeDependPrototype2 instanceof FakeDependPrototype);
- $hash1 = spl_object_hash($fakeDependPrototype1->car);
- $hash2 = spl_object_hash($fakeDependPrototype2->car);
- $this->assertNotSame($hash1, $hash2);
- }
-
- public function testOptional(): void
- {
- $optional = $this->injector->getInstance(FakeOptional::class);
- assert($optional instanceof FakeOptional);
- $this->assertNull($optional->robot);
- }
-
- public function testDependInjector(): void
- {
- $diCompiler = new DiCompiler(new NullModule(), __DIR__ . '/tmp');
- $diCompiler->compile();
- $factory = $diCompiler->getInstance(FakeFactory::class);
- $this->assertInstanceOf(InjectorInterface::class, $factory->injector);
- $injector = new ScriptInjector(__DIR__ . '/tmp');
- $factory = $injector->getInstance(FakeFactory::class);
- $this->assertInstanceOf(InjectorInterface::class, $factory->injector);
- }
-
- public function testUnbound(): void
- {
- $this->expectException(Unbound::class);
- $this->expectExceptionMessage('NOCLASS-NONAME');
- $injector = new ScriptInjector(__DIR__ . '/tmp');
- $injector->getInstance('NOCLASS', 'NONAME');
- }
-
- public function testCompileOnDemand(): void
- {
- $injector = new ScriptInjector(
- __DIR__ . '/tmp',
- static function () {
- return new FakeCarModule();
- }
- );
- $car = $injector->getInstance(FakeCar::class);
- $this->assertTrue($car instanceof FakeCar);
- }
-
- public function testCompileOnDemandAop(): void
- {
- $injector = new ScriptInjector(
- __DIR__ . '/tmp',
- static function () {
- return new FakeAopModule();
- }
- );
- $aop = $injector->getInstance(FakeAopInterface::class);
- assert($aop instanceof FakeAopInterface);
- $result = $aop->returnSame(1);
- $this->assertSame(2, $result);
- }
-
- public function testCompileOnDemandSerialize(): void
- {
- $serialize = serialize(new ScriptInjector(
- __DIR__ . '/tmp',
- static function () {
- return new FakeCarModule();
- }
- ));
- $injector = unserialize($serialize);
- $car = $injector->getInstance(FakeCar::class);
- $this->assertTrue($car instanceof FakeCar);
- }
-
- public function testCompileOnDemandAopSerialize(): void
- {
- $injector = unserialize(serialize(new ScriptInjector(
- __DIR__ . '/tmp',
- static function () {
- return new FakeAopModule();
- }
- )));
- $aop = $injector->getInstance(FakeAopInterface::class);
- assert($aop instanceof FakeAopInterface);
- $result = $aop->returnSame(1);
- $this->assertSame(2, $result);
- }
-
- public function testClear(): void
- {
- $injector = new ScriptInjector(
- __DIR__ . '/tmp',
- static function () {
- return new FakeCarModule();
- }
- );
- $injector->getInstance(FakeCar::class);
- $count = count((array) glob(__DIR__ . '/tmp/*.php'));
- $this->assertGreaterThan(1, $count);
- $injector->clear();
- $countAfterClear = count((array) glob(__DIR__ . '/tmp/*.php'));
- $this->assertSame(0, $countAfterClear);
- }
-
- public function testNullObjectCompile(): ScriptInjector
- {
- $injector = new ScriptInjector(
- __DIR__ . '/tmp',
- static function () {
- return new FakeNullObjectModule();
- }
- );
- $instance = $injector->getInstance(FakeTyreInterface::class);
- $this->assertInstanceOf(FakeTyreInterface::class, $instance);
-
- return $injector;
- }
-
- /**
- * @runTestsInSeparateProcesses
- * @depends testNullObjectCompile
- */
- public function testNullObjectCompileCodeRead(ScriptInjector $injector): void
- {
- $instance = $injector->getInstance(FakeTyreInterface::class);
- $this->assertInstanceOf(FakeTyreInterface::class, $instance);
- }
-}
diff --git a/tests/compiler/script/null_object.php b/tests/compiler/script/null_object.php
deleted file mode 100644
index 6ff68f47..00000000
--- a/tests/compiler/script/null_object.php
+++ /dev/null
@@ -1,17 +0,0 @@
-getInstance(FakeTyreInterface::class);
diff --git a/tests/compiler/tmp/dev/.gitkeep b/tests/compiler/tmp/dev/.gitkeep
deleted file mode 100644
index e69de29b..00000000
diff --git a/tests/di/AnnotatedClassTest.php b/tests/di/AnnotatedClassTest.php
index 521399cd..2ef8b8ae 100644
--- a/tests/di/AnnotatedClassTest.php
+++ b/tests/di/AnnotatedClassTest.php
@@ -64,7 +64,7 @@ public function testAnnotatedByAnnotation(string $class): void
}
/**
- * @psalm-return array{0: array{0: FakeHandleBar::class}, 1: array{0: FakeHandleBarQualifier::class}}
+ * @return array>
*/
public function classProvider(): array
{
diff --git a/tests/di/ArgumentsTest.php b/tests/di/ArgumentsTest.php
index 0c7128a6..6546755b 100644
--- a/tests/di/ArgumentsTest.php
+++ b/tests/di/ArgumentsTest.php
@@ -8,6 +8,8 @@
use ReflectionMethod;
use ReflectionParameter;
+use function assert;
+use function is_object;
use function spl_object_hash;
class ArgumentsTest extends TestCase
@@ -26,7 +28,9 @@ public function testInject(): void
$parameters = $this->arguments->inject($container);
$this->assertInstanceOf(FakeTyre::class, $parameters[0]);
$this->assertInstanceOf(FakeTyre::class, $parameters[1]);
- $this->assertNotSame(spl_object_hash($parameters[0]), $parameters[1]);
+ $param0 = $parameters[0];
+ assert(is_object($param0));
+ $this->assertNotSame(spl_object_hash($param0), $parameters[1]);
}
public function testParameterDefaultValue(): void
diff --git a/tests/di/BindTest.php b/tests/di/BindTest.php
index cf42b97a..c06539b8 100644
--- a/tests/di/BindTest.php
+++ b/tests/di/BindTest.php
@@ -10,6 +10,8 @@
use Ray\Di\Exception\NotFound;
use function assert;
+use function is_object;
+use function property_exists;
use function spl_object_hash;
class BindTest extends TestCase
@@ -69,6 +71,8 @@ public function testUntargetedBindSingleton(): void
unset($bind);
$dependency1 = $container->getInstance(FakeEngine::class, Name::ANY);
$dependency2 = $container->getInstance(FakeEngine::class, Name::ANY);
+ assert(is_object($dependency1));
+ assert(is_object($dependency2));
$this->assertSame(spl_object_hash($dependency1), spl_object_hash($dependency2));
}
@@ -145,14 +149,18 @@ public function testBindProviderAsProviderInSingleton(): void
(new Bind($container, ProviderInterface::class))->annotatedWith('handle')->to(FakeHandleProvider::class)->in(Scope::SINGLETON);
$instance1 = $container->getInstance(ProviderInterface::class, 'handle');
$instance2 = $container->getInstance(ProviderInterface::class, 'handle');
+ assert(is_object($instance1));
+ assert(is_object($instance2));
$this->assertSame(spl_object_hash($instance1), spl_object_hash($instance2));
}
public function testProviderContext(): void
{
$container = new Container();
- $bind = (new Bind($container, ProviderInterface::class))->toProvider(FakeContextualProvider::class, 'context_string');
+ (new Bind($container, ProviderInterface::class))->toProvider(FakeContextualProvider::class, 'context_string');
$instance = $container->getInstance(ProviderInterface::class, Name::ANY);
+ assert(is_object($instance));
+ assert(property_exists($instance, 'context'));
$this->assertSame('context_string', $instance->context);
}
}
diff --git a/tests/di/ContainerTest.php b/tests/di/ContainerTest.php
index 49ad5fa0..43053d88 100644
--- a/tests/di/ContainerTest.php
+++ b/tests/di/ContainerTest.php
@@ -137,7 +137,7 @@ public function testMoveUnbound(): void
public function testAbstractClassUnbound(): void
{
try {
- $this->container->getInstance('_INVALID_INTERFACE_', Name::ANY);
+ $this->container->getInstance('_INVALID_INTERFACE_', Name::ANY); // @phpstan-ignore-line
} catch (Throwable $e) {
$this->assertSame(Unbound::class, get_class($e));
}
diff --git a/tests/di/DependencyTest.php b/tests/di/DependencyTest.php
index 91607292..5aec66c0 100644
--- a/tests/di/DependencyTest.php
+++ b/tests/di/DependencyTest.php
@@ -12,6 +12,9 @@
use ReflectionClass;
use ReflectionMethod;
+use function assert;
+use function is_object;
+use function property_exists;
use function spl_object_hash;
class DependencyTest extends TestCase
@@ -89,6 +92,7 @@ public function testPrototype(Container $container): void
$this->dependency->setScope(Scope::PROTOTYPE);
$car1 = $this->dependency->inject($container);
$car2 = $this->dependency->inject($container);
+ assert(is_object($car1) && is_object($car2));
$this->assertNotSame(spl_object_hash($car1), spl_object_hash($car2));
}
@@ -100,6 +104,7 @@ public function testSingleton(Container $container): void
$this->dependency->setScope(Scope::SINGLETON);
$car1 = $this->dependency->inject($container);
$car2 = $this->dependency->inject($container);
+ assert(is_object($car1) && is_object($car2));
$this->assertSame(spl_object_hash($car1), spl_object_hash($car2));
}
@@ -111,8 +116,10 @@ public function testInjectInterceptor(): void
$container = new Container();
$container->add((new Bind($container, FakeDoubleInterceptor::class))->to(FakeDoubleInterceptor::class));
$instance = $dependency->inject($container);
+ assert(is_object($instance));
$isWeave = (new ReflectionClass($instance))->implementsInterface(WeavedInterface::class);
$this->assertTrue($isWeave);
+ assert(property_exists($instance, 'bindings'));
$this->assertArrayHasKey('returnSame', $instance->bindings);
}
diff --git a/tests/di/DiCompilerTest.php b/tests/di/DiCompilerTest.php
index 3a0ebea9..107759ff 100644
--- a/tests/di/DiCompilerTest.php
+++ b/tests/di/DiCompilerTest.php
@@ -7,6 +7,10 @@
use PHPUnit\Framework\TestCase;
use Ray\Compiler\DiCompiler;
+use function assert;
+use function is_object;
+use function property_exists;
+
class DiCompilerTest extends TestCase
{
public function testUntargetInject(): void
@@ -15,6 +19,9 @@ public function testUntargetInject(): void
$compiler = new DiCompiler($module, __DIR__ . '/tmp');
$compiler->compile();
$fake = $compiler->getInstance(FakeUntarget::class);
+ assert(is_object($fake));
+ assert(property_exists($fake, 'child'));
+ assert(property_exists($fake->child, 'val'));
$this->assertSame(1, $fake->child->val);
}
}
diff --git a/tests/di/Fake/FakeAnnoInterceptorInterface.php b/tests/di/Fake/FakeAnnoInterceptorInterface.php
new file mode 100644
index 00000000..60ba22cd
--- /dev/null
+++ b/tests/di/Fake/FakeAnnoInterceptorInterface.php
@@ -0,0 +1,12 @@
+
+ * @Set(FakeEngineInterface::class)
+ */
+ public $engines;
+
+ /**
+ * @var Map
+ * @Set(FakeRobotInterface::class)
+ */
+ public $robots;
+
+ public function __construct(
+ Map $engines,
+ Map $robots
+ ){
+ $this->engines = $engines;
+ $this->robots = $robots;
+ }
+}
diff --git a/tests/di/Fake/FakeMultiBindingConsumer.php b/tests/di/Fake/FakeMultiBindingConsumer.php
new file mode 100644
index 00000000..c08b954d
--- /dev/null
+++ b/tests/di/Fake/FakeMultiBindingConsumer.php
@@ -0,0 +1,43 @@
+ $engines
+ * @param Map $robots
+ */
+ public function __construct(
+ #[Set(FakeEngineInterface::class)] public Map $engines,
+ #[Set(FakeRobotInterface::class)] public Map $robots
+ ){}
+
+ public function testValid(): void
+ {
+ $f = $this->engines['one'];
+ // cause no error in psalm
+ $f->foo();
+ }
+
+ /**
+ * Test generic
+ *
+ * This tests generic expression of Map
+ * Not called from any place. Created to confirm "@psalm-suppress" works with psalm
+ *
+ * @psalm-suppress UndefinedInterfaceMethod
+ */
+ public function testInvalid(): void
+ {
+ $f = $this->engines['one'];
+ // cause error in psalm
+ $f->warnUndefinedInterfaceMethod();
+ }
+}
diff --git a/tests/di/Fake/FakePropConstruct.php b/tests/di/Fake/FakePropConstruct.php
new file mode 100644
index 00000000..f6acfc04
--- /dev/null
+++ b/tests/di/Fake/FakePropConstruct.php
@@ -0,0 +1,15 @@
+ $provider
+ */
+ public function __construct(#[Set(FakeEngineInterface::class)] public ProviderInterface $provider)
+ {
+ $this->provider = $provider;
+ }
+
+ public function warn(): void
+ {
+ // valid method
+ $this->provider->get()->foo();
+
+ // invalid method (but phpstan does not detect the error)
+ /** @psalm-suppress UndefinedInterfaceMethod */
+ $this->provider->get()->bar();
+ }
+}
diff --git a/tests/di/Fake/FakeSetNotFoundWithMap.php b/tests/di/Fake/FakeSetNotFoundWithMap.php
new file mode 100644
index 00000000..e4f91406
--- /dev/null
+++ b/tests/di/Fake/FakeSetNotFoundWithMap.php
@@ -0,0 +1,29 @@
+
+ */
+ public $engines;
+
+ /**
+ * This property should Set annotated for setProviderButNotSetFound method.
+ * SetNotFound exception will be thrown.
+ */
+ public $engineProvider;
+
+ public function __construct(
+ Map $engines
+ ){
+ $this->engines = $engines;
+ }
+}
diff --git a/tests/di/Fake/FakeSetNotFoundWithProvider.php b/tests/di/Fake/FakeSetNotFoundWithProvider.php
new file mode 100644
index 00000000..cd3e7826
--- /dev/null
+++ b/tests/di/Fake/FakeSetNotFoundWithProvider.php
@@ -0,0 +1,24 @@
+$engineProvider = $engineProvider;
+ }
+}
diff --git a/tests/di/GrapherTest.php b/tests/di/GrapherTest.php
index 48ece574..09940062 100644
--- a/tests/di/GrapherTest.php
+++ b/tests/di/GrapherTest.php
@@ -9,8 +9,10 @@
use function assert;
use function file_get_contents;
+use function is_object;
use function is_string;
use function passthru;
+use function property_exists;
use function unserialize;
class GrapherTest extends TestCase
@@ -26,6 +28,8 @@ public function testGetInstanceWithArgs(): void
$grapher = new Grapher(new FakeUntargetModule(), __DIR__ . '/tmp');
$instance = $grapher->newInstanceArgs(FakeUntargetChild::class, ['1']);
$this->assertInstanceOf(FakeUntargetChild::class, $instance);
+ assert(is_object($instance));
+ assert(property_exists($instance, 'val'));
$this->assertSame('1', $instance->val);
}
diff --git a/tests/di/InjectorTest.php b/tests/di/InjectorTest.php
index 883f6d47..5b7a4f45 100644
--- a/tests/di/InjectorTest.php
+++ b/tests/di/InjectorTest.php
@@ -7,14 +7,17 @@
use LogicException;
use PDO;
use PHPUnit\Framework\TestCase;
+use Ray\Aop\NullInterceptor;
use Ray\Di\Exception\InvalidToConstructorNameParameter;
use Ray\Di\Exception\Unbound;
use function assert;
use function defined;
use function file_get_contents;
+use function is_object;
use function is_string;
use function passthru;
+use function property_exists;
use function serialize;
use function spl_object_hash;
use function unlink;
@@ -107,6 +110,7 @@ public function testToBindingPrototype(): void
$injector = new Injector(new FakeToBindModule());
$instance1 = $injector->getInstance(FakeRobotInterface::class);
$instance2 = $injector->getInstance(FakeRobotInterface::class);
+ assert(is_object($instance1) && is_object($instance2));
$this->assertNotSame(spl_object_hash($instance1), spl_object_hash($instance2));
}
@@ -115,6 +119,7 @@ public function testToBindingSingleton(): void
$injector = new Injector(new FakeToBindSingletonModule());
$instance1 = $injector->getInstance(FakeRobotInterface::class);
$instance2 = $injector->getInstance(FakeRobotInterface::class);
+ assert(is_object($instance1) && is_object($instance2));
$this->assertSame(spl_object_hash($instance1), spl_object_hash($instance2));
}
@@ -123,6 +128,7 @@ public function testToProviderBinding(): void
$injector = new Injector(new FakeToProviderBindModule());
$instance1 = $injector->getInstance(FakeRobotInterface::class);
$instance2 = $injector->getInstance(FakeRobotInterface::class);
+ assert(is_object($instance1) && is_object($instance2));
$this->assertNotSame(spl_object_hash($instance1), spl_object_hash($instance2));
}
@@ -138,6 +144,7 @@ public function testToProviderBindingSingleton(): void
$injector = new Injector(new FakeToProviderSingletonBindModule());
$instance1 = $injector->getInstance(FakeRobotInterface::class);
$instance2 = $injector->getInstance(FakeRobotInterface::class);
+ assert(is_object($instance1) && is_object($instance2));
$this->assertSame(spl_object_hash($instance1), spl_object_hash($instance2));
}
@@ -190,6 +197,7 @@ public function testAnnotationBasedInjection(): Injector
public function testSerialize(Injector $injector): void
{
$extractedInjector = unserialize(serialize($injector));
+ assert($extractedInjector instanceof InjectorInterface);
$car = $extractedInjector->getInstance(FakeCarInterface::class);
$this->assertInstanceOf(FakeCar::class, $car);
}
@@ -203,6 +211,27 @@ public function testAop(): void
$this->assertSame(4, $result);
}
+ public function testIntefaceBindingAop(): void
+ {
+ $module = new class extends AbstractModule{
+ protected function configure()
+ {
+ $this->bind(FakeAopInterface::class)->to(FakeAop::class);
+ $this->bind(FakeDoubleInterceptorInterface::class)->to(FakeDoubleInterceptor::class);
+ $this->bindInterceptor(
+ $this->matcher->any(),
+ $this->matcher->any(),
+ [FakeDoubleInterceptorInterface::class]
+ );
+ }
+ };
+ $injector = new Injector($module, __DIR__ . '/tmp');
+ $instance = $injector->getInstance(FakeAopInterface::class);
+ /** @var FakeAop $instance */
+ $result = $instance->returnSame(2);
+ $this->assertSame(4, $result);
+ }
+
public function testBuiltinBinding(): void
{
$instance = (new Injector())->getInstance(FakeBuiltin::class);
@@ -212,7 +241,11 @@ public function testBuiltinBinding(): void
public function testSerializeBuiltinBinding(): void
{
- $instance = unserialize(serialize(new Injector()))->getInstance(FakeBuiltin::class);
+ $injector = unserialize(serialize(new Injector()));
+ assert($injector instanceof InjectorInterface);
+ $instance = $injector->getInstance(FakeBuiltin::class);
+ assert(is_object($instance));
+ assert(property_exists($instance, 'injector'));
$this->assertInstanceOf(Injector::class, $instance->injector);
}
@@ -372,4 +405,90 @@ protected function configure()
$nullObject = $injector->getInstance(FakeTyreInterface::class);
$this->assertInstanceOf(FakeTyreInterface::class, $nullObject);
}
+
+ public function testBindInterfeceInterceptor(): void
+ {
+ $injector = (new Injector(new class extends AbstractModule {
+ protected function configure()
+ {
+ $this->bind(FakeAop::class);
+ $this->bind(FakeDoubleInterceptorInterface::class)->to(FakeDoubleInterceptor::class);
+ $this->bindInterceptor(
+ $this->matcher->any(),
+ $this->matcher->any(),
+ [FakeDoubleInterceptorInterface::class]
+ );
+ }
+ }));
+ $instance = $injector->getInstance(FakeAop::class);
+ /** @var FakeAop $instance */
+ $result = $instance->returnSame(2);
+ $this->assertSame(4, $result);
+ }
+
+ public function testBindInterfeceNullInterceptor(): void
+ {
+ $injector = (new Injector(new class extends AbstractModule {
+ protected function configure()
+ {
+ $this->bind(FakeAop::class);
+ $this->bind(FakeDoubleInterceptorInterface::class)->to(NullInterceptor::class);
+ $this->bindInterceptor(
+ $this->matcher->any(),
+ $this->matcher->any(),
+ [FakeDoubleInterceptorInterface::class]
+ );
+ }
+ }));
+ $instance = $injector->getInstance(FakeAop::class);
+ /** @var FakeAop $instance */
+ $result = $instance->returnSame(2);
+ $this->assertSame(2, $result);
+ assert(isset($instance->bindings));
+ assert(isset($instance->bindings['returnSame'][0]));
+ $this->assertInstanceOf(NullInterceptor::class, $instance->bindings['returnSame'][0]);
+ }
+
+ public function testModuleArray(): void
+ {
+ $modules = [
+ new class extends AbstractModule
+ {
+ protected function configure()
+ {
+ $this->bind()->annotatedWith('var')->toInstance('a');
+ $this->bind()->annotatedWith('first')->toInstance('1');
+ }
+ },
+ new class extends AbstractModule
+ {
+ protected function configure()
+ {
+ $this->bind()->annotatedWith('var')->toInstance('b');
+ $this->bind()->annotatedWith('second')->toInstance('2');
+ }
+ },
+ ];
+ $injector = new Injector($modules);
+ $this->assertSame('a', $injector->getInstance('', 'var'));
+ $this->assertSame('2', $injector->getInstance('', 'second'));
+ $this->assertSame('1', $injector->getInstance('', 'first'));
+ }
+
+ /**
+ * @requires PHP 8.0
+ */
+ public function testProviderInjectWithSet(): void
+ {
+ $injector = new Injector(new class extends AbstractModule{
+ protected function configure()
+ {
+ $this->bind(FakeEngineInterface::class)->to(FakeEngine::class);
+ }
+ });
+ $fakeSet = $injector->getInstance(FakeSet::class);
+ assert($fakeSet instanceof FakeSet);
+ $this->assertInstanceOf(ProviderInterface::class, $fakeSet->provider);
+ $this->assertInstanceOf(FakeEngine::class, $fakeSet->provider->get());
+ }
}
diff --git a/tests/di/ModuleMergerTest.php b/tests/di/ModuleMergerTest.php
new file mode 100644
index 00000000..c29c2c5a
--- /dev/null
+++ b/tests/di/ModuleMergerTest.php
@@ -0,0 +1,36 @@
+bind()->annotatedWith('var')->toInstance('a');
+ $this->bind()->annotatedWith('first')->toInstance('1');
+ }
+ },
+ new class extends AbstractModule
+ {
+ protected function configure()
+ {
+ $this->bind()->annotatedWith('var')->toInstance('b');
+ $this->bind()->annotatedWith('second')->toInstance('2');
+ }
+ },
+ ];
+ $injector = new Injector($modules);
+ $this->assertSame('a', $injector->getInstance('', 'var'));
+ $this->assertSame('2', $injector->getInstance('', 'second'));
+ $this->assertSame('1', $injector->getInstance('', 'first'));
+ }
+}
diff --git a/tests/di/MultiBinding/MultiBinderTest.php b/tests/di/MultiBinding/MultiBinderTest.php
new file mode 100644
index 00000000..90822e68
--- /dev/null
+++ b/tests/di/MultiBinding/MultiBinderTest.php
@@ -0,0 +1,43 @@
+addBinding('one')->to(FakeEngine::class);
+ $binder->addBinding('two')->to(FakeEngine2::class);
+ /** @var MultiBindings $multiBindings */
+ $multiBindings = $module->getContainer()->getInstance(MultiBindings::class);
+ $this->assertArrayHasKey('one', (array) $multiBindings[FakeEngineInterface::class]);
+ $this->assertArrayHasKey('two', (array) $multiBindings[FakeEngineInterface::class]);
+ }
+
+ public function testSet(): void
+ {
+ $module = new NullModule();
+ $binder = MultiBinder::newInstance($module, FakeEngineInterface::class);
+ $binder->addBinding('one')->to(FakeEngine::class);
+ $binder->addBinding('two')->to(FakeEngine2::class);
+ $binder->setBinding('one')->to(FakeEngine::class);
+ /** @var MultiBindings $multiBindings */
+ $multiBindings = $module->getContainer()->getInstance(MultiBindings::class);
+ $this->assertArrayHasKey('one', (array) $multiBindings[FakeEngineInterface::class]);
+ $this->assertArrayNotHasKey('two', (array) $multiBindings[FakeEngineInterface::class]);
+ }
+}
diff --git a/tests/di/MultiBinding/MultiBindingModuleTest.php b/tests/di/MultiBinding/MultiBindingModuleTest.php
new file mode 100644
index 00000000..bd636e70
--- /dev/null
+++ b/tests/di/MultiBinding/MultiBindingModuleTest.php
@@ -0,0 +1,165 @@
+module = new class extends AbstractModule {
+ protected function configure(): void
+ {
+ $engineBinder = MultiBinder::newInstance($this, FakeEngineInterface::class);
+ $engineBinder->addBinding('one')->to(FakeEngine::class);
+ $engineBinder->addBinding('two')->to(FakeEngine2::class);
+ $engineBinder->addBinding()->to(FakeEngine3::class);
+ $robotBinder = MultiBinder::newInstance($this, FakeRobotInterface::class);
+ $robotBinder->addBinding('to')->to(FakeRobot::class);
+ $robotBinder->addBinding('provider')->toProvider(FakeRobotProvider::class);
+ $robotBinder->addBinding('instance')->toInstance(new FakeRobot());
+ }
+ };
+ }
+
+ public function testInjectMap(): Map
+ {
+ $injector = new Injector($this->module);
+ /** @var FakeMultiBindingConsumer $consumer */
+ $consumer = $injector->getInstance(FakeMultiBindingConsumer::class);
+ $this->assertInstanceOf(Map::class, $consumer->engines);
+
+ return $consumer->engines;
+ }
+
+ /**
+ * @depends testInjectMap
+ */
+ public function testMapInstance(Map $map): void
+ {
+ $this->assertInstanceOf(FakeEngine::class, $map['one']);
+ $this->assertInstanceOf(FakeEngine2::class, $map['two']);
+ }
+
+ /**
+ * @depends testInjectMap
+ */
+ public function testMapIteration(Map $map): void
+ {
+ $this->assertContainsOnlyInstancesOf(FakeEngineInterface::class, $map);
+
+ $this->assertSame(3, count($map));
+ }
+
+ /**
+ * @depends testInjectMap
+ */
+ public function testIsSet(Map $map): void
+ {
+ $this->assertTrue(isset($map['one']));
+ $this->assertTrue(isset($map['two']));
+ }
+
+ /**
+ * @depends testInjectMap
+ */
+ public function testOffsetSet(Map $map): void
+ {
+ $this->expectException(LogicException::class);
+ $map['one'] = 1;
+ }
+
+ /**
+ * @depends testInjectMap
+ */
+ public function testOffsetUnset(Map $map): void
+ {
+ $this->expectException(LogicException::class);
+ unset($map['one']);
+ }
+
+ public function testAnotherBinder(): void
+ {
+ $injector = new Injector($this->module);
+ /** @var FakeMultiBindingConsumer $consumer */
+ $consumer = $injector->getInstance(FakeMultiBindingConsumer::class);
+ $this->assertInstanceOf(Map::class, $consumer->robots);
+ $this->assertContainsOnlyInstancesOf(FakeRobot::class, $consumer->robots);
+ $this->assertSame(3, count($consumer->robots));
+ }
+
+ public function testMultipileModule(): void
+ {
+ $module = new NullModule();
+ $binder = MultiBinder::newInstance($module, FakeEngineInterface::class);
+ $binder->addBinding('one')->to(FakeEngine::class);
+ $binder->addBinding('two')->to(FakeEngine2::class);
+ $module->install(new class extends AbstractModule {
+ protected function configure()
+ {
+ $binder = MultiBinder::newInstance($this, FakeEngineInterface::class);
+ $binder->addBinding('three')->to(FakeEngine::class);
+ $binder->addBinding('four')->to(FakeEngine::class);
+ }
+ });
+ /** @var MultiBindings $multiBindings */
+ $multiBindings = $module->getContainer()->getInstance(MultiBindings::class);
+ $this->assertArrayHasKey('one', (array) $multiBindings[FakeEngineInterface::class]);
+ $this->assertArrayHasKey('two', (array) $multiBindings[FakeEngineInterface::class]);
+ $this->assertArrayHasKey('three', (array) $multiBindings[FakeEngineInterface::class]);
+ $this->assertArrayHasKey('four', (array) $multiBindings[FakeEngineInterface::class]);
+ }
+
+ public function testAnnotation(): void
+ {
+ $injector = new Injector($this->module);
+ /** @var FakeMultiBindingAnnotation $fake */
+ $fake = $injector->getInstance(FakeMultiBindingAnnotation::class);
+ $this->assertContainsOnlyInstancesOf(FakeEngineInterface::class, $fake->engines);
+ $this->assertSame(3, count($fake->engines));
+ $this->assertContainsOnlyInstancesOf(FakeRobotInterface::class, $fake->robots);
+ $this->assertSame(3, count($fake->robots));
+ }
+
+ public function testSetNotFoundInMap(): void
+ {
+ $this->expectException(SetNotFound::class);
+ $injector = new Injector($this->module);
+ $injector->getInstance(FakeSetNotFoundWithMap::class);
+ }
+
+ public function testSetNotFoundInProvider(): void
+ {
+ $this->expectException(SetNotFound::class);
+ $injector = new Injector();
+ $injector->getInstance(FakeSetNotFoundWithProvider::class);
+ }
+}
diff --git a/tests/di/script/bench.php b/tests/di/script/bench.php
index 7db575cb..3534e4a8 100644
--- a/tests/di/script/bench.php
+++ b/tests/di/script/bench.php
@@ -7,6 +7,7 @@
use Ray\Compiler\DiCompiler;
use Ray\Compiler\ScriptInjector;
+use function assert;
use function microtime;
use function printf;
use function range;
@@ -29,6 +30,7 @@
$timer = microtime(true);
$injector = unserialize($serialize);
+assert($injector instanceof InjectorInterface);
foreach (range(1, $n) as $i) {
$injector->getInstance(FakeCarInterface::class);
}
diff --git a/tests/stub/BindInterface.phpstub b/tests/stub/BindInterface.phpstub
new file mode 100644
index 00000000..bdb8659e
--- /dev/null
+++ b/tests/stub/BindInterface.phpstub
@@ -0,0 +1,41 @@
+ [$interceptorA, ...][]
+ *
+ * @return array>>
+ */
+ public function getBindings();
+
+ /**
+ * Return hash
+ *
+ * @param string $salt
+ *
+ * @return string
+ */
+ public function toString($salt);
+}
diff --git a/tests/type/InjectorInterfaceTest.php b/tests/type/InjectorInterfaceTest.php
new file mode 100644
index 00000000..987fb30f
--- /dev/null
+++ b/tests/type/InjectorInterfaceTest.php
@@ -0,0 +1,30 @@
+getInstance(DateTimeInterface::class);
+ $this->a = $injector->getInstance(DateTimeInterface::class); // @phpstan-ignore-line
+ /** @psalm-suppress PropertyTypeCoercion */
+ $this->b = $injector->getInstance(DateTimeInterface::class); // @phpstan-ignore-line
+ /** @psalm-suppress ArgumentTypeCoercion */
+ $this->m = $injector->getInstance('a'); // @phpstan-ignore-line
+ }
+}
diff --git a/vendor-bin/tools/composer.json b/vendor-bin/tools/composer.json
index 43548ace..cdb4455e 100644
--- a/vendor-bin/tools/composer.json
+++ b/vendor-bin/tools/composer.json
@@ -3,9 +3,13 @@
"doctrine/coding-standard": "^9.0",
"phpmd/phpmd": "^2.9",
"phpmetrics/phpmetrics": "^2.7",
- "phpstan/phpstan": "^0.12",
- "psalm/plugin-phpunit": "^0.13",
+ "phpstan/phpstan": "^1.0",
"squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.2"
+ },
+ "config": {
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
}
}
diff --git a/vendor-bin/tools/composer.lock b/vendor-bin/tools/composer.lock
index bd74edf3..83e79514 100644
--- a/vendor-bin/tools/composer.lock
+++ b/vendor-bin/tools/composer.lock
@@ -4,21 +4,21 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "1d17c5c4bab554be4a944d99204f2a72",
+ "content-hash": "3109914c6230517ff87e65b72721c353",
"packages": [],
"packages-dev": [
{
"name": "amphp/amp",
- "version": "v2.6.1",
+ "version": "v2.6.2",
"source": {
"type": "git",
"url": "https://github.com/amphp/amp.git",
- "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae"
+ "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/amphp/amp/zipball/c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae",
- "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae",
+ "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
+ "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb",
"shasum": ""
},
"require": {
@@ -40,13 +40,13 @@
}
},
"autoload": {
- "psr-4": {
- "Amp\\": "lib"
- },
"files": [
"lib/functions.php",
"lib/Internal/functions.php"
- ]
+ ],
+ "psr-4": {
+ "Amp\\": "lib"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -71,7 +71,7 @@
}
],
"description": "A non-blocking concurrency framework for PHP applications.",
- "homepage": "http://amphp.org/amp",
+ "homepage": "https://amphp.org/amp",
"keywords": [
"async",
"asynchronous",
@@ -86,7 +86,7 @@
"support": {
"irc": "irc://irc.freenode.org/amphp",
"issues": "https://github.com/amphp/amp/issues",
- "source": "https://github.com/amphp/amp/tree/v2.6.1"
+ "source": "https://github.com/amphp/amp/tree/v2.6.2"
},
"funding": [
{
@@ -94,7 +94,7 @@
"type": "github"
}
],
- "time": "2021-09-23T18:43:08+00:00"
+ "time": "2022-02-20T17:52:18+00:00"
},
{
"name": "amphp/byte-stream",
@@ -129,12 +129,12 @@
}
},
"autoload": {
- "psr-4": {
- "Amp\\ByteStream\\": "lib"
- },
"files": [
"lib/functions.php"
- ]
+ ],
+ "psr-4": {
+ "Amp\\ByteStream\\": "lib"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -175,16 +175,16 @@
},
{
"name": "composer/package-versions-deprecated",
- "version": "1.11.99.4",
+ "version": "1.11.99.5",
"source": {
"type": "git",
"url": "https://github.com/composer/package-versions-deprecated.git",
- "reference": "b174585d1fe49ceed21928a945138948cb394600"
+ "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600",
- "reference": "b174585d1fe49ceed21928a945138948cb394600",
+ "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d",
+ "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d",
"shasum": ""
},
"require": {
@@ -228,7 +228,78 @@
"description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)",
"support": {
"issues": "https://github.com/composer/package-versions-deprecated/issues",
- "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.4"
+ "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2022-01-17T14:14:24+00:00"
+ },
+ {
+ "name": "composer/pcre",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560",
+ "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0 || ^8.0"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.3",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "symfony/phpunit-bridge": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-main": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/1.0.1"
},
"funding": [
{
@@ -244,27 +315,27 @@
"type": "tidelift"
}
],
- "time": "2021-09-13T08:41:34+00:00"
+ "time": "2022-01-21T20:24:37+00:00"
},
{
"name": "composer/semver",
- "version": "3.2.5",
+ "version": "3.3.1",
"source": {
"type": "git",
"url": "https://github.com/composer/semver.git",
- "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9"
+ "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/semver/zipball/31f3ea725711245195f62e54ffa402d8ef2fdba9",
- "reference": "31f3ea725711245195f62e54ffa402d8ef2fdba9",
+ "url": "https://api.github.com/repos/composer/semver/zipball/5d8e574bb0e69188786b8ef77d43341222a41a71",
+ "reference": "5d8e574bb0e69188786b8ef77d43341222a41a71",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0 || ^8.0"
},
"require-dev": {
- "phpstan/phpstan": "^0.12.54",
+ "phpstan/phpstan": "^1.4",
"symfony/phpunit-bridge": "^4.2 || ^5"
},
"type": "library",
@@ -309,7 +380,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/semver/issues",
- "source": "https://github.com/composer/semver/tree/3.2.5"
+ "source": "https://github.com/composer/semver/tree/3.3.1"
},
"funding": [
{
@@ -325,29 +396,31 @@
"type": "tidelift"
}
],
- "time": "2021-05-24T12:41:47+00:00"
+ "time": "2022-03-16T11:22:07+00:00"
},
{
"name": "composer/xdebug-handler",
- "version": "2.0.2",
+ "version": "2.0.5",
"source": {
"type": "git",
"url": "https://github.com/composer/xdebug-handler.git",
- "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339"
+ "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339",
- "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/9e36aeed4616366d2b690bdce11f71e9178c579a",
+ "reference": "9e36aeed4616366d2b690bdce11f71e9178c579a",
"shasum": ""
},
"require": {
+ "composer/pcre": "^1",
"php": "^5.3.2 || ^7.0 || ^8.0",
"psr/log": "^1 || ^2 || ^3"
},
"require-dev": {
- "phpstan/phpstan": "^0.12.55",
- "symfony/phpunit-bridge": "^4.2 || ^5"
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.1",
+ "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0"
},
"type": "library",
"autoload": {
@@ -373,7 +446,7 @@
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/xdebug-handler/issues",
- "source": "https://github.com/composer/xdebug-handler/tree/2.0.2"
+ "source": "https://github.com/composer/xdebug-handler/tree/2.0.5"
},
"funding": [
{
@@ -389,31 +462,31 @@
"type": "tidelift"
}
],
- "time": "2021-07-31T17:03:58+00:00"
+ "time": "2022-02-24T20:20:32+00:00"
},
{
"name": "dealerdirect/phpcodesniffer-composer-installer",
- "version": "v0.7.1",
+ "version": "v0.7.2",
"source": {
"type": "git",
"url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git",
- "reference": "fe390591e0241955f22eb9ba327d137e501c771c"
+ "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c",
- "reference": "fe390591e0241955f22eb9ba327d137e501c771c",
+ "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
+ "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": ">=5.3",
- "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0"
+ "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0"
},
"require-dev": {
"composer/composer": "*",
- "phpcompatibility/php-compatibility": "^9.0",
- "sensiolabs/security-checker": "^4.1.0"
+ "php-parallel-lint/php-parallel-lint": "^1.3.1",
+ "phpcompatibility/php-compatibility": "^9.0"
},
"type": "composer-plugin",
"extra": {
@@ -434,6 +507,10 @@
"email": "franck.nijhof@dealerdirect.com",
"homepage": "http://www.frenck.nl",
"role": "Developer / IT Manager"
+ },
+ {
+ "name": "Contributors",
+ "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors"
}
],
"description": "PHP_CodeSniffer Standards Composer Installer Plugin",
@@ -445,6 +522,7 @@
"codesniffer",
"composer",
"installer",
+ "phpcbf",
"phpcs",
"plugin",
"qa",
@@ -459,7 +537,7 @@
"issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues",
"source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer"
},
- "time": "2020-12-07T18:04:37+00:00"
+ "time": "2022-02-04T12:51:07+00:00"
},
{
"name": "dnoegel/php-xdg-base-dir",
@@ -553,75 +631,6 @@
},
"time": "2021-04-12T15:11:14+00:00"
},
- {
- "name": "doctrine/instantiator",
- "version": "1.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/doctrine/instantiator.git",
- "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
- "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
- },
- "require-dev": {
- "doctrine/coding-standard": "^8.0",
- "ext-pdo": "*",
- "ext-phar": "*",
- "phpbench/phpbench": "^0.13 || 1.0.0-alpha2",
- "phpstan/phpstan": "^0.12",
- "phpstan/phpstan-phpunit": "^0.12",
- "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Marco Pivetta",
- "email": "ocramius@gmail.com",
- "homepage": "https://ocramius.github.io/"
- }
- ],
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
- "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
- "keywords": [
- "constructor",
- "instantiate"
- ],
- "support": {
- "issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/1.4.0"
- },
- "funding": [
- {
- "url": "https://www.doctrine-project.org/sponsorship.html",
- "type": "custom"
- },
- {
- "url": "https://www.patreon.com/phpdoctrine",
- "type": "patreon"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
- "type": "tidelift"
- }
- ],
- "time": "2020-11-10T18:47:58+00:00"
- },
{
"name": "felixfbecker/advanced-json-rpc",
"version": "v3.2.1",
@@ -723,64 +732,6 @@
},
"time": "2021-02-22T14:02:09+00:00"
},
- {
- "name": "myclabs/deep-copy",
- "version": "1.10.2",
- "source": {
- "type": "git",
- "url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220",
- "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
- },
- "replace": {
- "myclabs/deep-copy": "self.version"
- },
- "require-dev": {
- "doctrine/collections": "^1.0",
- "doctrine/common": "^2.6",
- "phpunit/phpunit": "^7.1"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "DeepCopy\\": "src/DeepCopy/"
- },
- "files": [
- "src/DeepCopy/deep_copy.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Create deep copies (clones) of your objects",
- "keywords": [
- "clone",
- "copy",
- "duplicate",
- "object",
- "object graph"
- ],
- "support": {
- "issues": "https://github.com/myclabs/DeepCopy/issues",
- "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2"
- },
- "funding": [
- {
- "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
- "type": "tidelift"
- }
- ],
- "time": "2020-11-13T09:40:50+00:00"
- },
{
"name": "netresearch/jsonmapper",
"version": "v4.0.0",
@@ -834,16 +785,16 @@
},
{
"name": "nikic/php-parser",
- "version": "v4.13.0",
+ "version": "v4.13.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "50953a2691a922aa1769461637869a0a2faa3f53"
+ "reference": "210577fe3cf7badcc5814d99455df46564f3c077"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53",
- "reference": "50953a2691a922aa1769461637869a0a2faa3f53",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
+ "reference": "210577fe3cf7badcc5814d99455df46564f3c077",
"shasum": ""
},
"require": {
@@ -884,9 +835,9 @@
],
"support": {
"issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.0"
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
},
- "time": "2021-09-20T12:20:58+00:00"
+ "time": "2021-11-30T19:35:32+00:00"
},
{
"name": "openlss/lib-array2xml",
@@ -943,23 +894,23 @@
},
{
"name": "pdepend/pdepend",
- "version": "2.10.0",
+ "version": "2.10.3",
"source": {
"type": "git",
"url": "https://github.com/pdepend/pdepend.git",
- "reference": "1fd30f4352b630ad53fec3fd5e8b8ba760f85596"
+ "reference": "da3166a06b4a89915920a42444f707122a1584c9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/pdepend/pdepend/zipball/1fd30f4352b630ad53fec3fd5e8b8ba760f85596",
- "reference": "1fd30f4352b630ad53fec3fd5e8b8ba760f85596",
+ "url": "https://api.github.com/repos/pdepend/pdepend/zipball/da3166a06b4a89915920a42444f707122a1584c9",
+ "reference": "da3166a06b4a89915920a42444f707122a1584c9",
"shasum": ""
},
"require": {
"php": ">=5.3.7",
- "symfony/config": "^2.3.0|^3|^4|^5",
- "symfony/dependency-injection": "^2.3.0|^3|^4|^5",
- "symfony/filesystem": "^2.3.0|^3|^4|^5"
+ "symfony/config": "^2.3.0|^3|^4|^5|^6.0",
+ "symfony/dependency-injection": "^2.3.0|^3|^4|^5|^6.0",
+ "symfony/filesystem": "^2.3.0|^3|^4|^5|^6.0"
},
"require-dev": {
"easy-doc/easy-doc": "0.0.0|^1.2.3",
@@ -988,7 +939,7 @@
"description": "Official version of pdepend to be handled with Composer",
"support": {
"issues": "https://github.com/pdepend/pdepend/issues",
- "source": "https://github.com/pdepend/pdepend/tree/2.10.0"
+ "source": "https://github.com/pdepend/pdepend/tree/2.10.3"
},
"funding": [
{
@@ -996,118 +947,7 @@
"type": "tidelift"
}
],
- "time": "2021-07-20T09:56:09+00:00"
- },
- {
- "name": "phar-io/manifest",
- "version": "2.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/phar-io/manifest.git",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-phar": "*",
- "ext-xmlwriter": "*",
- "phar-io/version": "^3.0.1",
- "php": "^7.2 || ^8.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Arne Blankerts",
- "email": "arne@blankerts.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Heuer",
- "email": "sebastian@phpeople.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "Developer"
- }
- ],
- "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
- "support": {
- "issues": "https://github.com/phar-io/manifest/issues",
- "source": "https://github.com/phar-io/manifest/tree/2.0.3"
- },
- "time": "2021-07-20T11:28:43+00:00"
- },
- {
- "name": "phar-io/version",
- "version": "3.1.0",
- "source": {
- "type": "git",
- "url": "https://github.com/phar-io/version.git",
- "reference": "bae7c545bef187884426f042434e561ab1ddb182"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182",
- "reference": "bae7c545bef187884426f042434e561ab1ddb182",
- "shasum": ""
- },
- "require": {
- "php": "^7.2 || ^8.0"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Arne Blankerts",
- "email": "arne@blankerts.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Heuer",
- "email": "sebastian@phpeople.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "Developer"
- }
- ],
- "description": "Library for handling version information and constraints",
- "support": {
- "issues": "https://github.com/phar-io/version/issues",
- "source": "https://github.com/phar-io/version/tree/3.1.0"
- },
- "time": "2021-02-23T14:00:09+00:00"
+ "time": "2022-02-23T07:53:09+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@@ -1164,16 +1004,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
- "version": "5.2.2",
+ "version": "5.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
- "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
+ "reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
"shasum": ""
},
"require": {
@@ -1184,7 +1024,8 @@
"webmozart/assert": "^1.9.1"
},
"require-dev": {
- "mockery/mockery": "~1.3.2"
+ "mockery/mockery": "~1.3.2",
+ "psalm/phar": "^4.8"
},
"type": "library",
"extra": {
@@ -1214,22 +1055,22 @@
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
},
- "time": "2020-09-03T19:13:55+00:00"
+ "time": "2021-10-19T17:43:47+00:00"
},
{
"name": "phpdocumentor/type-resolver",
- "version": "1.5.1",
+ "version": "1.6.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae"
+ "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae",
- "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706",
+ "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706",
"shasum": ""
},
"require": {
@@ -1264,28 +1105,28 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
- "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.5.1"
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0"
},
- "time": "2021-10-02T14:08:47+00:00"
+ "time": "2022-01-04T19:58:01+00:00"
},
{
"name": "phpmd/phpmd",
- "version": "2.10.2",
+ "version": "2.11.1",
"source": {
"type": "git",
"url": "https://github.com/phpmd/phpmd.git",
- "reference": "1bc74db7cf834662d83abebae265be11bb2eec3a"
+ "reference": "08b60a2eb7e14c23f46ff8865b510ae08b75d0fd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpmd/phpmd/zipball/1bc74db7cf834662d83abebae265be11bb2eec3a",
- "reference": "1bc74db7cf834662d83abebae265be11bb2eec3a",
+ "url": "https://api.github.com/repos/phpmd/phpmd/zipball/08b60a2eb7e14c23f46ff8865b510ae08b75d0fd",
+ "reference": "08b60a2eb7e14c23f46ff8865b510ae08b75d0fd",
"shasum": ""
},
"require": {
"composer/xdebug-handler": "^1.0 || ^2.0",
"ext-xml": "*",
- "pdepend/pdepend": "^2.10.0",
+ "pdepend/pdepend": "^2.10.2",
"php": ">=5.3.9"
},
"require-dev": {
@@ -1341,7 +1182,7 @@
"support": {
"irc": "irc://irc.freenode.org/phpmd",
"issues": "https://github.com/phpmd/phpmd/issues",
- "source": "https://github.com/phpmd/phpmd/tree/2.10.2"
+ "source": "https://github.com/phpmd/phpmd/tree/2.11.1"
},
"funding": [
{
@@ -1349,7 +1190,7 @@
"type": "tidelift"
}
],
- "time": "2021-07-22T09:56:23+00:00"
+ "time": "2021-12-17T11:25:43+00:00"
},
{
"name": "phpmetrics/phpmetrics",
@@ -1385,12 +1226,12 @@
],
"type": "library",
"autoload": {
- "psr-0": {
- "Hal\\": "./src/"
- },
"files": [
"./src/functions.php"
- ]
+ ],
+ "psr-0": {
+ "Hal\\": "./src/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -1419,108 +1260,41 @@
"time": "2020-06-30T20:33:55+00:00"
},
{
- "name": "phpspec/prophecy",
- "version": "1.14.0",
+ "name": "phpstan/phpdoc-parser",
+ "version": "1.2.0",
"source": {
"type": "git",
- "url": "https://github.com/phpspec/prophecy.git",
- "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e"
+ "url": "https://github.com/phpstan/phpdoc-parser.git",
+ "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
- "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e",
+ "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/dbc093d7af60eff5cd575d2ed761b15ed40bd08e",
+ "reference": "dbc093d7af60eff5cd575d2ed761b15ed40bd08e",
"shasum": ""
},
"require": {
- "doctrine/instantiator": "^1.2",
- "php": "^7.2 || ~8.0, <8.2",
- "phpdocumentor/reflection-docblock": "^5.2",
- "sebastian/comparator": "^3.0 || ^4.0",
- "sebastian/recursion-context": "^3.0 || ^4.0"
+ "php": "^7.1 || ^8.0"
},
"require-dev": {
- "phpspec/phpspec": "^6.0 || ^7.0",
- "phpunit/phpunit": "^8.0 || ^9.0"
+ "php-parallel-lint/php-parallel-lint": "^1.2",
+ "phpstan/extension-installer": "^1.0",
+ "phpstan/phpstan": "^1.0",
+ "phpstan/phpstan-strict-rules": "^1.0",
+ "phpunit/phpunit": "^9.5",
+ "symfony/process": "^5.2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.x-dev"
+ "dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
- "Prophecy\\": "src/Prophecy"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Konstantin Kudryashov",
- "email": "ever.zet@gmail.com",
- "homepage": "http://everzet.com"
- },
- {
- "name": "Marcello Duarte",
- "email": "marcello.duarte@gmail.com"
- }
- ],
- "description": "Highly opinionated mocking framework for PHP 5.3+",
- "homepage": "https://github.com/phpspec/prophecy",
- "keywords": [
- "Double",
- "Dummy",
- "fake",
- "mock",
- "spy",
- "stub"
- ],
- "support": {
- "issues": "https://github.com/phpspec/prophecy/issues",
- "source": "https://github.com/phpspec/prophecy/tree/1.14.0"
- },
- "time": "2021-09-10T09:02:12+00:00"
- },
- {
- "name": "phpstan/phpdoc-parser",
- "version": "0.5.6",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpdoc-parser.git",
- "reference": "fac86158ffc7392e49636f77e63684c026df43b8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/fac86158ffc7392e49636f77e63684c026df43b8",
- "reference": "fac86158ffc7392e49636f77e63684c026df43b8",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
- },
- "require-dev": {
- "php-parallel-lint/php-parallel-lint": "^1.2",
- "phpstan/extension-installer": "^1.0",
- "phpstan/phpstan": "^0.12.87",
- "phpstan/phpstan-strict-rules": "^0.12.5",
- "phpunit/phpunit": "^9.5",
- "symfony/process": "^5.2"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.5-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "PHPStan\\PhpDocParser\\": [
- "src/"
- ]
+ "PHPStan\\PhpDocParser\\": [
+ "src/"
+ ]
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1530,22 +1304,22 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
- "source": "https://github.com/phpstan/phpdoc-parser/tree/0.5.6"
+ "source": "https://github.com/phpstan/phpdoc-parser/tree/1.2.0"
},
- "time": "2021-08-31T08:08:22+00:00"
+ "time": "2021-09-16T20:46:02+00:00"
},
{
"name": "phpstan/phpstan",
- "version": "0.12.99",
+ "version": "1.4.10",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7"
+ "reference": "898c479c39caa727bedf4311dd294a8f4e250e72"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b4d40f1d759942f523be267a1bab6884f46ca3f7",
- "reference": "b4d40f1d759942f523be267a1bab6884f46ca3f7",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/898c479c39caa727bedf4311dd294a8f4e250e72",
+ "reference": "898c479c39caa727bedf4311dd294a8f4e250e72",
"shasum": ""
},
"require": {
@@ -1559,11 +1333,6 @@
"phpstan.phar"
],
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.12-dev"
- }
- },
"autoload": {
"files": [
"bootstrap.php"
@@ -1576,7 +1345,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
- "source": "https://github.com/phpstan/phpstan/tree/0.12.99"
+ "source": "https://github.com/phpstan/phpstan/tree/1.4.10"
},
"funding": [
{
@@ -1596,1515 +1365,136 @@
"type": "tidelift"
}
],
- "time": "2021-09-12T20:09:55+00:00"
+ "time": "2022-03-14T10:25:45+00:00"
},
{
- "name": "phpunit/php-code-coverage",
- "version": "9.2.7",
+ "name": "psr/container",
+ "version": "2.0.2",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218"
+ "url": "https://github.com/php-fig/container.git",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d4c798ed8d51506800b441f7a13ecb0f76f12218",
- "reference": "d4c798ed8d51506800b441f7a13ecb0f76f12218",
+ "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
+ "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
"shasum": ""
},
"require": {
- "ext-dom": "*",
- "ext-libxml": "*",
- "ext-xmlwriter": "*",
- "nikic/php-parser": "^4.12.0",
- "php": ">=7.3",
- "phpunit/php-file-iterator": "^3.0.3",
- "phpunit/php-text-template": "^2.0.2",
- "sebastian/code-unit-reverse-lookup": "^2.0.2",
- "sebastian/complexity": "^2.0",
- "sebastian/environment": "^5.1.2",
- "sebastian/lines-of-code": "^1.0.3",
- "sebastian/version": "^3.0.1",
- "theseer/tokenizer": "^1.2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-pcov": "*",
- "ext-xdebug": "*"
+ "php": ">=7.4.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.2-dev"
+ "dev-master": "2.0.x-dev"
}
},
"autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
- "keywords": [
- "coverage",
- "testing",
- "xunit"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.7"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2021-09-17T05:39:03+00:00"
- },
- {
- "name": "phpunit/php-file-iterator",
- "version": "3.0.5",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
- "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
+ "psr-4": {
+ "Psr\\Container\\": "src/"
}
},
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "description": "Common Container Interface (PHP FIG PSR-11)",
+ "homepage": "https://github.com/php-fig/container",
"keywords": [
- "filesystem",
- "iterator"
+ "PSR-11",
+ "container",
+ "container-interface",
+ "container-interop",
+ "psr"
],
"support": {
- "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
- "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/2.0.2"
},
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:57:25+00:00"
+ "time": "2021-11-05T16:47:00+00:00"
},
{
- "name": "phpunit/php-invoker",
- "version": "3.1.1",
+ "name": "psr/log",
+ "version": "3.0.0",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
+ "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
"shasum": ""
},
"require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "ext-pcntl": "*",
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-pcntl": "*"
+ "php": ">=8.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.1-dev"
+ "dev-master": "3.x-dev"
}
},
"autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Invoke callables with a timeout",
- "homepage": "https://github.com/sebastianbergmann/php-invoker/",
- "keywords": [
- "process"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
- "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:58:55+00:00"
- },
- {
- "name": "phpunit/php-text-template",
- "version": "2.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
- "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
+ "psr-4": {
+ "Psr\\Log\\": "src"
}
},
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
"notification-url": "https://packagist.org/downloads/",
"license": [
- "BSD-3-Clause"
+ "MIT"
],
"authors": [
{
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
}
],
- "description": "Simple template engine.",
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
"keywords": [
- "template"
+ "log",
+ "psr",
+ "psr-3"
],
"support": {
- "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
- "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
+ "source": "https://github.com/php-fig/log/tree/3.0.0"
},
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T05:33:50+00:00"
+ "time": "2021-07-14T16:46:02+00:00"
},
{
- "name": "phpunit/php-timer",
- "version": "5.0.3",
+ "name": "sebastian/diff",
+ "version": "4.0.4",
"source": {
"type": "git",
- "url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
- "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
+ "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
"shasum": ""
},
"require": {
"php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Utility class for timing",
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
- "keywords": [
- "timer"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-timer/issues",
- "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:16:10+00:00"
- },
- {
- "name": "phpunit/phpunit",
- "version": "9.5.10",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
- "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a",
- "shasum": ""
- },
- "require": {
- "doctrine/instantiator": "^1.3.1",
- "ext-dom": "*",
- "ext-json": "*",
- "ext-libxml": "*",
- "ext-mbstring": "*",
- "ext-xml": "*",
- "ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.10.1",
- "phar-io/manifest": "^2.0.3",
- "phar-io/version": "^3.0.2",
- "php": ">=7.3",
- "phpspec/prophecy": "^1.12.1",
- "phpunit/php-code-coverage": "^9.2.7",
- "phpunit/php-file-iterator": "^3.0.5",
- "phpunit/php-invoker": "^3.1.1",
- "phpunit/php-text-template": "^2.0.3",
- "phpunit/php-timer": "^5.0.2",
- "sebastian/cli-parser": "^1.0.1",
- "sebastian/code-unit": "^1.0.6",
- "sebastian/comparator": "^4.0.5",
- "sebastian/diff": "^4.0.3",
- "sebastian/environment": "^5.1.3",
- "sebastian/exporter": "^4.0.3",
- "sebastian/global-state": "^5.0.1",
- "sebastian/object-enumerator": "^4.0.3",
- "sebastian/resource-operations": "^3.0.3",
- "sebastian/type": "^2.3.4",
- "sebastian/version": "^3.0.2"
- },
- "require-dev": {
- "ext-pdo": "*",
- "phpspec/prophecy-phpunit": "^2.0.1"
- },
- "suggest": {
- "ext-soap": "*",
- "ext-xdebug": "*"
- },
- "bin": [
- "phpunit"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "9.5-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ],
- "files": [
- "src/Framework/Assert/Functions.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "The PHP Unit Testing framework.",
- "homepage": "https://phpunit.de/",
- "keywords": [
- "phpunit",
- "testing",
- "xunit"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/phpunit/issues",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10"
- },
- "funding": [
- {
- "url": "https://phpunit.de/donate.html",
- "type": "custom"
- },
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2021-09-25T07:38:51+00:00"
- },
- {
- "name": "psalm/plugin-phpunit",
- "version": "0.13.0",
- "source": {
- "type": "git",
- "url": "https://github.com/psalm/psalm-plugin-phpunit.git",
- "reference": "e006914489f3e445f5cb786ea6f3df89ea30129b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e006914489f3e445f5cb786ea6f3df89ea30129b",
- "reference": "e006914489f3e445f5cb786ea6f3df89ea30129b",
- "shasum": ""
- },
- "require": {
- "composer/package-versions-deprecated": "^1.10",
- "composer/semver": "^1.4 || ^2.0 || ^3.0",
- "ext-simplexml": "*",
- "php": "^7.3 || ^8.0",
- "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
- "vimeo/psalm": "dev-master || dev-4.x || ^4.0"
- },
- "require-dev": {
- "codeception/codeception": "^4.0.3",
- "squizlabs/php_codesniffer": "^3.3.1",
- "weirdan/codeception-psalm-module": "^0.7.1",
- "weirdan/prophecy-shim": "^1.0 || ^2.0"
- },
- "type": "psalm-plugin",
- "extra": {
- "psalm": {
- "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin"
- }
- },
- "autoload": {
- "psr-4": {
- "Psalm\\PhpUnitPlugin\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Matt Brown",
- "email": "github@muglug.com"
- }
- ],
- "description": "Psalm plugin for PHPUnit",
- "support": {
- "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues",
- "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.13.0"
- },
- "time": "2020-10-19T12:43:17+00:00"
- },
- {
- "name": "psr/container",
- "version": "1.1.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/container.git",
- "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf",
- "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Psr\\Container\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
- }
- ],
- "description": "Common Container Interface (PHP FIG PSR-11)",
- "homepage": "https://github.com/php-fig/container",
- "keywords": [
- "PSR-11",
- "container",
- "container-interface",
- "container-interop",
- "psr"
- ],
- "support": {
- "issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/1.1.1"
- },
- "time": "2021-03-05T17:36:06+00:00"
- },
- {
- "name": "psr/log",
- "version": "3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
- "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
- "shasum": ""
- },
- "require": {
- "php": ">=8.0.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ],
- "support": {
- "source": "https://github.com/php-fig/log/tree/3.0.0"
- },
- "time": "2021-07-14T16:46:02+00:00"
- },
- {
- "name": "sebastian/cli-parser",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library for parsing CLI options",
- "homepage": "https://github.com/sebastianbergmann/cli-parser",
- "support": {
- "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
- "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T06:08:49+00:00"
- },
- {
- "name": "sebastian/code-unit",
- "version": "1.0.8",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/code-unit.git",
- "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
- "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Collection of value objects that represent the PHP code units",
- "homepage": "https://github.com/sebastianbergmann/code-unit",
- "support": {
- "issues": "https://github.com/sebastianbergmann/code-unit/issues",
- "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:08:54+00:00"
- },
- {
- "name": "sebastian/code-unit-reverse-lookup",
- "version": "2.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Looks up which function or method a line of code belongs to",
- "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
- "support": {
- "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
- "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:30:19+00:00"
- },
- {
- "name": "sebastian/comparator",
- "version": "4.0.6",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/diff": "^4.0",
- "sebastian/exporter": "^4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
- },
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@2bepublished.at"
- }
- ],
- "description": "Provides the functionality to compare PHP values for equality",
- "homepage": "https://github.com/sebastianbergmann/comparator",
- "keywords": [
- "comparator",
- "compare",
- "equality"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/comparator/issues",
- "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T15:49:45+00:00"
- },
- {
- "name": "sebastian/complexity",
- "version": "2.0.2",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "739b35e53379900cc9ac327b2147867b8b6efd88"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88",
- "reference": "739b35e53379900cc9ac327b2147867b8b6efd88",
- "shasum": ""
- },
- "require": {
- "nikic/php-parser": "^4.7",
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library for calculating the complexity of PHP code units",
- "homepage": "https://github.com/sebastianbergmann/complexity",
- "support": {
- "issues": "https://github.com/sebastianbergmann/complexity/issues",
- "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T15:52:27+00:00"
- },
- {
- "name": "sebastian/diff",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3",
- "symfony/process": "^4.2 || ^5"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
- }
- ],
- "description": "Diff implementation",
- "homepage": "https://github.com/sebastianbergmann/diff",
- "keywords": [
- "diff",
- "udiff",
- "unidiff",
- "unified diff"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/diff/issues",
- "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:10:38+00:00"
- },
- {
- "name": "sebastian/environment",
- "version": "5.1.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-posix": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.1-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides functionality to handle HHVM/PHP environments",
- "homepage": "http://www.github.com/sebastianbergmann/environment",
- "keywords": [
- "Xdebug",
- "environment",
- "hhvm"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/environment/issues",
- "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:52:38+00:00"
- },
- {
- "name": "sebastian/exporter",
- "version": "4.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
- "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/recursion-context": "^4.0"
- },
- "require-dev": {
- "ext-mbstring": "*",
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
- },
- {
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
- },
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@gmail.com"
- }
- ],
- "description": "Provides the functionality to export PHP variables for visualization",
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
- "keywords": [
- "export",
- "exporter"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/exporter/issues",
- "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:24:23+00:00"
- },
- {
- "name": "sebastian/global-state",
- "version": "5.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49",
- "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/object-reflector": "^2.0",
- "sebastian/recursion-context": "^4.0"
- },
- "require-dev": {
- "ext-dom": "*",
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-uopz": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Snapshotting of global state",
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
- "keywords": [
- "global state"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/global-state/issues",
- "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2021-06-11T13:31:12+00:00"
- },
- {
- "name": "sebastian/lines-of-code",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
- "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
- "shasum": ""
- },
- "require": {
- "nikic/php-parser": "^4.6",
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library for counting the lines of code in PHP source code",
- "homepage": "https://github.com/sebastianbergmann/lines-of-code",
- "support": {
- "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
- "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-11-28T06:42:11+00:00"
- },
- {
- "name": "sebastian/object-enumerator",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
- "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/object-reflector": "^2.0",
- "sebastian/recursion-context": "^4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Traverses array structures and object graphs to enumerate all referenced objects",
- "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
- "support": {
- "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
- "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:12:34+00:00"
- },
- {
- "name": "sebastian/object-reflector",
- "version": "2.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
- "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Allows reflection of object attributes, including inherited and non-public ones",
- "homepage": "https://github.com/sebastianbergmann/object-reflector/",
- "support": {
- "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
- "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:14:26+00:00"
- },
- {
- "name": "sebastian/recursion-context",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
- }
- ],
- "description": "Provides functionality to recursively process PHP variables",
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "support": {
- "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
- "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:17:30+00:00"
- },
- {
- "name": "sebastian/resource-operations",
- "version": "3.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
- "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides a list of PHP built-in functions that operate on resources",
- "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
- "support": {
- "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
- "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T06:45:17+00:00"
- },
- {
- "name": "sebastian/type",
- "version": "2.3.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/type.git",
- "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914",
- "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Collection of value objects that represent the types of the PHP type system",
- "homepage": "https://github.com/sebastianbergmann/type",
- "support": {
- "issues": "https://github.com/sebastianbergmann/type/issues",
- "source": "https://github.com/sebastianbergmann/type/tree/2.3.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2021-06-15T12:49:02+00:00"
- },
- {
- "name": "sebastian/version",
- "version": "3.0.2",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "c6c1022351a901512170118436c764e473f6de8c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
- "reference": "c6c1022351a901512170118436c764e473f6de8c",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
+ "phpunit/phpunit": "^9.3",
+ "symfony/process": "^4.2 || ^5"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.0-dev"
+ "dev-master": "4.0-dev"
}
},
"autoload": {
@@ -3119,15 +1509,24 @@
"authors": [
{
"name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
}
],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
+ ],
"support": {
- "issues": "https://github.com/sebastianbergmann/version/issues",
- "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
},
"funding": [
{
@@ -3135,36 +1534,36 @@
"type": "github"
}
],
- "time": "2020-09-28T06:39:44+00:00"
+ "time": "2020-10-26T13:10:38+00:00"
},
{
"name": "slevomat/coding-standard",
- "version": "7.0.15",
+ "version": "7.0.19",
"source": {
"type": "git",
"url": "https://github.com/slevomat/coding-standard.git",
- "reference": "cc80e59f9b4ca642f02dc1b615c37a9afc2a0f80"
+ "reference": "bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/cc80e59f9b4ca642f02dc1b615c37a9afc2a0f80",
- "reference": "cc80e59f9b4ca642f02dc1b615c37a9afc2a0f80",
+ "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37",
+ "reference": "bef66a43815bbf9b5f49775e9ded3f7c6ba0cc37",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
"php": "^7.1 || ^8.0",
- "phpstan/phpdoc-parser": "0.5.1 - 0.5.6",
- "squizlabs/php_codesniffer": "^3.6.0"
+ "phpstan/phpdoc-parser": "^1.0.0",
+ "squizlabs/php_codesniffer": "^3.6.2"
},
"require-dev": {
- "phing/phing": "2.17.0",
- "php-parallel-lint/php-parallel-lint": "1.3.1",
- "phpstan/phpstan": "0.12.98",
- "phpstan/phpstan-deprecation-rules": "0.12.6",
- "phpstan/phpstan-phpunit": "0.12.22",
- "phpstan/phpstan-strict-rules": "0.12.11",
- "phpunit/phpunit": "7.5.20|8.5.5|9.5.9"
+ "phing/phing": "2.17.2",
+ "php-parallel-lint/php-parallel-lint": "1.3.2",
+ "phpstan/phpstan": "1.4.6",
+ "phpstan/phpstan-deprecation-rules": "1.0.0",
+ "phpstan/phpstan-phpunit": "1.0.0",
+ "phpstan/phpstan-strict-rules": "1.1.0",
+ "phpunit/phpunit": "7.5.20|8.5.21|9.5.16"
},
"type": "phpcodesniffer-standard",
"extra": {
@@ -3184,7 +1583,7 @@
"description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
"support": {
"issues": "https://github.com/slevomat/coding-standard/issues",
- "source": "https://github.com/slevomat/coding-standard/tree/7.0.15"
+ "source": "https://github.com/slevomat/coding-standard/tree/7.0.19"
},
"funding": [
{
@@ -3196,20 +1595,20 @@
"type": "tidelift"
}
],
- "time": "2021-09-09T10:29:09+00:00"
+ "time": "2022-03-01T18:01:41+00:00"
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.6.0",
+ "version": "3.6.2",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625"
+ "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625",
- "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a",
+ "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a",
"shasum": ""
},
"require": {
@@ -3252,39 +1651,38 @@
"source": "https://github.com/squizlabs/PHP_CodeSniffer",
"wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
},
- "time": "2021-04-09T00:54:41+00:00"
+ "time": "2021-12-12T21:44:58+00:00"
},
{
"name": "symfony/config",
- "version": "v5.3.4",
+ "version": "v6.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "4268f3059c904c61636275182707f81645517a37"
+ "reference": "c14f32ae4cd2a3c29d8825c5093463ac08ade7d8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/4268f3059c904c61636275182707f81645517a37",
- "reference": "4268f3059c904c61636275182707f81645517a37",
+ "url": "https://api.github.com/repos/symfony/config/zipball/c14f32ae4cd2a3c29d8825c5093463ac08ade7d8",
+ "reference": "c14f32ae4cd2a3c29d8825c5093463ac08ade7d8",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
- "symfony/filesystem": "^4.4|^5.0",
+ "php": ">=8.0.2",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/filesystem": "^5.4|^6.0",
"symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-php80": "^1.16",
"symfony/polyfill-php81": "^1.22"
},
"conflict": {
"symfony/finder": "<4.4"
},
"require-dev": {
- "symfony/event-dispatcher": "^4.4|^5.0",
- "symfony/finder": "^4.4|^5.0",
- "symfony/messenger": "^4.4|^5.0",
- "symfony/service-contracts": "^1.1|^2",
- "symfony/yaml": "^4.4|^5.0"
+ "symfony/event-dispatcher": "^5.4|^6.0",
+ "symfony/finder": "^5.4|^6.0",
+ "symfony/messenger": "^5.4|^6.0",
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/yaml": "^5.4|^6.0"
},
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
@@ -3315,7 +1713,7 @@
"description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/config/tree/v5.3.4"
+ "source": "https://github.com/symfony/config/tree/v6.0.3"
},
"funding": [
{
@@ -3331,49 +1729,46 @@
"type": "tidelift"
}
],
- "time": "2021-07-21T12:40:44+00:00"
+ "time": "2022-01-03T09:53:43+00:00"
},
{
"name": "symfony/console",
- "version": "v5.3.2",
+ "version": "v6.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1"
+ "reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
- "reference": "649730483885ff2ca99ca0560ef0e5f6b03f2ac1",
+ "url": "https://api.github.com/repos/symfony/console/zipball/3bebf4108b9e07492a2a4057d207aa5a77d146b1",
+ "reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
+ "php": ">=8.0.2",
"symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php73": "^1.8",
- "symfony/polyfill-php80": "^1.15",
- "symfony/service-contracts": "^1.1|^2",
- "symfony/string": "^5.1"
+ "symfony/service-contracts": "^1.1|^2|^3",
+ "symfony/string": "^5.4|^6.0"
},
"conflict": {
- "symfony/dependency-injection": "<4.4",
- "symfony/dotenv": "<5.1",
- "symfony/event-dispatcher": "<4.4",
- "symfony/lock": "<4.4",
- "symfony/process": "<4.4"
+ "symfony/dependency-injection": "<5.4",
+ "symfony/dotenv": "<5.4",
+ "symfony/event-dispatcher": "<5.4",
+ "symfony/lock": "<5.4",
+ "symfony/process": "<5.4"
},
"provide": {
- "psr/log-implementation": "1.0"
+ "psr/log-implementation": "1.0|2.0|3.0"
},
"require-dev": {
- "psr/log": "~1.0",
- "symfony/config": "^4.4|^5.0",
- "symfony/dependency-injection": "^4.4|^5.0",
- "symfony/event-dispatcher": "^4.4|^5.0",
- "symfony/lock": "^4.4|^5.0",
- "symfony/process": "^4.4|^5.0",
- "symfony/var-dumper": "^4.4|^5.0"
+ "psr/log": "^1|^2|^3",
+ "symfony/config": "^5.4|^6.0",
+ "symfony/dependency-injection": "^5.4|^6.0",
+ "symfony/event-dispatcher": "^5.4|^6.0",
+ "symfony/lock": "^5.4|^6.0",
+ "symfony/process": "^5.4|^6.0",
+ "symfony/var-dumper": "^5.4|^6.0"
},
"suggest": {
"psr/log": "For using the console logger",
@@ -3413,7 +1808,7 @@
"terminal"
],
"support": {
- "source": "https://github.com/symfony/console/tree/v5.3.2"
+ "source": "https://github.com/symfony/console/tree/v6.0.5"
},
"funding": [
{
@@ -3429,44 +1824,44 @@
"type": "tidelift"
}
],
- "time": "2021-06-12T09:42:48+00:00"
+ "time": "2022-02-25T10:48:52+00:00"
},
{
"name": "symfony/dependency-injection",
- "version": "v5.3.8",
+ "version": "v6.0.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "e39c344e06a3ceab531ebeb6c077e6652c4a0829"
+ "reference": "a296611f599d0b28e7af88798f830f9cb4d1e8e6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e39c344e06a3ceab531ebeb6c077e6652c4a0829",
- "reference": "e39c344e06a3ceab531ebeb6c077e6652c4a0829",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a296611f599d0b28e7af88798f830f9cb4d1e8e6",
+ "reference": "a296611f599d0b28e7af88798f830f9cb4d1e8e6",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "psr/container": "^1.1.1",
- "symfony/deprecation-contracts": "^2.1",
- "symfony/polyfill-php80": "^1.16",
- "symfony/service-contracts": "^1.1.6|^2"
+ "php": ">=8.0.2",
+ "psr/container": "^1.1|^2.0",
+ "symfony/deprecation-contracts": "^2.1|^3",
+ "symfony/polyfill-php81": "^1.22",
+ "symfony/service-contracts": "^1.1.6|^2.0|^3.0"
},
"conflict": {
"ext-psr": "<1.1|>=2",
- "symfony/config": "<5.3",
- "symfony/finder": "<4.4",
- "symfony/proxy-manager-bridge": "<4.4",
- "symfony/yaml": "<4.4"
+ "symfony/config": "<5.4",
+ "symfony/finder": "<5.4",
+ "symfony/proxy-manager-bridge": "<5.4",
+ "symfony/yaml": "<5.4"
},
"provide": {
- "psr/container-implementation": "1.0",
- "symfony/service-implementation": "1.0|2.0"
+ "psr/container-implementation": "1.1|2.0",
+ "symfony/service-implementation": "1.1|2.0|3.0"
},
"require-dev": {
- "symfony/config": "^5.3",
- "symfony/expression-language": "^4.4|^5.0",
- "symfony/yaml": "^4.4|^5.0"
+ "symfony/config": "^5.4|^6.0",
+ "symfony/expression-language": "^5.4|^6.0",
+ "symfony/yaml": "^5.4|^6.0"
},
"suggest": {
"symfony/config": "",
@@ -3501,7 +1896,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/dependency-injection/tree/v5.3.8"
+ "source": "https://github.com/symfony/dependency-injection/tree/v6.0.6"
},
"funding": [
{
@@ -3517,29 +1912,29 @@
"type": "tidelift"
}
],
- "time": "2021-09-21T20:52:44+00:00"
+ "time": "2022-03-02T12:58:14+00:00"
},
{
"name": "symfony/deprecation-contracts",
- "version": "v2.4.0",
+ "version": "v3.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627"
+ "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627",
- "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627",
+ "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced",
+ "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced",
"shasum": ""
},
"require": {
- "php": ">=7.1"
+ "php": ">=8.0.2"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.4-dev"
+ "dev-main": "3.0-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -3568,7 +1963,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0"
+ "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.0"
},
"funding": [
{
@@ -3584,26 +1979,26 @@
"type": "tidelift"
}
],
- "time": "2021-03-23T23:28:01+00:00"
+ "time": "2021-11-01T23:48:49+00:00"
},
{
"name": "symfony/filesystem",
- "version": "v5.3.4",
+ "version": "v6.0.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32"
+ "reference": "52b888523545b0b4049ab9ce48766802484d7046"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/343f4fe324383ca46792cae728a3b6e2f708fb32",
- "reference": "343f4fe324383ca46792cae728a3b6e2f708fb32",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/52b888523545b0b4049ab9ce48766802484d7046",
+ "reference": "52b888523545b0b4049ab9ce48766802484d7046",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-php80": "^1.16"
+ "symfony/polyfill-mbstring": "~1.8"
},
"type": "library",
"autoload": {
@@ -3631,7 +2026,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
- "source": "https://github.com/symfony/filesystem/tree/v5.3.4"
+ "source": "https://github.com/symfony/filesystem/tree/v6.0.6"
},
"funding": [
{
@@ -3647,25 +2042,28 @@
"type": "tidelift"
}
],
- "time": "2021-07-21T12:40:44+00:00"
+ "time": "2022-03-02T12:58:14+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.23.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce"
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce",
- "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
+ "reference": "30885182c981ab175d4d034db0f6f469898070ab",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-ctype": "*"
+ },
"suggest": {
"ext-ctype": "For best performance"
},
@@ -3680,12 +2078,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Ctype\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3710,7 +2108,7 @@
"portable"
],
"support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
},
"funding": [
{
@@ -3726,20 +2124,20 @@
"type": "tidelift"
}
],
- "time": "2021-02-19T12:13:01+00:00"
+ "time": "2021-10-20T20:35:02+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
- "version": "v1.23.1",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
- "reference": "16880ba9c5ebe3642d1995ab866db29270b36535"
+ "reference": "81b86b50cf841a64252b439e738e97f4a34e2783"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535",
- "reference": "16880ba9c5ebe3642d1995ab866db29270b36535",
+ "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783",
+ "reference": "81b86b50cf841a64252b439e738e97f4a34e2783",
"shasum": ""
},
"require": {
@@ -3759,12 +2157,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3791,7 +2189,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1"
+ "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0"
},
"funding": [
{
@@ -3807,11 +2205,11 @@
"type": "tidelift"
}
],
- "time": "2021-05-27T12:26:48+00:00"
+ "time": "2021-11-23T21:10:46+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
- "version": "v1.23.0",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
@@ -3840,12 +2238,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
- },
"files": [
"bootstrap.php"
],
+ "psr-4": {
+ "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+ },
"classmap": [
"Resources/stubs"
]
@@ -3875,7 +2273,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0"
},
"funding": [
{
@@ -3895,21 +2293,24 @@
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.23.1",
+ "version": "v1.25.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6"
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6",
- "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825",
+ "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
+ "provide": {
+ "ext-mbstring": "*"
+ },
"suggest": {
"ext-mbstring": "For best performance"
},
@@ -3924,12 +2325,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
- },
"files": [
"bootstrap.php"
- ]
+ ],
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -3955,86 +2356,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2021-05-27T12:26:48+00:00"
- },
- {
- "name": "symfony/polyfill-php73",
- "version": "v1.23.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010",
- "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php73\\": ""
- },
- "files": [
- "bootstrap.php"
- ],
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0"
},
"funding": [
{
@@ -4050,20 +2372,20 @@
"type": "tidelift"
}
],
- "time": "2021-02-19T12:13:01+00:00"
+ "time": "2021-11-30T18:21:41+00:00"
},
{
- "name": "symfony/polyfill-php80",
- "version": "v1.23.1",
+ "name": "symfony/polyfill-php81",
+ "version": "v1.25.0",
"source": {
"type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be"
+ "url": "https://github.com/symfony/polyfill-php81.git",
+ "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be",
- "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be",
+ "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
+ "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
"shasum": ""
},
"require": {
@@ -4080,95 +2402,12 @@
}
},
"autoload": {
- "psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
"files": [
"bootstrap.php"
],
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2021-07-28T13:41:28+00:00"
- },
- {
- "name": "symfony/polyfill-php81",
- "version": "v1.23.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "e66119f3de95efc359483f810c4c3e6436279436"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/e66119f3de95efc359483f810c4c3e6436279436",
- "reference": "e66119f3de95efc359483f810c4c3e6436279436",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
"psr-4": {
"Symfony\\Polyfill\\Php81\\": ""
},
- "files": [
- "bootstrap.php"
- ],
"classmap": [
"Resources/stubs"
]
@@ -4196,7 +2435,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.23.0"
+ "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0"
},
"funding": [
{
@@ -4212,25 +2451,28 @@
"type": "tidelift"
}
],
- "time": "2021-05-21T13:25:03+00:00"
+ "time": "2021-09-13T13:58:11+00:00"
},
{
"name": "symfony/service-contracts",
- "version": "v2.4.0",
+ "version": "v3.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
- "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb"
+ "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb",
- "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb",
+ "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603",
+ "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
- "psr/container": "^1.1"
+ "php": ">=8.0.2",
+ "psr/container": "^2.0"
+ },
+ "conflict": {
+ "ext-psr": "<1.1|>=2"
},
"suggest": {
"symfony/service-implementation": ""
@@ -4238,7 +2480,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-main": "2.4-dev"
+ "dev-main": "3.0-dev"
},
"thanks": {
"name": "symfony/contracts",
@@ -4275,7 +2517,7 @@
"standards"
],
"support": {
- "source": "https://github.com/symfony/service-contracts/tree/v2.4.0"
+ "source": "https://github.com/symfony/service-contracts/tree/v3.0.0"
},
"funding": [
{
@@ -4291,44 +2533,46 @@
"type": "tidelift"
}
],
- "time": "2021-04-01T10:43:52+00:00"
+ "time": "2021-11-04T17:53:12+00:00"
},
{
"name": "symfony/string",
- "version": "v5.3.7",
+ "version": "v6.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
- "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5"
+ "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5",
- "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5",
+ "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2",
+ "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2",
"shasum": ""
},
"require": {
- "php": ">=7.2.5",
+ "php": ">=8.0.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php80": "~1.15"
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "conflict": {
+ "symfony/translation-contracts": "<2.0"
},
"require-dev": {
- "symfony/error-handler": "^4.4|^5.0",
- "symfony/http-client": "^4.4|^5.0",
- "symfony/translation-contracts": "^1.1|^2",
- "symfony/var-exporter": "^4.4|^5.0"
+ "symfony/error-handler": "^5.4|^6.0",
+ "symfony/http-client": "^5.4|^6.0",
+ "symfony/translation-contracts": "^2.0|^3.0",
+ "symfony/var-exporter": "^5.4|^6.0"
},
"type": "library",
"autoload": {
- "psr-4": {
- "Symfony\\Component\\String\\": ""
- },
"files": [
"Resources/functions.php"
],
+ "psr-4": {
+ "Symfony\\Component\\String\\": ""
+ },
"exclude-from-classmap": [
"/Tests/"
]
@@ -4358,7 +2602,7 @@
"utf8"
],
"support": {
- "source": "https://github.com/symfony/string/tree/v5.3.7"
+ "source": "https://github.com/symfony/string/tree/v6.0.3"
},
"funding": [
{
@@ -4374,70 +2618,20 @@
"type": "tidelift"
}
],
- "time": "2021-08-26T08:00:08+00:00"
- },
- {
- "name": "theseer/tokenizer",
- "version": "1.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/theseer/tokenizer.git",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-tokenizer": "*",
- "ext-xmlwriter": "*",
- "php": "^7.2 || ^8.0"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Arne Blankerts",
- "email": "arne@blankerts.de",
- "role": "Developer"
- }
- ],
- "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
- "support": {
- "issues": "https://github.com/theseer/tokenizer/issues",
- "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
- },
- "funding": [
- {
- "url": "https://github.com/theseer",
- "type": "github"
- }
- ],
- "time": "2021-07-28T10:34:58+00:00"
+ "time": "2022-01-02T09:55:41+00:00"
},
{
"name": "vimeo/psalm",
- "version": "4.10.0",
+ "version": "4.22.0",
"source": {
"type": "git",
"url": "https://github.com/vimeo/psalm.git",
- "reference": "916b098b008f6de4543892b1e0651c1c3b92cbfa"
+ "reference": "fc2c6ab4d5fa5d644d8617089f012f3bb84b8703"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/vimeo/psalm/zipball/916b098b008f6de4543892b1e0651c1c3b92cbfa",
- "reference": "916b098b008f6de4543892b1e0651c1c3b92cbfa",
+ "url": "https://api.github.com/repos/vimeo/psalm/zipball/fc2c6ab4d5fa5d644d8617089f012f3bb84b8703",
+ "reference": "fc2c6ab4d5fa5d644d8617089f012f3bb84b8703",
"shasum": ""
},
"require": {
@@ -4445,7 +2639,7 @@
"amphp/byte-stream": "^1.5",
"composer/package-versions-deprecated": "^1.8.0",
"composer/semver": "^1.4 || ^2.0 || ^3.0",
- "composer/xdebug-handler": "^1.1 || ^2.0",
+ "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0",
"dnoegel/php-xdg-base-dir": "^0.1.1",
"ext-ctype": "*",
"ext-dom": "*",
@@ -4457,11 +2651,11 @@
"felixfbecker/advanced-json-rpc": "^3.0.3",
"felixfbecker/language-server-protocol": "^1.5",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0",
- "nikic/php-parser": "^4.12",
+ "nikic/php-parser": "^4.13",
"openlss/lib-array2xml": "^1.0",
"php": "^7.1|^8",
"sebastian/diff": "^3.0 || ^4.0",
- "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0",
+ "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0",
"webmozart/path-util": "^2.3"
},
"provide": {
@@ -4479,11 +2673,12 @@
"psalm/plugin-phpunit": "^0.16",
"slevomat/coding-standard": "^7.0",
"squizlabs/php_codesniffer": "^3.5",
- "symfony/process": "^4.3 || ^5.0",
+ "symfony/process": "^4.3 || ^5.0 || ^6.0",
"weirdan/prophecy-shim": "^1.0 || ^2.0"
},
"suggest": {
- "ext-igbinary": "^2.0.5"
+ "ext-curl": "In order to send data to shepherd",
+ "ext-igbinary": "^2.0.5 is required, used to serialize caching data"
},
"bin": [
"psalm",
@@ -4502,13 +2697,13 @@
}
},
"autoload": {
- "psr-4": {
- "Psalm\\": "src/Psalm/"
- },
"files": [
"src/functions.php",
"src/spl_object_id.php"
- ]
+ ],
+ "psr-4": {
+ "Psalm\\": "src/Psalm/"
+ }
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@@ -4527,9 +2722,9 @@
],
"support": {
"issues": "https://github.com/vimeo/psalm/issues",
- "source": "https://github.com/vimeo/psalm/tree/4.10.0"
+ "source": "https://github.com/vimeo/psalm/tree/4.22.0"
},
- "time": "2021-09-04T21:00:09+00:00"
+ "time": "2022-02-24T20:34:05+00:00"
},
{
"name": "webmozart/assert",
@@ -4637,6 +2832,7 @@
"issues": "https://github.com/webmozart/path-util/issues",
"source": "https://github.com/webmozart/path-util/tree/2.3.0"
},
+ "abandoned": "symfony/filesystem",
"time": "2015-12-17T08:42:14+00:00"
}
],
@@ -4647,5 +2843,5 @@
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
- "plugin-api-version": "2.1.0"
+ "plugin-api-version": "2.2.0"
}