本文整理汇总了PHP中lithium\analysis\Inspector::type方法的典型用法代码示例。如果您正苦于以下问题:PHP Inspector::type方法的具体用法?PHP Inspector::type怎么用?PHP Inspector::type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lithium\analysis\Inspector
的用法示例。
在下文中一共展示了Inspector::type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
public static function get($library, $identifier, array $options = array())
{
static::_ensureIndexedLibrary($library);
$defaults = array('namespaceDoc' => array(), 'language' => 'en');
$options += $defaults;
$options['namespaceDoc'] = (array) $options['namespaceDoc'];
$config = Libraries::get('li3_docs');
if (isset($config['namespaceDoc'])) {
$options['namespaceDoc'] = array_merge($options['namespaceDoc'], (array) $config['namespaceDoc']);
}
$path = Libraries::path($identifier);
static::_ensurePathInBase($path);
if (file_exists($path) && !static::_isClassFile($path)) {
return static::_file(compact('library', 'path', 'identifier'), $options);
}
$data = Inspector::info($identifier);
$proto = compact('identifier', 'library') + array('name' => null, 'type' => Inspector::type($identifier), 'info' => array(), 'classes' => null, 'methods' => null, 'properties' => null, 'parent' => null, 'children' => null, 'source' => null, 'subClasses' => array(), 'description' => isset($data['description']) ? $data['description'] : null, 'text' => isset($data['text']) ? $data['text'] : null);
$format = "_{$proto['type']}";
$data = static::$format($proto, (array) $data, $options);
if (!$data) {
return false;
}
foreach (array('text', 'description') as $key) {
$data[$key] = Code::embed($data[$key], compact('library'));
}
return $data;
}
示例2: testCaseSensitiveIdentifiers
/**
* Tests that class and namepace names which are equivalent in a case-insensitive search still
* match properly.
*/
public function testCaseSensitiveIdentifiers()
{
$result = Inspector::type('lithium\\storage\\Cache');
$expected = 'class';
$this->assertEqual($expected, $result);
$result = Inspector::type('lithium\\storage\\cache');
$expected = 'namespace';
$this->assertEqual($expected, $result);
}