glastree_on_gitea

This commit is contained in:
2026-05-26 08:14:29 +02:00
commit 0bed099d05
9556 changed files with 1186307 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Laravel\AgentDetector;
class AgentResult
{
public readonly bool $isAgent;
public function __construct(public readonly ?string $name = null)
{
$this->isAgent = $name !== null;
}
public static function forAgent(KnownAgent|string $name): self
{
return new self($name instanceof KnownAgent ? $name->value : $name);
}
public static function noAgent(): self
{
return new self();
}
public function knownAgent(): ?KnownAgent
{
return KnownAgent::tryFrom($this->name ?? '');
}
}