Beispiel #1
0
 /**
  * @param string|null $parentClassName
  * @param array       $interfaces
  * @param array       $traits
  * @return ClassWrapper
  */
 protected function _loadClassWrapper($parentClassName, array $interfaces, array $traits)
 {
     $hash = $this->_getHash($parentClassName, $interfaces, $traits);
     if (!array_key_exists($hash, $this->_wrappers)) {
         $classWrapper = new ClassWrapper($parentClassName, $interfaces, $traits);
         $this->_wrappers[$hash] = $classWrapper;
         $classWrapper->load();
     }
     return $this->_wrappers[$hash];
 }
Beispiel #2
0
 public function testGetClass()
 {
     $class = $this->object->getClass();
     $this->assertNotNull($class);
     $this->assertEquals('blaze\\lang\\Object', $class->getName()->toNative());
     $this->assertEquals('blaze\\lang\\Object', ClassWrapper::forName('blaze\\lang\\Object')->getName()->toNative());
 }
Beispiel #3
0
 public function findLoadedClass($className)
 {
     $className = trim((string) $className, '\\');
     if (!$this->isLoadedClass($className)) {
         return null;
     } else {
         if (!$this->isInitializedClass($className)) {
             $this->classes[$className] = ClassWrapper::forName($className, true, $this);
         }
     }
     return $this->classes[$className];
 }
Beispiel #4
0
 /**
  * Returns the runtime class of the object.
  * 
  * @return 	blaze\lang\ClassWrapper Returns a ClassWrapper which represents the class of the object.
  */
 public function getClass()
 {
     return ClassWrapper::forName(get_class($this));
 }