This commit is contained in:
2021-04-25 11:22:23 +08:00
parent 5e2c46a3aa
commit 77a6445eea
13 changed files with 16 additions and 16 deletions
+2 -2
View File
@@ -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
View File
@@ -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);
}
+1 -1
View File
@@ -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],
+1 -1
View File
@@ -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]);
+1 -1
View File
@@ -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);