Conditions | 1 |
Paths | 1 |
Total Lines | 26 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
20 | private function addCallbackHandlers( $callbackLoader ) { |
||
21 | |||
22 | $callbackLoader->registerCallback( 'Foo', function() { |
||
23 | return new \stdClass; |
||
24 | } ); |
||
25 | |||
26 | $callbackLoader->registerExpectedReturnType( 'Foo', '\stdClass' ); |
||
27 | |||
28 | $callbackLoader->registerCallback( 'FooWithArgument', function( $argument ) use( $callbackLoader ) { |
||
29 | $callbackLoader->registerExpectedReturnType( 'FooWithArgument', '\stdClass' ); |
||
30 | |||
31 | $stdClass = new \stdClass; |
||
32 | $stdClass->argument = $argument; |
||
33 | |||
34 | return $stdClass; |
||
35 | } ); |
||
36 | |||
37 | $callbackLoader->registerCallback( 'FooWithNullArgument', function( $argument = null ) use( $callbackLoader ) { |
||
38 | $callbackLoader->registerExpectedReturnType( 'FooWithNullArgument', '\stdClass' ); |
||
39 | |||
40 | $stdClass = new \stdClass; |
||
41 | $stdClass->argument = $argument; |
||
42 | |||
43 | return $stdClass; |
||
44 | } ); |
||
45 | } |
||
46 | |||
48 |