Getting an argument list for a class method

Posted by Chris T on Stack Overflow See other posts from Stack Overflow or by Chris T
Published on 2010-05-29T22:12:16Z Indexed on 2010/05/29 22:22 UTC
Read the original article Hit count: 146

What I'd like is for this class

class Car {
    public function __construct(Engine $engine, Make $make, Model $model)
    {
          // stuff
    }
}

Get an array that has the types needed to construct this car (Engine, Make, Model) in the order they are needed for the constructor. I'm using this for a Dependency Injection-esque thing I'm making.

© Stack Overflow or respective owner

Related posts about php

Related posts about reflection