public function processUserPayment($userName) { $user = new User($userName); $paymentMethod = $user->getPaymentMethod(); $this->executePayment($paymentMethod); }
function processUserPayment(User $user) { $paymentMethod = $user->getPaymentMethod(); $this->executePayment($paymentMethod); }