Skip to content

Minor fixes that address comments made in #66 #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 7, 2016
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 <[email protected]>
*/
class ClassinstantiationFailedException extends \RuntimeException implements Exception
final class ClassInstantiationFailedException extends \RuntimeException implements Exception
{
}