当前位置: 首页>>代码示例>>PHP>>正文


PHP Inspector::type方法代码示例

本文整理汇总了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;
 }
开发者ID:unionofrad,项目名称:li3_docs,代码行数:27,代码来源:Extractor.php

示例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);
 }
开发者ID:fedeisas,项目名称:lithium,代码行数:13,代码来源:InspectorTest.php


注:本文中的lithium\analysis\Inspector::type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。