Http
class Http extends Facade
Properties
| static protected Container|null | $app | The application instance being facaded. |
from Facade |
| static protected array | $resolvedInstance | The resolved object instances. |
from Facade |
| static protected bool | $cached | Indicates if the resolved instance should be cached. |
from Facade |
Methods
Initiate a mock expectation on the facade.
Initiate a mock expectation on the facade.
Create a fresh mock instance for the given class.
Get the registered name of the component.
Resolve the facade root instance from the container.
Clear a resolved facade instance.
Get the application instance behind the facade.
Handle dynamic, static calls to the object.
Register a stub callable that will intercept requests and be able to return stub responses.
Register a response sequence for the given URL pattern.
Indicate that an exception should be thrown if any request is not faked.
No description
No description
No description
No description
No description
No description
No description
No description
\Hypervel\Http\Client\PendingRequest
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
in
Facade at line 61
static void
resolved(Closure $callback)
Run a Closure when the facade has been resolved.
Boot-only. The callback is registered on the worker-global container and runs for every subsequent resolution of the facade accessor.
in
Facade at line 81
static MockInterface|null
spy()
Convert the facade into a Mockery spy.
Tests only. Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 99
static MockInterface
partialMock()
Initiate a partial mock on the facade.
Tests only. Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 115
static CompositeExpectation|Expectation|HigherOrderMessage
shouldReceive()
Initiate a mock expectation on the facade.
Tests only. Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 131
static CompositeExpectation|Expectation|ExpectsHigherOrderMessage
expects()
Initiate a mock expectation on the facade.
Tests only. Swaps the resolved facade instance for the worker lifetime.
in
Facade at line 145
static protected MockInterface
createFreshMockInstance()
Create a fresh mock instance for the given class.
in
Facade at line 157
static protected MockInterface
createMock()
Create a fresh mock instance for the given class.
in
Facade at line 167
static protected bool
isMock()
Determines whether a mock is set as the instance of the facade.
in
Facade at line 178
static protected string|null
getMockableClass()
Get the mockable class for the bound instance.
in
Facade at line 194
static void
swap(mixed $instance)
Hotswap the underlying instance behind the facade.
Tests only. Replaces the worker-wide resolved facade instance and container binding; runtime use races across coroutines and changes every subsequent facade call.
in
Facade at line 206
static bool
isFake()
Determines whether a "fake" has been set as the facade instance.
in
Facade at line 217
static mixed
getFacadeRoot()
Get the root object behind the facade.
at line 183
static protected string
getFacadeAccessor()
Get the registered name of the component.
in
Facade at line 233
static protected mixed
resolveFacadeInstance(string $name)
Resolve the facade root instance from the container.
in
Facade at line 256
static void
clearResolvedInstance(string|null $name = null)
Clear a resolved facade instance.
Boot or tests only. Clears a worker-wide facade cache entry; concurrent coroutines may still hold the previous resolved instance.
in
Facade at line 267
static void
clearResolvedInstances()
Clear all of the resolved instances.
Boot or tests only. Clears the worker-wide facade cache; concurrent coroutines may still hold previously resolved instances.
in
Facade at line 275
static Collection
defaultAliases()
Get the application default aliases.
in
Facade at line 335
static Container|null
getFacadeApplication()
Get the application instance behind the facade.
in
Facade at line 346
static void
setFacadeApplication(Container|null $app)
Set the application instance.
Boot or tests only. Replaces the worker-wide facade application reference; runtime use races across coroutines and breaks every facade lookup.
in
Facade at line 356
static mixed
__callStatic(string $method, array $args)
Handle dynamic, static calls to the object.
at line 135
static Factory
fake(array|callable|null $callback = null)
Register a stub callable that will intercept requests and be able to return stub responses.
Tests only. Stubs persist on the HTTP factory for the worker lifetime.
at line 147
static ResponseSequence
fakeSequence(string $urlPattern = '*')
Register a response sequence for the given URL pattern.
Tests only. The sequence and stub persist on the HTTP factory for the worker lifetime.
at line 161
static Factory
preventStrayRequests(bool $prevent = true)
Indicate that an exception should be thrown if any request is not faked.
Boot or tests only. The policy persists on the HTTP factory for the worker lifetime.
at line 173
static Factory
stubUrl(string $url, array|callable|int|PromiseInterface|Response|string $callback)
Stub the given URL using the given callback.
Tests only. The stub persists on the HTTP factory for the worker lifetime.
at line 128
static Factory
allowStrayRequests(array|null $only = 'null')
No description
at line 128
static void
assertNothingSent()
No description
at line 128
static void
assertNotSent(callable $callback)
No description
at line 128
static void
assertSent(callable $callback)
No description
at line 128
static void
assertSentCount(int $count)
No description
at line 128
static void
assertSentInOrder(array $callbacks)
No description
at line 128
static void
assertSequencesAreEmpty()
No description
at line 128
static ClientInterface
createClient(HandlerStack $handlerStack, CookieJar $cookies)
No description
at line 128
void
static()
\Hypervel\Http\Client\PendingRequest
at line 128
static Closure
failedConnection(string|null $message = 'null')
No description
at line 128
static RequestException
failedRequest(StreamInterface|string $body = 'null', int $status = '200', array $headers = '[]')
No description
at line 128
static void
flushMacros()
No description
at line 128
static void
flushState()
No description
at line 128
static Factory
forgetConnectionHandlers()
No description
at line 128
static array
getConnectionConfig(string $name)
No description
at line 128
static array
getConnectionConfigs()
No description
at line 128
static callable
getConnectionHandler(string $name)
No description
at line 128
static array
getConnectionOptions(string $name)
No description
at line 128
static Dispatcher|null
getDispatcher()
No description
at line 128
static array
getGlobalMiddleware()
No description
at line 128
static Factory
globalMiddleware(callable $middleware)
No description
at line 128
static Factory
globalOptions(Closure|array $options)
No description
at line 128
static Factory
globalRequestMiddleware(callable $middleware)
No description
at line 128
static Factory
globalResponseMiddleware(callable $middleware)
No description
at line 128
static bool
hasConnection(string $name)
No description
at line 128
static bool
hasMacro(string $name)
No description
at line 128
static void
macro(string $name, callable|object $macro)
No description
at line 128
static mixed
macroCall(string $method, array $parameters)
No description
at line 128
static void
mixin(object $mixin, bool $replace = 'true')
No description
at line 128
static bool
preventingStrayRequests()
No description
at line 128
static Response
psr7Response(StreamInterface|string $body = 'null', int $status = '200', array $headers = '[]')
No description
at line 128
static Factory
record()
No description
at line 128
static Collection
recorded(callable|null $callback = 'null')
No description
at line 128
static void
recordRequestResponsePair(Request $request, Response|null $response)
No description
at line 128
static Factory
registerConnection(string $name, array $config = '[]')
No description
at line 128
static PromiseInterface
response(StreamInterface|string $body = 'null', int $status = '200', array $headers = '[]')
No description
at line 128
static ResponseSequence
sequence(array $responses = '[]')
No description
at line 128
static Factory
setConnectionConfig(string $name, array $config)
No description
at line 128
static mixed
withoutGlobalConfiguration(Closure $callback)
No description
at line 128
static PendingRequest
accept(string $contentType)
No description
at line 128
static PendingRequest
acceptJson()
No description
at line 128
static PendingRequest
afterResponse(callable $callback)
No description
at line 128
static PendingRequest
asForm()
No description
at line 128
static PendingRequest
asJson()
No description
at line 128
static PendingRequest
asMultipart()
No description
at line 128
static PendingRequest
attach(array|string $name, resource|string $contents = '\'\'', string|null $filename = 'null', array $headers = '[]')
No description
at line 128
static array
attributes()
No description
at line 128
static PendingRequest
baseUrl(string $url)
No description
at line 128
static PendingRequest
beforeSending(callable $callback)
No description
at line 128
static PendingRequest
bodyFormat(string $format)
No description
at line 128
static Closure
buildBeforeSendingHandler()
No description
at line 128
static ClientInterface
buildClient()
No description
at line 128
static HandlerStack
buildHandlerStack()
No description
at line 128
static Closure
buildRecorderHandler()
No description
at line 128
static Closure
buildStubHandler()
No description
at line 128
static PendingRequest
connection(string $connection, array|null $config = 'null')
No description
at line 128
static PendingRequest
connectTimeout(int|float $seconds)
No description
at line 128
static PendingRequest
contentType(string $contentType)
No description
at line 128
static PendingRequest
dd()
No description
at line 128
static PromiseInterface
delete(string $url, JsonSerializable|array $data = '[]')
No description
at line 128
static PendingRequest
dontTruncateExceptions()
No description
at line 128
static PendingRequest
dump()
No description
at line 128
static PromiseInterface
get(string $url, JsonSerializable|array|string|null $query = 'null')
No description
at line 128
static string|null
getConnection()
No description
at line 128
static array
getOptions()
No description
at line 128
static PromiseInterface|null
getPromise()
No description
at line 128
static PromiseInterface
head(string $url, JsonSerializable|array|string|null $query = 'null')
No description
at line 128
static bool
isAllowedRequestUrl(string $url)
No description
at line 128
static PendingRequest
maxRedirects(int $max)
No description
at line 128
static array
mergeOptions(mixed ...$options)
No description
at line 128
static PromiseInterface
patch(string $url, JsonSerializable|array $data = '[]')
No description
at line 128
static PromiseInterface
post(string $url, JsonSerializable|array $data = '[]')
No description
at line 128
static PendingRequest
prependMiddleware(callable $middleware)
No description
at line 128
static HandlerStack
pushHandlers(HandlerStack $handlerStack)
No description
at line 128
static PromiseInterface
put(string $url, JsonSerializable|array $data = '[]')
No description
at line 128
static PromiseInterface
query(string $url, JsonSerializable|array $data = '[]')
No description
at line 128
static PendingRequest
replaceHeaders(array $headers)
No description
at line 128
static PendingRequest
retry(array|int $times, Closure|int $sleepMilliseconds = '0', null|callable $when = 'null', bool $throw = 'true')
No description
at line 128
static RequestInterface
runBeforeSendingCallbacks(RequestInterface $request, array $options)
No description
at line 128
static PromiseInterface
send(string $method, string $url, array $options = '[]')
No description
at line 128
static PendingRequest
setClient(ClientInterface $client)
No description
at line 128
static PendingRequest
setHandler(callable $handler)
No description
at line 128
static PendingRequest
sink(StreamInterface|string $to)
No description
at line 128
static PendingRequest
stub(Collection|callable $callback)
No description
at line 128
static PendingRequest
throw(null|callable $callback = 'null')
No description
at line 128
static PendingRequest
throwIf(callable|bool $condition, null|callable $callback = 'null')
No description
at line 128
static PendingRequest
throwUnless(callable|bool $condition, null|callable $callback = 'null')
No description
at line 128
static PendingRequest
timeout(int|float $seconds)
No description
at line 128
static PendingRequest
truncateExceptionsAt(int $length)
No description
at line 128
static mixed
unless(mixed $value = 'null', null|callable $callback = 'null', null|callable $default = 'null')
No description
at line 128
static mixed
when(mixed $value = 'null', null|callable $callback = 'null', null|callable $default = 'null')
No description
at line 128
static PendingRequest
withAttributes(array $attributes)
No description
at line 128
static PendingRequest
withBasicAuth(string $username, string $password)
No description
at line 128
static PendingRequest
withBody(Stringable $content, string|null $contentType = '\'application/json\'')
No description
at line 128
static PendingRequest
withCookie(SetCookie $cookie)
No description
at line 128
static PendingRequest
withCookies(array $cookies, string $domain)
No description
at line 128
static PendingRequest
withDigestAuth(string $username, string $password)
No description
at line 128
static PendingRequest
withHeader(string $name, mixed $value)
No description
at line 128
static PendingRequest
withHeaders(array $headers)
No description
at line 128
static PendingRequest
withMiddleware(callable $middleware)
No description
at line 128
static PendingRequest
withOptions(array $options)
No description
at line 128
static PendingRequest
withoutRedirecting()
No description
at line 128
static PendingRequest
withoutTelescope()
No description
at line 128
static PendingRequest
withoutVerifying()
No description
at line 128
static PendingRequest
withQueryParameters(array $parameters)
No description
at line 128
static PendingRequest
withRequestMiddleware(callable $middleware)
No description
at line 128
static PendingRequest
withResponseMiddleware(callable $middleware)
No description
at line 128
static PendingRequest
withTelescopeTags(array<int $, UnitEnum> $tags)
No description
at line 128
static PendingRequest
withToken(string $token, string $type = '\'Bearer\'')
No description
at line 128
static PendingRequest
withUrlParameters(array $parameters = '[]')
No description
at line 128
static PendingRequest
withUserAgent(string|bool $userAgent)
No description