__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2019 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Cose\Algorithm;
use Assert\Assertion;
class Manager
{
/**
* @var Algorithm[]
*/
private $algorithms = [];
public function add(Algorithm $algorithm): void
{
$identifier = $algorithm::identifier();
$this->algorithms[$identifier] = $algorithm;
}
/**
* @deprecated Will be removed in v3.0. Please use all() instead
*/
public function getAlgorithms(): iterable
{
yield from $this->algorithms;
}
public function list(): iterable
{
yield from array_keys($this->algorithms);
}
/**
* @return Algorithm[]
*/
public function all(): iterable
{
yield from $this->algorithms;
}
public function has(int $identifier): bool
{
return \array_key_exists($identifier, $this->algorithms);
}
public function get(int $identifier): Algorithm
{
Assertion::true($this->has($identifier), 'Unsupported algorithm');
return $this->algorithms[$identifier];
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Mac | Folder | 0775 |
|
|
| Signature | Folder | 0775 |
|
|
| Algorithm.php | File | 331 B | 0664 |
|
| Manager.php | File | 1.23 KB | 0664 |
|
| ManagerFactory.php | File | 1.04 KB | 0664 |
|