# -*- mode: snippet -*-
# name: Var doc for php view files
# key: var-doc
# --
echo '<pre>';
echo '/**'.PHP_EOL;
echo ' *'.PHP_EOL;
$_type = gettype($this) == 'object' ? get_class($this) : gettype($this);
echo " * @var $_type \\$this\n";
foreach(get_defined_vars() as $name => $var) {
    if (substr($name, 0, strlen('_')) !== '_' && $name !== 'this') {
        if (is_array($var) && isset($var[0]) && gettype($var[0]) == 'object') {
            $type = get_class($var[0]);
            echo " * @var {$type}[] \\$$name\n";
            continue;
        }
        $type = gettype($var) == 'object' ? get_class($var) : gettype($var);
        echo " * @var $type \\$$name\n";
    }
}
echo ' */'.PHP_EOL;
echo "</pre>";
die;
