mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-03 12:17:48 +08:00
Remove useless class and method
This commit is contained in:
parent
7fd41281e6
commit
1e69c1dc28
@ -20,14 +20,6 @@ class AspectCollector extends MetadataCollector
|
||||
*/
|
||||
protected static $container = [];
|
||||
|
||||
public static function setBefore(string $aspect, array $classes, array $annotations)
|
||||
{
|
||||
$before = static::get('before');
|
||||
$before['classes'][$aspect] = array_replace($before['classes'][$aspect] ?? [], $classes);
|
||||
$before['annotations'][$aspect] = array_replace($before['annotations'][$aspect] ?? [], $annotations);
|
||||
static::set('before', $before);
|
||||
}
|
||||
|
||||
public static function setArround(string $aspect, array $classes, array $annotations)
|
||||
{
|
||||
$arround = static::get('arround');
|
||||
|
@ -1,54 +0,0 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://hyperf.org
|
||||
* @document https://wiki.hyperf.org
|
||||
* @contact group@hyperf.org
|
||||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
namespace Hyperf\Di\Annotation;
|
||||
|
||||
class MetadataHolder implements MetadataHolderInterface
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $container = [];
|
||||
|
||||
/**
|
||||
* Retrieve the metadata via key.
|
||||
*/
|
||||
public function get(string $key, $default = null)
|
||||
{
|
||||
return $this->container[$key] ?? $default;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the metadata to holder.
|
||||
*/
|
||||
public function set(string $key, $value): void
|
||||
{
|
||||
$this->container[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the all metadata to a string.
|
||||
*/
|
||||
public function serialize(): string
|
||||
{
|
||||
return serialize($this->container);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserialize the serialized metadata and set the metadata to holder.
|
||||
*/
|
||||
public function deserialize(string $metadata): bool
|
||||
{
|
||||
$data = unserialize($metadata);
|
||||
$this->container = $data;
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://hyperf.org
|
||||
* @document https://wiki.hyperf.org
|
||||
* @contact group@hyperf.org
|
||||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
namespace Hyperf\Di\Annotation;
|
||||
|
||||
interface MetadataHolderInterface
|
||||
{
|
||||
/**
|
||||
* Retrieve the metadata via key.
|
||||
*/
|
||||
public function get(string $key, $default = null);
|
||||
|
||||
/**
|
||||
* Set the metadata to holder.
|
||||
*/
|
||||
public function set(string $key, $value): void;
|
||||
|
||||
/**
|
||||
* Serialize the all metadata to a string.
|
||||
*/
|
||||
public function serialize(): string;
|
||||
|
||||
/**
|
||||
* Deserialize the serialized metadata and set the metadata to holder.
|
||||
*/
|
||||
public function deserialize(string $metadata): bool;
|
||||
}
|
Loading…
Reference in New Issue
Block a user