<?php

namespace AuthStack\OAuth2\Model\Protocol;

class Client
{
    const T_PUBLIC = 'public';
    const T_CONFIDENTIAL = 'confidential';

    protected $client_id;
    protected $client_secret;
    protected $redirect_uris = [];


    /**
     * @param string $id
     * @return Client
     */
    public function setClientID(string $id): self
    {
        $this->client_id = $id;

        return $this;
    }

    /**
     * @return mixed
     */
    public function getClientID()
    {
        return $this->client_id;
    }

    /**
     * @param string $secret
     * @return Client
     */
    public function setClientSecret(string $secret): self
    {
        $this->client_secret = $secret;

        return $this;
    }

    /**
     * @return string
     */
    public function getClientSecret(): string
    {
        return $this->client_secret;
    }

    public function addRedirectURI(string $uri)
    {

    }

    protected function isValidUrl(string $url): bool
    {
        $result = filter_var($url, FILTER_VALIDATE_URL);

        if(!$result) return false;

        return !(bool)strpos($url, '#');
    }
}