Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CallbackDecorator.php « Decorators « src - github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1f1e93b1159c3fb2fa5607924d3db35e72870866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

/**
 * PHPPgAdmin6
 */

namespace PHPPgAdmin\Decorators;

use Closure;

class CallbackDecorator extends Decorator
{
    /**
     * @var \Closure|mixed
     */
    public $fn;

    public $p;

    public function __construct(Closure $callback, $param = null)
    {
        $this->fn = $callback;
        $this->p = $param;
    }

    public function value($fields)
    {
        return \call_user_func($this->fn, $fields, $this->p);
    }
}