src/Training/VOs/Address.php
/**
     * Create an instance from an array data
     * @param array $data
     * @return Address
     * @throws ValidatorException
     */
Create an instance from an array data
@param array $data
@return Address
@throws ValidatorException
Create an instance from an array data @param array $data @return Address @throws ValidatorException
public static function fromArray(array $data):self {
        if (empty($data) || !is_array($data)) {
            throw new \InvalidArgumentException('The input data must be an array');
        } else {
            return new self(
                $data['street'],
                $data['streetNumber'],
                $data['cityName'],
                $data['postalCode'],
                $data['stateOrProvince'],
                $data['countryName']
            );
        }
    }
public static function fromArray ( array $ data ) : self { if ( empty ( $ data ) || ! is_array ( $ data ) ) { throw new \ InvalidArgumentException ( 'The input data must be an array' ) ; } else { return new self ( $ data [ 'street' ] , $ data [ 'streetNumber' ] , $ data [ 'cityName' ] , $ data [ 'postalCode' ] , $ data [ 'stateOrProvince' ] , $ data [ 'countryName' ] ) ; } }
Create an instance from an array data
 @param array $data
 @return Address
 @throws ValidatorException
Create an instance from an array data @param array $data @return Address @throws ValidatorException