Codeception\Module\WPBootstrapper::nullClosures PHP Method

nullClosures() protected method

protected nullClosures ( $value, $level )
    protected function nullClosures($value, $level = 0)
    {
        if (empty($value)) {
            return $value;
        }
        if (is_array($value)) {
            if ($level >= 20) {
                return $value;
            }
            foreach ($value as $key => $subvalue) {
                $value[$key] = $this->nullClosures($subvalue, ++$level);
            }
        } else {
            $value = $this->isClosure($value) ? null : $value;
        }
        return $value;
    }