예제 #1
0
 /**
  * Builds a new PhpLibraryList object
  * 
  * @param string $filename the filename of the underlying library
  * @param string[] $list the list of classfilenames or functionfilenames that are
  * 		specific to that library
  * @throws PhpLibraryCheckerException if the version numbers cannot be parsed.
  */
 public function __construct($filename, array $list = array())
 {
     parent::__construct();
     $this->_filename = $filename;
     // normal dispatching
     if (isset($list['name'])) {
         $this->setName($list['name']);
     } else {
         $this->setName($this->_filename);
     }
     if (isset($list['fullname'])) {
         $this->_fullname = $list['fullname'];
     } else {
         $this->_fullname = $this->getName();
     }
     if (isset($list['configure_option'])) {
         $this->_configure_option = $list['configure_option'];
     }
     unset($list['configure_option']);
     if (isset($list['available_since_php_version'])) {
         $this->setAvailableSincePhpVersion($list['available_since_php_version']);
     }
     unset($list['available_since_php_version']);
     if (isset($list['deprecated_since_php_version'])) {
         $this->setDeprecatedSincePhpVersion($list['deprecated_since_php_version']);
     }
     unset($list['deprecated_since_php_version']);
     if (isset($list['removed_since_php_version'])) {
         $this->setRemovedSincePhpVersion($list['removed_since_php_version']);
     }
     unset($list['removed_since_php_version']);
     $this->_functionList = new PhpLibraryFunctionList();
     if (isset($list['functions'])) {
         $this->_functionList->handleMultiple($list['functions']);
     }
     unset($list['functions']);
     $this->_constantList = new PhpLibraryConstantList();
     if (isset($list['constants'])) {
         $this->_constantList->handleMultiple($list['constants']);
     }
     unset($list['constants']);
     $this->_classList = new PhpLibraryClassList();
     if (isset($list['classes'])) {
         $this->_classList->handleMultiple($list['classes']);
     }
     unset($list['classes']);
     // we have to dispatch the rest of it
     foreach ($list as $elementfilename) {
         // wild guess : constants are ALL UPPERCASE
         if (strtoupper($elementfilename) === $elementfilename) {
             $this->_constantList->handleSingle($elementfilename);
             continue;
         }
         // wild guess : classes are Ucfirst
         if (ucfirst($elementfilename) === $elementfilename) {
             $this->_classList->handleSingle($elementfilename);
             continue;
         }
         // the rest is functions
         $this->_functionList->handleSingle($elementfilename);
     }
 }
예제 #2
0
 /**
  * Builds a new PhpLibraryConstant object.
  */
 public function __construct()
 {
     parent::__construct();
     $this->_libraryVersionHistory = new VersionHistory();
 }