PHP 8.2.30
Preview: Chain.php Size: 1.13 KB
/home/byroehnu/easetack.com/vendor/php-http/message/src/Authentication/Chain.php

<?php

namespace Http\Message\Authentication;

use Http\Message\Authentication;
use Psr\Http\Message\RequestInterface;

/**
 * Authenticate a PSR-7 Request with a multiple authentication methods.
 *
 * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
 */
final class Chain implements Authentication
{
    /**
     * @var Authentication[]
     */
    private $authenticationChain = [];

    /**
     * @param Authentication[] $authenticationChain
     */
    public function __construct(array $authenticationChain = [])
    {
        foreach ($authenticationChain as $authentication) {
            if (!$authentication instanceof Authentication) {
                throw new \InvalidArgumentException(
                    'Members of the authentication chain must be of type Http\Message\Authentication'
                );
            }
        }

        $this->authenticationChain = $authenticationChain;
    }

    public function authenticate(RequestInterface $request)
    {
        foreach ($this->authenticationChain as $authentication) {
            $request = $authentication->authenticate($request);
        }

        return $request;
    }
}

Directory Contents

Dirs: 0 × Files: 9

Name Size Perms Modified Actions
1.10 KB lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
869 B lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
658 B lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
1.13 KB lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
599 B lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
1.76 KB lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
1.04 KB lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
951 B lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
1.68 KB lrw-rw-rw- 2024-10-02 11:34:13
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).