Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/ClassDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Http\Discovery;

use Http\Discovery\Exception\ClassinstantiationFailedException;
use Http\Discovery\Exception\ClassInstantiationFailedException;
use Http\Discovery\Exception\DiscoveryFailedException;
use Http\Discovery\Exception\StrategyUnavailableException;

Expand Down Expand Up @@ -182,9 +182,11 @@ protected static function evaluateCondition($condition)
/**
* Get an instance of the $class.
*
* @param string|\Closure $class A FQN of a class or a closure that instantiate the class.
* @param string|\Closure $class A FQCN of a class or a closure that instantiate the class.
*
* @return object
*
* @throws ClassInstantiationFailedException
*/
protected static function instantiateClass($class)
{
Expand All @@ -197,9 +199,9 @@ protected static function instantiateClass($class)
return $class();
}
} catch (\Exception $e) {
throw new ClassinstantiationFailedException('Unexcepced exception when instantiating class.', 0, $e);
throw new ClassInstantiationFailedException('Unexcepced exception when instantiating class.', 0, $e);
}

throw new ClassinstantiationFailedException('Could not instantiate class becuase parameter is neitehr a callable or a string');
throw new ClassInstantiationFailedException('Could not instantiate class becuase parameter is neither a callable nor a string');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
*
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
*/
class ClassinstantiationFailedException extends \RuntimeException implements Exception
final class ClassInstantiationFailedException extends \RuntimeException implements Exception
{
}