xp-forge / inject

Dependency injection for the XP Framework
0 stars 0 forks source link

Add [@inject("name")] as short form of (name= "name") #21

Closed thekid closed 5 years ago

thekid commented 5 years ago

Current functionality:

class Urls {
  public function __construct(<<inject(['name' => 'db-dsn'])>> string $dsn) {
    // ...
  }
}

This can now be abbreviated to the following:

class Urls {
  public function __construct(<<inject('db-dsn')>> string $dsn) {
    // ...
  }
}