<?php

/*
 * This file is part of the AuthStack project.
 *
 * (c) Buckhill Ltd <development@buckhill.co.uk>
 *
 * This source file is subject to the Buckhill license that is bundled
 * with this source code in the file LICENSE.
 */

namespace AuthStack\SP\Helpers;


use AuthStack\SP\ServiceProvider;
use Symfony\Component\HttpFoundation\Request;

class Logout
{
    public function __construct(array $config, $idp, Request $request = null)
    {
        $this->sp = new ServiceProvider($config, $idp);
        $this->request = $request;
    }


    /**
     *
     */
    public function consume()
    {
        return $this->sp->consumeLogout($this->request);
    }


    /**
     * @return \AuthStack\SP\Requests\Logout
     */
    public function create()
    {
        return $this->sp->createLogout();
    }


    /**
     *
     */
    public function initiate()
    {
        return $this->create()->initiate();
    }
}