protected static function createProfiledNameFromObject($arg, &$profile)
    {
        // If the name is invalid
        if (!isset($arg->name)) {
            throw new InvalidArgumentException(
                InvalidArgumentException::INVALID_TYPE_PROPERTY_NAME_STR,
                InvalidArgumentException::INVALID_TYPE_PROPERTY_NAME
            );
        }

        if (isset($arg->profile)) {
            $profile = trim($arg->profile) ?: null;
        }

        return self::createProfiledNameFromString($arg->name, $profile);
    }