Remove useless class and method

This commit is contained in:
huangzhhui 2018-12-31 00:13:13 +08:00
parent 7fd41281e6
commit 1e69c1dc28
3 changed files with 0 additions and 97 deletions

View File

@ -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');

View File

@ -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;
}
}

View File

@ -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;
}