改名
This commit is contained in:
@@ -81,7 +81,7 @@ class BaseObject implements Configure
|
||||
$this->{$method}($value);
|
||||
} else {
|
||||
$this->error('set ' . $name . ' not exists ' . get_called_class());
|
||||
throw new Exception('The set name ' . $name . ' not find in class ' . get_class($this));
|
||||
throw new Exception('The set name ' . $name . ' not find in class ' . static::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class BaseObject implements Configure
|
||||
if (method_exists($this, $method)) {
|
||||
return $this->$method();
|
||||
} else {
|
||||
throw new Exception('The get name ' . $name . ' not find in class ' . get_class($this));
|
||||
throw new Exception('The get name ' . $name . ' not find in class ' . static::class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ class Aop extends Component
|
||||
public function aop_add(array $handler, string $aspect)
|
||||
{
|
||||
[$class, $method] = $handler;
|
||||
$alias = get_class($class) . '::' . $method;
|
||||
$alias = $class::class . '::' . $method;
|
||||
if (!isset($this->_aop[$alias])) {
|
||||
$this->_aop[$alias] = [];
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class Aop extends Component
|
||||
if ($handler instanceof \Closure) {
|
||||
return call_user_func($handler, ...$params);
|
||||
}
|
||||
$aopName = get_class($handler[0]) . '::' . $handler[1];
|
||||
$aopName = $handler[0]::class . '::' . $handler[1];
|
||||
if (!isset($this->_aop[$aopName])) {
|
||||
return $this->notFound($handler, $params);
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ class Container extends BaseObject
|
||||
if (is_array($class) && isset($class['class'])) {
|
||||
$class = $class['class'];
|
||||
} else if (is_object($class)) {
|
||||
$class = get_class($class);
|
||||
$class = $class::class;
|
||||
}
|
||||
unset(
|
||||
$this->_reflection[$class], $this->_singletons[$class],
|
||||
|
||||
@@ -140,7 +140,7 @@ class Service extends Component
|
||||
public function remove($id): bool
|
||||
{
|
||||
$component = $this->_components[$id];
|
||||
$className = get_class($component);
|
||||
$className = $component::class;
|
||||
|
||||
unset($component, $this->_components[$id]);
|
||||
unset($this->_definition[$id]);
|
||||
|
||||
@@ -45,7 +45,7 @@ class LoggerAspect implements IAspect
|
||||
|
||||
private function print_runtime($startTime)
|
||||
{
|
||||
$className = get_class($this->handler[0]);
|
||||
$className = $this->handler[0]::class;
|
||||
$methodName = $this->handler[1];
|
||||
|
||||
$runTime = round(microtime(true) - $startTime, 6);
|
||||
|
||||
Reference in New Issue
Block a user