Skip to content

Commit

Permalink
Merge pull request #72 from DoclerLabs/develop
Browse files Browse the repository at this point in the history
prepare 0.34.0
  • Loading branch information
aliokan authored Jan 15, 2018
2 parents 07983e6 + 0bad1be commit 72f72db
Show file tree
Hide file tree
Showing 50 changed files with 292 additions and 2,715 deletions.
27 changes: 9 additions & 18 deletions src/hex/di/Injector.hx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ class Injector
return null;
}
}

inline function _getClassDescription( type : Class<Dynamic> )
{
return Reflect.getProperty( type, "__INJECTION" );
}

public function instantiateUnmapped<T>( type : Class<T> ) : T
{
Expand All @@ -149,6 +144,10 @@ class Injector
{
instance = ( cast type ).__ac( this.getInstanceWithClassName );
}
catch ( e : MissingMappingException )
{
throw( e );
}
catch( e : Dynamic )
{
instance = Type.createInstance( type, [] );
Expand All @@ -161,9 +160,13 @@ class Injector
this._applyInjection( instance, type );
}
}
catch ( e : MissingMappingException )
{
throw( e );
}
catch ( e : Dynamic )
{

//Do nothing
}

return instance;
Expand Down Expand Up @@ -250,23 +253,11 @@ class Injector

public function destroyInstance( instance : Dynamic ) : Void
{
//#if php
if ( this._managedObjects.containsKey( instance ) )
{
this._managedObjects.remove( instance );
instance.__ap();
}
/*#else
try
{
this._managedObjects.remove( instance );
instance.__ap();
}
catch ( e : Dynamic )
{
}
#end*/
}

public function map<T>( type : Class<T>, name : String = '' ) : InjectionMapping<T>
Expand Down
Loading

0 comments on commit 72f72db

Please sign in to comment.