<?php
namespace Modules\API\APIInterne\Magic\Rules;

use Psr\Http\Message\ServerRequestInterface;

class Main
{
    /** @var ServerRequestInterface $request */
    protected ServerRequestInterface $request;
    
    /** @var \PDO $pdo */
    protected \PDO $pdo;
    
    /** @var array<mixed> $documentAuthorize */
    protected array $documentAuthorize;
        
    /**
     * __construct
     *
     * @param  ServerRequestInterface $request
     * @param  \PDO $pdo
     * @return void
     */
    public function __construct(ServerRequestInterface  $request, \PDO $pdo)
    {
        $this->request  = $request;
        $this->pdo      = $pdo;
    }
        
    /**
     * getDocumentAuthorize
     *
     * @param  string|false $key
     * @return array<mixed>|string
     */
    public function getDocumentAuthorize($key = false)
    {
        return $key !== false ? $this->documentAuthorize[$key] : $this->documentAuthorize;
    }
}
