You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
511 B
19 lines
511 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace League\Flysystem;
|
|
|
|
final class PortableVisibilityGuard
|
|
{
|
|
public static function guardAgainstInvalidInput(string $visibility): void
|
|
{
|
|
if ($visibility !== Visibility::PUBLIC && $visibility !== Visibility::PRIVATE) {
|
|
$className = Visibility::class;
|
|
throw InvalidVisibilityProvided::withVisibility(
|
|
$visibility,
|
|
"either {$className}::PUBLIC or {$className}::PRIVATE"
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|