Type duplication in xpcli injections

at 2009-10-14 in ExamplesAnnouncements by friebe (0 comments)

It's just become another bit easier to write command line classes in the XP framework ("xpclis"). When using the @inject annotation you no longer have to specify the type parameter if you use a so-called "type hint" - so instead of writing the following:

  #[@inject(type= 'rdbms.DBConnection', name= 'caffeine')]
public function setConnection(DBConnection $conn) { ... }
...you can now omit the type part - it will be inferred from the first parameter's type:
  #[@inject(name= 'caffeine')]
public function setConnection(DBConnection $conn) { ... }



Subscribe

You can subscribe to the XP framework's news by using RSS syndication.


Categories

News
General
PHP5
Announcements
RFCs
Further reading
Examples
Editorial
EASC
Experiments
Unittests
Databases
5.8-SERIES
Unicode
Language
5.9-SERIES

Related

Find related articles by a search for «Type».