Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Annotation
  • AnnotationsParser
  • ClassType
  • Extension
  • GlobalFunction
  • Helpers
  • Method
  • Parameter
  • Property

Interfaces

  • IAnnotation
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Reflection;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * @author Jáchym Toušek
15:  */
16: class Helpers
17: {
18: 
19:     /**
20:      * Returns declaring class or trait.
21:      * @return \ReflectionClass
22:      * @internal
23:      */
24:     public static function getDeclaringClass(\ReflectionProperty $prop)
25:     {
26:         if (PHP_VERSION_ID >= 50400) {
27:             foreach ($prop->getDeclaringClass()->getTraits() as $trait) {
28:                 if ($trait->hasProperty($prop->getName())) {
29:                     return self::getDeclaringClass($trait->getProperty($prop->getName()));
30:                 }
31:             }
32:         }
33:         return $prop->getDeclaringClass();
34:     }
35: 
36: }
37: 
Nette 2.3.1 API API documentation generated by ApiGen 2.8.0