當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XPClass::isSubclassOf方法代碼示例

本文整理匯總了PHP中lang\XPClass::isSubclassOf方法的典型用法代碼示例。如果您正苦於以下問題:PHP XPClass::isSubclassOf方法的具體用法?PHP XPClass::isSubclassOf怎麽用?PHP XPClass::isSubclassOf使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在lang\XPClass的用法示例。


在下文中一共展示了XPClass::isSubclassOf方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: register

 /**
  * Register an implementation
  *
  * @param   string algorithm
  * @param   lang.XPClass<security.checksum.MessageDigestImpl> class
  * @throws  lang.IllegalArgumentException
  */
 public static function register($algorithm, \lang\XPClass $impl)
 {
     if (!$impl->isSubclassOf('security.checksum.MessageDigestImpl')) {
         throw new \lang\IllegalArgumentException('Implementation class must be a security.checksum.MessageDigestImpl');
     }
     self::$implementations[$algorithm] = $impl;
 }
開發者ID:xp-framework,項目名稱:security,代碼行數:14,代碼來源:MessageDigest.class.php

示例2: setAlgorithm

 /**
  * Register an algorithm
  *
  * @param   string name
  * @param   lang.XPClass<security.password.Algorithm> impl
  * @throws  lang.IllegalArgumentException in case the given class is not an Algorithm 
  */
 public static function setAlgorithm($name, \lang\XPClass $impl)
 {
     if (!$impl->isSubclassOf('security.password.Algorithm')) {
         throw new \lang\IllegalArgumentException('Given argument is not an Algorithm class (' . \xp::stringOf($impl) . ')');
     }
     self::$algorithms[$name] = $impl;
 }
開發者ID:xp-framework,項目名稱:security,代碼行數:14,代碼來源:PasswordStrength.class.php

示例3: register

 /**
  * Register transport implementation for a specific scheme
  *
  * @param   string scheme
  * @param   lang.XPClass<peer.http.HttpTransport> class
  */
 public static function register($scheme, XPClass $class)
 {
     if (!$class->isSubclassOf('peer.http.HttpTransport')) {
         throw new \lang\IllegalArgumentException(sprintf('Given argument must be lang.XPClass<peer.http.HttpTransport>, %s given', $class->toString()));
     }
     self::$transports[$scheme] = $class;
 }
開發者ID:xp-framework,項目名稱:http,代碼行數:13,代碼來源:HttpTransport.class.php

示例4: testCasesInClass

 /**
  * Get all test cases
  *
  * @param   lang.XPClass class
  * @param   var[] arguments
  * @return  unittest.TestCase[]
  */
 public function testCasesInClass(\lang\XPClass $class, $arguments = null)
 {
     // Verify we were actually given a testcase class
     if (!$class->isSubclassOf('unittest.TestCase')) {
         throw new \lang\IllegalArgumentException('Given argument is not a TestCase class (' . \xp::stringOf($class) . ')');
     }
     // Add all tests cases
     $r = [];
     foreach ($class->getMethods() as $m) {
         $m->hasAnnotation('test') && ($r[] = $class->getConstructor()->newInstance(array_merge((array) $m->getName(true), (array) $arguments)));
     }
     // Verify we actually added tests by doing this.
     if (empty($r)) {
         throw new \util\NoSuchElementException('No tests found in ' . $class->getName());
     }
     return $r;
 }
開發者ID:johannes85,項目名稱:core,代碼行數:24,代碼來源:AbstractSource.class.php

示例5: register

 /**
  * Register a driver
  *
  * Usage:
  * <code>
  *   DriverManager::register('mydb', XPClass::forName('my.db.Connection'));
  *   // [...]
  *   $conn= DriverManager::getConnection('mydb://...');
  * </code>
  *
  * @param   string name identifier
  * @param   lang.XPClass<rdbms.DBConnection> class
  * @throws  lang.IllegalArgumentException in case an incorrect class is given
  */
 public static function register($name, \lang\XPClass $class)
 {
     if (!$class->isSubclassOf('rdbms.DBConnection')) {
         throw new \lang\IllegalArgumentException(sprintf('Given argument must be lang.XPClass<rdbms.DBConnection>, %s given', $class->toString()));
     }
     self::$instance->drivers[$name] = $class;
     self::$instance->lookup = [];
 }
開發者ID:xp-framework,項目名稱:rdbms,代碼行數:22,代碼來源:DriverManager.class.php


注:本文中的lang\XPClass::isSubclassOf方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。