CodeReflectionParameter.class.php

Go to the documentation of this file.
00001 <?php
00014 class CodeReflectionParameter extends ExtendedReflectionParameter
00015 {
00021         public function getCode()
00022         {
00023                 $strCode = "";
00024                 
00028 /*
00029         if( $this->getClass() != null )
00030                 {
00031                         $strCode .= $this->getClass()->getClassName() . " ";
00032                 }
00033 */
00034                 $strCode .= '$' . $this->getName();
00035 
00036                 if( $this->isOptional() )
00037                 {
00038                         $strCode .= " = " . var_export( $this->getDefaultValue() , 1 );
00039                 }
00040                 return $strCode;
00041         }
00042 
00043     protected function createExtendedReflectionClass( ReflectionClass $objOriginalReflectionClass )
00044         {
00045                 return new CodeReflectionClass( $objOriginalReflectionClass->getName() );
00046         }
00047 
00048         protected function createExtendedReflectionMethod( ReflectionMethod $objOriginalReflectionMethod )
00049         {
00050                 return new CodeReflectionMethod( $this->getName() , $objOriginalReflectionMethod->getName() );
00051         }
00052 
00053         protected function createExtendedReflectionFunction( ReflectionFunction $objOriginalReflectionFunction )
00054         {
00055                 if( $objOriginalReflectionFunction instanceof ReflectionMethod )
00056                 {
00057                         return new CodeReflectionMethod( $objOriginalReflectionFunction->getName() );
00058                 }
00059                 else
00060                 {
00061                         return new CodeReflectionFunction( $objOriginalReflectionFunction->getName() );
00062                 }
00063         }
00064 }
00065 
00066 ?>

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