<?php

declare(strict_types=1);

namespace NoahVet\Reef\HWI\OAuth\Response;

use HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse;

class ReefUserResponse extends PathUserResponse
{
    /**
     * @return string[]|null
     */
    public function getGroups(): ?array
    {
        if (!$this->data) {
            return null;
        }

        $groups = $this->data['groups'] ?? [];

        return \is_array($groups) ? $groups : null;
    }
}
