CodeReflectionProperty.class.php

Go to the documentation of this file.
00001 <?php
00013 class CodeReflectionProperty extends ExtendedReflectionProperty
00014 {
00029     public function getDefaultValue()
00030     {
00031         /*
00032         try
00033         {
00034             $objParent = $this->getDeclaringClass();
00035             $strClassName = $objParent->getClassName();
00036             $objTemp = new $strClassName();
00037             $arrTemp = (array)$objTemp;
00038             $arrNew = array();
00039             foreach( $arrTemp as $strKeyTemp => $mixValue )
00040             {
00041                 $strNewKey = substr( $strKeyTemp , 3 );
00042                 $arrNew[ $strNewKey ] = $mixValue;
00043             }
00044             return $arrNew[ $this->getName() ];
00045         }catch( Exception $objException )
00046         {
00047             // error on init object //
00048             return null;
00049         }
00050          * *
00051          */
00052         return null;
00053     }
00054         public function getCode()
00055         {
00056 
00057         $strCode = "";
00058                 $strCode .= CorujaStringManipulation::retab( $this->getDocComment() , 1 );
00059                 if( $this->isPrivate() )
00060                 {
00061                         $strCode .= " private ";
00062                 }
00063                 if( $this->isProtected())
00064                 {
00065                         $strCode .= " protected ";
00066                 }
00067                 if( $this->isPublic())
00068                 {
00069                         $strCode .= " public ";
00070                 }
00071                 if( $this->isStatic() )
00072                 {
00073                         $strCode .= " static ";
00074                 }
00075                 $strCode .= '$'. $this->getName();
00076 
00077         $strCode .= ' = ' . var_export( $this->getDefaultValue() , true );
00078                 $strCode .= ";" . "\n";
00079 
00080                 return $strCode;
00081         }
00082 
00083         protected function createExtendedReflectionClass( ReflectionClass $objOriginalReflectionClass )
00084         {
00085                 return new CodeReflectionClass( $objOriginalReflectionClass->getName() );
00086         }
00087 
00088 }
00089 ?>

Generated on Thu Feb 3 03:54:59 2011 for CodeToDiagram by  doxygen 1.5.9