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


PHP ClassReflection::isInternal方法代码示例

本文整理汇总了PHP中Zend\Code\Reflection\ClassReflection::isInternal方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassReflection::isInternal方法的具体用法?PHP ClassReflection::isInternal怎么用?PHP ClassReflection::isInternal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\Code\Reflection\ClassReflection的用法示例。


在下文中一共展示了ClassReflection::isInternal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dumpClass

 /**
  * Returns class' code inside namespace
  *
  * @param ClassReflection $class
  */
 private function dumpClass(ClassReflection $class)
 {
     if (array_search($class->getName(), $this->cachedClasses) !== false) {
         return;
     }
     if ($class->isInternal()) {
         return;
     }
     if ($class->getParentClass()) {
         $this->dumpClass($class->getParentClass());
     }
     foreach ($class->getInterfaces() as $interface) {
         $this->dumpClass($interface);
     }
     if ($class->getTraits()) {
         foreach ($class->getTraits() as $trait) {
             $this->dumpClass($trait);
         }
     }
     $classContents = $class->getContents(false);
     $classFileDir = dirname($class->getFileName());
     $classContents = trim(str_replace('__DIR__', sprintf("'%s'", $classFileDir), $classContents));
     $uses = implode("\n", $this->codeGenerator->getUseLines($class));
     $this->cache[] = "namespace " . $class->getNamespaceName() . " {\n" . ($uses ? $uses . "\n" : '') . $this->codeGenerator->getDeclarationLine($class) . "\n" . $classContents . "\n}\n";
     $this->cachedClasses[] = $class->getName();
 }
开发者ID:mtymek,项目名称:class-dumper,代码行数:31,代码来源:ClassDumper.php

示例2: shouldSkip

 private function shouldSkip(ClassReflection $class)
 {
     if ($class->isInternal()) {
         return true;
     }
     foreach ($this->skip as $prefix) {
         if (strpos($class->getName(), $prefix) === 0) {
             return true;
         }
     }
     return false;
 }
开发者ID:mtymek,项目名称:class-dumper,代码行数:12,代码来源:ConfigGenerator.php

示例3: cache

 /**
  * Cache declared interfaces and classes to a single file
  *
  * @param  \Zend\Mvc\MvcEvent $e
  * @return void
  */
 public function cache($e)
 {
     $request = $e->getRequest();
     if ($request instanceof ConsoleRequest || $request->getQuery()->get('EDPSUPERLUMINAL_CACHE', null) === null) {
         return;
     }
     if (file_exists(ZF_CLASS_CACHE)) {
         $this->reflectClassCache();
         $code = file_get_contents(ZF_CLASS_CACHE);
     } else {
         $code = "<?php\n";
     }
     $classes = array_merge(get_declared_interfaces(), get_declared_classes());
     foreach ($classes as $class) {
         // Skip non-Zend classes
         if (0 !== strpos($class, 'Zend')) {
             continue;
         }
         // Skip the autoloader factory and this class
         if (in_array($class, array('Zend\\Loader\\AutoloaderFactory', __CLASS__))) {
             continue;
         }
         if ($class === 'Zend\\Loader\\SplAutoloader') {
             continue;
         }
         // Skip any classes we already know about
         if (in_array($class, $this->knownClasses)) {
             continue;
         }
         $this->knownClasses[] = $class;
         $class = new ClassReflection($class);
         // Skip any Annotation classes
         $docBlock = $class->getDocBlock();
         if ($docBlock) {
             if ($docBlock->getTags('Annotation')) {
                 continue;
             }
         }
         // Skip ZF2-based autoloaders
         if (in_array('Zend\\Loader\\SplAutoloader', $class->getInterfaceNames())) {
             continue;
         }
         // Skip internal classes or classes from extensions
         // (this shouldn't happen, as we're only caching Zend classes)
         if ($class->isInternal() || $class->getExtensionName()) {
             continue;
         }
         $code .= static::getCacheCode($class);
     }
     file_put_contents(ZF_CLASS_CACHE, $code);
     // minify the file
     file_put_contents(ZF_CLASS_CACHE, php_strip_whitespace(ZF_CLASS_CACHE));
 }
开发者ID:proprietes-privees,项目名称:edp-superluminal,代码行数:59,代码来源:Module.php

示例4: processClassIntoCacheFile

 /**
  * Makes several checks.
  *
  * 1. Exclude blacklisted namespaces
  * 2. Exclude blacklisted classes
  * 3. Skip Internal classes
  *
  * @param Reflection\ClassReflection $class
  */
 protected function processClassIntoCacheFile(Reflection\ClassReflection $class)
 {
     if ($this->classList[$class->getName()] === true) {
         return;
     }
     if ($class->isInternal() === true) {
         return;
     }
     // Make the string regex compactible
     $excludeNamespaces = array_map(function ($namespace) {
         return str_replace('\\', '[\\\\]', $namespace);
     }, $this->getConfig()->getIgnoreNamespaces());
     // Make the regex
     $excludeNamespaceRegex = '/^(' . implode('|', $excludeNamespaces) . ')(.*)/';
     if (preg_match($excludeNamespaceRegex, $class->getName())) {
         return;
     }
     $this->classList[$class->getName()] = true;
     $this->buildNamespace($class);
 }
开发者ID:jdolieslager,项目名称:celeritas,代码行数:29,代码来源:Cacher.php

示例5: isSatisfiedBy

 /**
  * @param ClassReflection $class
  * @return bool
  */
 public function isSatisfiedBy(ClassReflection $class)
 {
     // Skip internal classes or classes from extensions
     // (this shouldn't happen, as we're only caching Zend classes)
     return $class->isInternal() || $class->getExtensionName();
 }
开发者ID:simon-barton,项目名称:EdpSuperluminal,代码行数:10,代码来源:IsCoreClass.php


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