src/Rbac/DbManager.php
public function getRule($name)
    {
        if ($this->rules !== null) {
            return isset($this->rules[$name])
                ? resolve($this->rules[$name])
                : reject(new Error("Rule '$name' not found"));
        }

        return (new Query())->select(['data'])
            ->from($this->ruleTable)
            ->where(['name' => $name])
            ->one($this->db)
            ->then(
                function($row) use ($name) {
                    if (empty($row)) {
                        return reject(new Error("Rule '$name' not found"));
                    }
                    $data = $row['data'];
                    if (is_resource($data)) {
                        $data = stream_get_contents($data);
                    }

                    return unserialize($data);
                }
            );
    }
public function getRule($name)
    {
        if ($this->rules !== null) {
            return isset($this->rules[$name])
                ? resolve($this->rules[$name])
                : reject(new Error("Rule '$name' not found"));
        }

        return (new Query())->select(['data'])
            ->from($this->ruleTable)
            ->where(['name' => $name])
            ->one($this->db)
            ->then(
                function($row) use ($name) {
                    if (empty($row)) {
                        return reject(new Error("Rule '$name' not found"));
                    }
                    $data = $row['data'];
                    if (is_resource($data)) {
                        $data = stream_get_contents($data);
                    }

                    return unserialize($data);
                }
            );
    }
{@inheritdoc}