aboutsummaryrefslogblamecommitdiffstats
path: root/vendor/sabre/dav/tests/Sabre/DAV/TestPlugin.php
blob: 3bfe3b3b04fe8b3a62c2ec6d2ee4a2c43edfdc06 (plain) (tree)
1
2
3
4
5
6
7
8
9

     

                        

                    

                                 
 

                                     

                         

                                 
                            

     


                                        

     


                                                               

     

                                                                                        
                                                    
 
                    
     
 
<?php

declare(strict_types=1);

namespace Sabre\DAV;

use Sabre\HTTP\RequestInterface;
use Sabre\HTTP\ResponseInterface;

class TestPlugin extends ServerPlugin
{
    public $beforeMethod;

    public function getFeatures()
    {
        return ['drinking'];
    }

    public function getHTTPMethods($uri)
    {
        return ['BEER', 'WINE'];
    }

    public function initialize(Server $server)
    {
        $server->on('beforeMethod:*', [$this, 'beforeMethod']);
    }

    public function beforeMethod(RequestInterface $request, ResponseInterface $response)
    {
        $this->beforeMethod = $request->getMethod();

        return true;
    }
}