private function delegatesEncoding($value, $type, Chain $chain, Encoder $encoder) { $method = 'encode' . ucfirst($type); $chain->first($method, [$value, null])->willReturn($encoder); $this->encodeValue($value); }
function routesEncoding(Chain $chain, $value, $target) { $chain->first($target, [$value, null])->shouldBeCalled(); $this->routeEncodeValue($chain, $value); }