diff options
Diffstat (limited to 'src/decorators/Decorator.php')
-rw-r--r-- | src/decorators/Decorator.php | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/decorators/Decorator.php b/src/decorators/Decorator.php index 73e9324c..5609e5e9 100644 --- a/src/decorators/Decorator.php +++ b/src/decorators/Decorator.php @@ -6,25 +6,10 @@ namespace PHPPgAdmin\Decorators; -use PHPPgAdmin\ContainerUtils; - class Decorator { use \PHPPgAdmin\Traits\HelperTrait; - /** - * @var string - */ - const BASE_PATH = ContainerUtils::BASE_PATH; - /** - * @var string - */ - const SUBFOLDER = ContainerUtils::SUBFOLDER; - /** - * @var string - */ - const DEBUGMODE = ContainerUtils::DEBUGMODE; - public $container; public function __construct($value) @@ -44,7 +29,7 @@ class Decorator */ public static function get_sanitized_value(&$var, array &$fields, ?string $esc = null) { - if (\is_a($var, 'PHPPgAdmin\Decorators\Decorator')) { + if ($var instanceof self) { $val = $var->value($fields); } else { $val = &$var; @@ -71,12 +56,12 @@ class Decorator } /** - * @param \Closure|\Closure|\Closure $callback - * @param (mixed|string)[]|null $params + * @param \Closure $callback + * @param (mixed|string)[]|null $params */ - public static function callback($callback, ?array $params = null) + public static function callback(\Closure $callback, ?array $params = null) { - return new \PHPPgAdmin\Decorators\CallbackDecorator($callback, $params); + return new CallbackDecorator($callback, $params); } /** |