avoid reflection exception when returning parameter

Alternative for https://github.com/qandidate-labs/broadway/pull/48

Also the solution used by https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/KnpPaginatorBundle.php