コード例 #1
0
ファイル: Parameter.php プロジェクト: recca0120/cheatsheet
 protected function boot()
 {
     $default = null;
     $reference = false;
     $optional = false;
     $typeHint = null;
     try {
         $class = $this->reflection->getClass();
         if ($class) {
             $typeHint = Doc::factory('\\' . $class->getName(), true)->toArray();
         } elseif ($this->reflection->isArray() === true) {
             $typeHint = 'array';
         }
     } catch (ReflectionException $e) {
     }
     if ($this->reflection->isDefaultValueAvailable()) {
         $default = Helper::varExport($this->reflection->getDefaultValue());
     }
     if ($this->reflection->isPassedByReference()) {
         $reference = true;
     }
     if ($this->reflection->isOptional()) {
         $optional = true;
     }
     $this->attributes = ['name' => $this->reflection->getName(), 'position' => $this->reflection->getPosition(), 'typeHint' => $typeHint, 'default' => $default, 'reference' => $reference, 'optional' => $optional];
     return $this;
 }
コード例 #2
0
ファイル: cheatsheet.php プロジェクト: recca0120/cheatsheet
    ?>
" id="<?php 
    echo strtolower(str_replace('\\', '-', $namespace));
    ?>
">
                                <div class="page-header">
                                    <h2><?php 
    echo $namespace;
    ?>
</h2>
                                </div>
                                <?php 
    foreach ($items as $class) {
        ?>
                                    <?php 
        echo \Recca0120\Cheatsheet\Parser\Doc::factory($class)->render();
        ?>
                                <?php 
    }
    ?>
                            </div>
                            <?php 
    $i++;
    ?>
                        <?php 
}
?>
                    </div>
                </div>
            </div>
        </div>
コード例 #3
0
ファイル: Property.php プロジェクト: recca0120/cheatsheet
 protected function boot()
 {
     $name = $this->reflection->getName();
     $this->attributes = ['name' => $name, 'declare' => Doc::factory($this->reflection->getDeclaringClass(), true)->toArray(), 'comment' => $this->reflection->getDocComment(), 'modifiers' => implode(' ', Reflection::getModifierNames($this->reflection->getModifiers()))];
     return $this;
 }
コード例 #4
0
ファイル: Method.php プロジェクト: recca0120/cheatsheet
 protected function boot()
 {
     $this->attributes = ['name' => $this->reflection->getName(), 'declare' => Doc::factory($this->reflection->getDeclaringClass(), true)->toArray(), 'parameters' => $this->getParameters(), 'comment' => $this->reflection->getDocComment(), 'modifiers' => implode(' ', Reflection::getModifierNames($this->reflection->getModifiers())), 'file' => $this->reflection->getFileName(), 'line' => $this->reflection->getStartLine()];
     return $this;
 }