PHP 8.2.30
Preview: CallbackRequestMatcher.php Size: 584 B
/home/byroehnu/easetack.com/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php

<?php

namespace Http\Message\RequestMatcher;

use Http\Message\RequestMatcher;
use Psr\Http\Message\RequestInterface;

/**
 * Match a request with a callback.
 *
 * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
 */
final class CallbackRequestMatcher implements RequestMatcher
{
    /**
     * @var callable
     */
    private $callback;

    public function __construct(callable $callback)
    {
        $this->callback = $callback;
    }

    public function matches(RequestInterface $request)
    {
        return (bool) call_user_func($this->callback, $request);
    }
}

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
584 B lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
943 B lrw-rw-rw- 2024-10-02 11:34:13
Edit Download
2.03 KB lrw-rw-rw- 2024-10-02 11:34:13
Edit Download

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