Evaluate an object type for description
@param  array $variable
@return string
327185
protected function evalObjDesc($variable)
    {
        $output = [];
        if ($variable instanceof ComponentBase) {
            $details = $variable->componentDetails();
            $output[] = '<abbr title="'.array_get($details, 'description').'">';
            $output[] = array_get($details, 'name');
            $output[] = '</abbr>';
        }

        return implode('', $output);
    }
66891
public function parse(&$var, BasicObject $o)
    {
        $o->type = \strtolower(\gettype($var));

        if (!$this->applyPlugins($var, $o, self::TRIGGER_BEGIN)) {
            return $o;
        }

        switch ($o->type) {
            case 'array':
                return $this->parseArray($var, $o);
            case 'boolean':
            case 'double':
            case 'integer':
            case 'null':
                return $this->parseGeneric($var, $o);
            case 'object':
                return $this->parseObject($var, $o);
            case 'resource':
                return $this->parseResource($var, $o);
            case 'string':
                return $this->parseString($var, $o);
            default:
                return $this->parseUnknown($var, $o);
        }
    }
791649
public function inspect($variable = null, $next = null)
    {
        //argument 2 must be a string or null
        Argument::i()->test(2, 'string', 'null');

        //we are using tool in all cases
        $class = get_class($this);

        //if variable is null
        if (is_null($variable)) {
            //output the class
            Inspect::i()
                ->output(sprintf(Inspect::INSPECT, $class))
                ->output($this);

            return $this;
        }

        //if variable is true
        if ($variable === true) {
            //return whatever the next response is
            //or return the next specified variable
            return Inspect::i()->next($this, $next);
        }

        //if variable is not a string
        if (!is_string($variable)) {
            //output variable
            Inspect::i()
                ->output(sprintf(Inspect::INSPECT, 'Variable'))
                ->output($variable);

            return $this;
        }

        //if variable is set
        if (isset($this->$variable)) {
            //output it
            Inspect::i()
                ->output(sprintf(Inspect::INSPECT, $class.'->'.$variable))
                ->output($this->$variable);

            return $this;
        }

        //any other case output variable
        Inspect::i()
            ->output(sprintf(Inspect::INSPECT, 'Variable'))
            ->output($variable);

        return $this;
    }
120223
static function typecastVariable($variable, string $type) {
        if($variable === null) {
            return null;
        }
        
        switch($type) {
            case 'array':
                $variable = (array) $variable;
            break;
            case 'bool':
                $variable = (bool) $variable;
            break;
            case 'float':
                $variable = (float) $variable;
            break;
            case 'int':
                $variable = (int) $variable;
            break;
            case 'string':
                $variable = (string) $variable;
            break;
            default:
                throw new \InvalidArgumentException('Unsupported type "'.$type.'"');
            break;
        }
        
        return $variable;
    }
1031784
public function values($variable)
    {
        foreach ($this->keywordList('VALUES') as $keyword) {
            if ($keyword->subKeys[0] == $variable) {
                return $keyword->values;
            }
        }
        throw new RuntimeException(sprintf('Could not determine values of "%s".', $variable));
    }
1252305
function getType(variable) {
        var types = {
            'undefined': 'undefined',
            'number': 'number',
            'boolean': 'boolean',
            'string': 'string',
            '[object Function]': 'function',
            '[object RegExp]': 'regexp',
            '[object Array]': 'array',
            '[object Date]': 'date',
            '[object Error]': 'error'
        };

        return types[typeof variable === 'undefined' ? 'undefined' : _typeof(variable)] || types[{}.toString.call(variable)] || (variable ? 'object' : 'null');
    }
524103
public function dump_it($var) {
		$adapter = '\alkemann\hl\debug\util\adapters\\'. $this->options['mode'];
        if (is_array($var))
            return $adapter::dump_array($var, $this);
        elseif (is_object($var))
            return $adapter::dump_object($var, $this);
        else
            return $adapter::dump_other($var);
    }
12309
public static function getVariableValues(Variable $variable) {

        $returnValue = array();

        $baseType = $variable->getBaseType();
        $cardinalityType = $variable->getCardinality();
        $value = $variable->getValue();
        
        // This only works if the variable has a value ;)
        if ($value !== null) {
            
            if ($baseType === BaseType::IDENTIFIER) {
            
                if ($cardinalityType === Cardinality::SINGLE) {
            
                    $returnValue[] = $value->getValue();
                }
                else if($cardinalityType === Cardinality::MULTIPLE) {
            
                    foreach($variable->getValue() as $value) {
            
                        $returnValue[] = $value->getValue();
                    }
                }
            }
        }

        return $returnValue;
    }
