Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Calculate the md5 hash of a string
<?php md5(string $string, bool $binary = false): string
<?php }
return ! $this->container->make(RateLimiter::class)->attempt(
with($throttle->key ?: 'illuminate:foundation:exceptions:'.$e::class, fn ($key) => $this->hashThrottleKeys ? md5($key) : $key),
$throttle->maxAttempts,
fn () => true,
$throttle->decaySeconds
<?php }
if (isset($options['etag']) && $options['etag'] === true) {
$options['etag'] = $response->getEtag() ?? md5($response->getContent());
}
if (isset($options['last_modified'])) {
<?php $next,
collect(Arr::wrap($limiterResponse))->map(function ($limit) {
return (object) [
'key' => md5($this->limiterName.$limit->key),
'maxAttempts' => $limit->maxAttempts,
'decaySeconds' => $limit->decaySeconds,
];
<?php return $this->prefix.$job->job->uuid();
}
return $this->prefix.md5(get_class($job));
}
<?php $next,
collect(Arr::wrap($limiterResponse))->map(function ($limit) use ($limiterName) {
return (object) [
'key' => self::$shouldHashKeys ? md5($limiterName.$limit->key) : $limiterName.':'.$limit->key,
'maxAttempts' => $limit->maxAttempts,
'decaySeconds' => $limit->decaySeconds,
'responseCallback' => $limit->responseCallback,
<?php $callable instanceof Closure ? (new ReflectionClosure($callable))->getClosureUsedVariables() : [],
);
return md5(sprintf(
'%s@%s%s:%s (%s)',
$trace[0]['file'],
isset($trace[1]['class']) ? ($trace[1]['class'].'@') : '',
$trace[1]['function'],
$trace[0]['line'],
serialize($uses),
));
}
}
<?php public function anonymousComponentPath(string $path, ?string $prefix = null)
{
$prefixHash = md5($prefix ?: $path);
$this->anonymousComponentPaths[] = [
'path' => $path,
<?php $this->mockedJobData = [
'Body' => $this->mockedPayload,
'MD5OfBody' => md5($this->mockedPayload),
'ReceiptHandle' => $this->mockedReceiptHandle,
'MessageId' => $this->mockedMessageId,
'Attributes' => ['ApproximateReceiveCount' => 1],
<?php $this->mockedSendMessageResponseModel = new Result([
'Body' => $this->mockedPayload,
'MD5OfBody' => md5($this->mockedPayload),
'ReceiptHandle' => $this->mockedReceiptHandle,
'MessageId' => $this->mockedMessageId,
'Attributes' => ['ApproximateReceiveCount' => 1],
<?php 'Messages' => [
0 => [
'Body' => $this->mockedPayload,
'MD5OfBody' => md5($this->mockedPayload),
'ReceiptHandle' => $this->mockedReceiptHandle,
'MessageId' => $this->mockedMessageId,
],
<?php $app->shouldReceive('getNamespace')->once()->andReturn('App\\');
$factory->shouldReceive('exists')->andReturnUsing(function ($arg) {
return $arg === md5('test-directory').'::panel.index';
});
Container::setInstance($container);
<?php $blade = m::mock(BladeCompiler::class)->makePartial();
$blade->shouldReceive('getAnonymousComponentPaths')->once()->andReturn([
['path' => 'test-directory', 'prefix' => null, 'prefixHash' => md5('test-directory')],
]);
$compiler = $this->compiler([], [], $blade);
<?php $result = $compiler->compileTags('<x-panel />');
$this->assertSame("##BEGIN-COMPONENT-CLASS##@component('Illuminate\View\AnonymousComponent', 'panel', ['view' => '".md5('test-directory')."::panel.index','data' => []])
<?php if (isset(\$attributes) && \$attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php \$attributes = \$attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $app->shouldReceive('getNamespace')->once()->andReturn('App\\');
$factory->shouldReceive('exists')->andReturnUsing(function ($arg) {
return $arg === md5('test-directory').'::panel';
});
Container::setInstance($container);
<?php $blade = m::mock(BladeCompiler::class)->makePartial();
$blade->shouldReceive('getAnonymousComponentPaths')->once()->andReturn([
['path' => 'test-directory', 'prefix' => null, 'prefixHash' => md5('test-directory')],
]);
$compiler = $this->compiler([], [], $blade);