Esempio n. 1
0
 /**
  * Take a pass over all classes verifying various
  * states.
  *
  * @return null
  */
 public static function analyzeClasses(CodeBase $code_base)
 {
     $class_count = count($code_base->getClassMap());
     // Take a pass to import all details from ancestors
     $i = 0;
     foreach ($code_base->getClassMap() as $fqsen => $class) {
         CLI::progress('classes', ++$i / $class_count);
         if ($class->isInternal()) {
             continue;
         }
         // Make sure the parent classes exist
         ParentClassExistsAnalyzer::analyzeParentClassExists($code_base, $class);
         DuplicateClassAnalyzer::analyzeDuplicateClass($code_base, $class);
         ParentConstructorCalledAnalyzer::analyzeParentConstructorCalled($code_base, $class);
         PropertyTypesAnalyzer::analyzePropertyTypes($code_base, $class);
     }
 }
Esempio n. 2
0
 /**
  * Take a pass over all classes verifying various
  * states.
  *
  * @return null
  */
 public static function analyzeClasses(CodeBase $code_base)
 {
     $class_count = 2 * count($code_base->getClassMap());
     // Take a pass to import all details from ancestors
     $i = 0;
     foreach ($code_base->getClassMap() as $fqsen_string => $clazz) {
         CLI::progress('classes', ++$i / $class_count);
         // Make sure the parent classes exist
         ParentClassExistsAnalyzer::analyzeParentClassExists($code_base, $clazz);
         // Then import them
         $clazz->importAncestorClasses($code_base);
         // Then figure out which methods are overrides of
         // ancestor methods
         $clazz->analyzeMethodOverrides($code_base);
     }
     // Run a few checks on all of the classes
     foreach ($code_base->getClassMap() as $fqsen_string => $clazz) {
         CLI::progress('classes', ++$i / $class_count);
         if ($clazz->isInternal()) {
             continue;
         }
         DuplicateClassAnalyzer::analyzeDuplicateClass($code_base, $clazz);
         ParentConstructorCalledAnalyzer::analyzeParentConstructorCalled($code_base, $clazz);
         PropertyTypesAnalyzer::analyzePropertyTypes($code_base, $clazz);
     }
 }
Esempio n. 3
0
File: Clazz.php Progetto: etsy/phan
 /**
  * This method should be called after hydration
  *
  * @return void
  */
 public final function analyze(CodeBase $code_base)
 {
     if ($this->isInternal()) {
         return;
     }
     // Make sure the parent classes exist
     ParentClassExistsAnalyzer::analyzeParentClassExists($code_base, $this);
     DuplicateClassAnalyzer::analyzeDuplicateClass($code_base, $this);
     ParentConstructorCalledAnalyzer::analyzeParentConstructorCalled($code_base, $this);
     PropertyTypesAnalyzer::analyzePropertyTypes($code_base, $this);
     // Analyze this class to make sure that we don't have conflicting
     // types between similar inherited methods.
     CompositionAnalyzer::analyzeComposition($code_base, $this);
     // Let any configured plugins analyze the class
     ConfigPluginSet::instance()->analyzeClass($code_base, $this);
 }
Esempio n. 4
0
File: Clazz.php Progetto: tpunt/phan
 /**
  * This method should be called after hydration
  *
  * @return void
  */
 protected function analyzeOnce(CodeBase $code_base)
 {
     if ($this->isInternal()) {
         return;
     }
     // Analyze this class to make sure that
     CompositionAnalyzer::analyzeComposition($code_base, $this);
     // Make sure the parent classes exist
     ParentClassExistsAnalyzer::analyzeParentClassExists($code_base, $this);
     DuplicateClassAnalyzer::analyzeDuplicateClass($code_base, $this);
     ParentConstructorCalledAnalyzer::analyzeParentConstructorCalled($code_base, $this);
     PropertyTypesAnalyzer::analyzePropertyTypes($code_base, $this);
     // Let any configured plugins analyze the class
     ConfigPluginSet::instance()->analyzeClass($code_base, $this);
 }