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
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

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

Interfaces

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