Open GeeH opened 10 years ago
In general, all files have messed up headers/docblocks which I won't review as it's just noise. License should be included in files.
UglyDi\UglyDi
:UglyDi
is designed for inheritance (which doesn't seem to be the case), all properties should be made private
.null === $config
__construct
should not return a value__construct
by simply not allowing a file to be passed innull
an actual allowed instantiated type?array
array
hintReflectionClass
: no need to throw an exception manually, but eventually catch and re-throw a specialized exception if needed$reflector->getConstructor()
insteadrequire
-ing a file, the container should rely on the generator for requiring the factorycall_user_func
starting from PHP 5.4+UglyDi\UglyDi#getReflector()
should probably not be publicUglyDi\UglyDi#setCreatedClass()
should probably not be publicUglyDi\UglyDi#getAlwaysGenerate()
should probably not be publicUglyDi\UglyDi#setAlwaysGenerate()
should probably not be publicUglyDi\Module
:The entire class should probably be avoided, as this is a library more than a module
UglyDi\Exception\InvalidCacheDirException
:UglyDi
exception interface for generic UglyDi
exception catching__construct
, which is not specific to the use-cases of UglyDi
UglyDi\Exception\InvalidClassException
:UglyDi
exception interface for generic UglyDi
exception catching__construct
, which is not specific to the use-cases of UglyDi
UglyDi\Generator\GeneratorInterface
:exists
and getFileName
can be simplified into load
, which returns a callable
generateFactory
is not needed if load
is implemented, as the need for code-generation becomes an implementation detail of the generator$parameters
is not validable in PHP due to the lack of generics, therefore, I'd expect the interface to define an @throws
docblockUglyDi\Generator\Generator
:Further reviews will be provided if a pull request is provided.
Please review the code and give your opinions @ocramius.