lithium\console\command\Help::api PHP Метод

api() публичный Метод

Gets the API for the class.
public api ( string $class = null, string $type = null, string $name = null ) : array
$class string fully namespaced class in dot notation.
$type string method|property
$name string the name of the method or property.
Результат array
    public function api($class = null, $type = null, $name = null)
    {
        $class = str_replace(".", "\\", $class);
        switch ($type) {
            default:
                $info = Inspector::info($class);
                $result = array('class' => array('name' => $info['shortName'], 'description' => trim($info['description'] . PHP_EOL . PHP_EOL . $info['text'])));
                break;
            case 'method':
                $result = $this->_methods($class, compact('name'));
                break;
            case 'property':
                $result = $this->_properties($class, compact('name'));
                break;
        }
        $this->_render($result);
    }

Usage Example

Пример #1
0
 public function testApiProperties()
 {
     $help = new Help(array('request' => $this->request, 'classes' => $this->classes));
     $expected = null;
     $result = $help->api('lithium.tests.mocks.console.command.MockCommandHelp', 'property');
     $this->assertEqual($expected, $result);
     $expected = "\\-\\-long=<string>.*\\-\\-blong.*\\-s";
     $result = $help->response->output;
     $this->assertPattern("/{$expected}/s", $result);
 }
All Usage Examples Of lithium\console\command\Help::api