getLatLngFromSource = $getLatLngFromSource; $this->getLatLngFromAddress = $getLatLngFromAddress; $this->getDistance = $getDistance; } /** * Get distance from source to address * * @param SourceInterface $source * @param AddressInterface $address * @return float */ public function execute(SourceInterface $source, AddressInterface $address): float { return $this->getDistance->execute( $this->getLatLngFromSource->execute($source), $this->getLatLngFromAddress->execute($address) ); } }