/** * @param float|null $lifetime * * @return Customer */ protected function createCustomer($lifetime = null) { $customer = new Customer(); $customer->setId(2); if ($lifetime) { $customer->setLifetime($lifetime); } return $customer; }