src/Models/Contact.php
public function setPhoneNumber(PhoneNumber $phoneNumber)
    {
        if (!is_a($phoneNumber, PhoneNumber::class, false))
        {
            throw new InvalidArgumentException("The phone number is not an instance of the PhoneNumber class.");
        }

        $this->phoneNumbers[$phoneNumber->getType()] = $phoneNumber;
    }
public function setPhoneNumber(PhoneNumber $phoneNumber)
    {
        if (!is_a($phoneNumber, PhoneNumber::class, false))
        {
            throw new InvalidArgumentException("The phone number is not an instance of the PhoneNumber class.");
        }

        $this->phoneNumbers[$phoneNumber->getType()] = $phoneNumber;
    }
public function setPhoneNumber ( PhoneNumber $ phoneNumber ) { if ( ! is_a ( $ phoneNumber , PhoneNumber :: class , false ) ) { throw new InvalidArgumentException ( "The phone number is not an instance of the PhoneNumber class." ) ; } $ this -> phoneNumbers [ $ phoneNumber -> getType ( ) ] = $ phoneNumber ; }
Set a phone number on the contact.
@param PhoneNumber $phoneNumber
@return array
Set a phone number on the contact .