File tree 3 files changed +13
-5
lines changed
3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 3
3
All notable changes to this project will be documented in this file.
4
4
Updates should follow the [ Keep a CHANGELOG] ( https://keepachangelog.com/ ) principles.
5
5
6
+ ## [ 0.9.1] - 2020-10-11
7
+ ### Fixed
8
+ - Fixed issues with string callables throwing exception on PSR-11 containers
9
+
6
10
## [ 0.9.0] - 2020-10-05
7
11
### Added
8
12
- Added ` DivineNii\Invoker\Interfaces\ArgumentValueResolverInterface ` for ` DivineNii\Invoker\ArgumentResolver ` class
@@ -37,6 +41,7 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
37
41
### Added
38
42
- Initial commit
39
43
44
+ [ 0.9.1 ] : https://github.com/divineniiquaye/php-invoker/compare/v0.9.0...v0.9.1
40
45
[ 0.9.0 ] : https://github.com/divineniiquaye/php-invoker/compare/v0.1.2...v0.9.0
41
46
[ 0.1.2 ] : https://github.com/divineniiquaye/php-invoker/compare/v0.1.1...v0.1.2
42
47
[ 0.1.1 ] : https://github.com/divineniiquaye/php-invoker/compare/v0.1.0...v0.1.1
Original file line number Diff line number Diff line change @@ -72,10 +72,8 @@ public function resolve($callable)
72
72
return $ this ->resolve ($ this ->container ->get ($ callable ));
73
73
} catch (NotFoundExceptionInterface $ e ) {
74
74
if ($ this ->container ->has ($ callable )) {
75
- throw $ e ;
75
+ throw NotCallableException:: fromInvalidCallable ( $ callable , true ) ;
76
76
}
77
-
78
- throw NotCallableException::fromInvalidCallable ($ callable , true );
79
77
}
80
78
}
81
79
Original file line number Diff line number Diff line change @@ -109,8 +109,13 @@ public function testResolveWithContainerHasAndException($unResolved): void
109
109
$ container ->method ('has ' )->with ('handler ' )->willReturn (true );
110
110
$ container ->method ('get ' )->willThrowException (self ::notFoundException ());
111
111
112
- $ this ->expectExceptionMessage ('Is not a callable, yeah. ' );
113
- $ this ->expectException (NotFoundExceptionInterface::class);
112
+ if (is_array ($ unResolved )) {
113
+ $ this ->expectExceptionMessage ('Is not a callable, yeah. ' );
114
+ $ this ->expectException (NotFoundExceptionInterface::class);
115
+ } else {
116
+ $ this ->expectExceptionMessage ('\'handler \' is neither a callable nor a valid container entry ' );
117
+ $ this ->expectException (NotCallableException::class);
118
+ }
114
119
115
120
$ factory = new CallableResolver ($ container );
116
121
$ factory ->resolve ($ unResolved );
You can’t perform that action at this time.
0 commit comments