1079163
private function boolToString($var)
    {
        $copy = is_array($var) ? $var : [$var];

        foreach ($copy as $key => $value) {
            if (is_bool($value)) {
                $copy[$key] = $value ? '1' : '0';
            }
        }

        return is_array($var) ? $copy : $copy[0];
    }
266656
public function header(array $var = null)
    {
        $content = $this->content();

        if ($var !== null) {
            $content['header'] = $var;
            $this->content($content);
        }

        return $content['header'];
    }
235627
public function evaluateArithmOperation($variable = array())
    {
        
        $operation = new core_kernel_rules_Operation($this->getUri(), __METHOD__);
    	return  $operation->evaluate($variable);
        
    }
115260
protected function _getType($value)
    {
        if (is_object($value)) {
            try {
                return self::getShortClassname($value);
            } catch (\InvalidArgumentException $e) {
                return null;
            }
        }

        if (is_array($value)) {
            return 'array';
        }

        return 'scalar';
    }
1212002
public function match($var)
    {
        $ret = false;

        foreach ($this->_types as $type) {
            if (array_search($type, array("*", "mixed")) !== false) {
                $ret = true;
            } elseif (array_search($type, array("number", "numeric")) !== false) {
                $ret = is_numeric($var);
            } elseif (array_search($type, array("bool", "boolean")) !== false) {
                $ret = is_bool($var);
            } elseif ($type == "string") {
                $ret = is_string($var);
            } elseif ($type == "array") {
                $ret = is_array($var);
            } elseif ($type == "object") {
                $ret = is_object($var);
            } elseif ($type == "resource") {
                $ret = is_resource($var);
            } elseif ($type == "function") {
                $ret = is_callable($var);
            } elseif ($type == "scalar") {
                $ret = is_scalar($var);
            } else {
                $ret = is_a($var, $type);
            }

            if ($ret) {
                break;
            }
        }

        return $ret;
    }
1348054
protected function getValueTypeDescription($value): string
    {
        if (is_resource($value)) {
            $valueType = get_resource_type($value) . " resource";
        } elseif (is_object($value)) {
            $valueType = get_class($value) . " object";
        } elseif (is_string($value)) {
            $valueType = "string \"{$value}\"";
        } else {
            $valueType = gettype($value);
        }

        return $valueType;
    }
995901
public static function listVarTypes(array $data)
    {
        $vars = [];

        foreach ($data as $key => $value) {
            if (is_object($value)) {
                $type = '\\' . get_class($value);
            } else {
                $type = gettype($value);
            }

            $vars[] = sprintf(' * @var  $%s  %s', $key, $type);
        }

        return static::renderDocblock(implode("\n", $vars));
    }
597993
public function inspect($variable = null, string $next = null)
    {
        //we are using tool in all cases
        $class = get_class($this);

        $inspector = $this->getInspectorHandler();

        //if variable is null
        if (is_null($variable)) {
            //output the class
            $inspector
                ->output(sprintf(InspectorHandler::INSPECT, $class))
                ->output($this);

            return $this;
        }

        //if variable is true
        if ($variable === true) {
            //return whatever the next response is
            //or return the next specified variable
            return $inspector->next($this, $next);
        }

        //if variable is not a string
        if (!is_string($variable)) {
            //output variable
            $inspector
                ->output(sprintf(InspectorHandler::INSPECT, 'Variable'))
                ->output($variable);

            return $this;
        }

        //if variable is set
        if (isset($this->$variable)) {
            //output it
            $inspector
                ->output(sprintf(InspectorHandler::INSPECT, $class.'->'.$variable))
                ->output($this->$variable);

            return $this;
        }

        //any other case output variable
        $inspector
            ->output(sprintf(InspectorHandler::INSPECT, 'Variable'))
            ->output($variable);

        return $this;
    }
109259
protected function getDataCss($variable)
    {
        $css = [
            'padding'               => '7px',
            'background-color'      => $this->zebra ? '#D8D9DB' : '#FFF',
            'color'                 => '#405261',
        ];

        $type = gettype($variable);
        if ($type == 'NULL') {
            $css['color'] = '#999';
        }

        return $this->arrayToCss($css);
    }