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


PHP Assert::isNull方法代碼示例

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


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

示例1: setPort

 /**
  * @return Socket
  **/
 public function setPort($port)
 {
     Assert::isNull($this->port);
     $this->port = $port;
     return $this;
 }
開發者ID:onphp-framework,項目名稱:onphp-framework,代碼行數:9,代碼來源:Socket.class.php

示例2: setId

 /**
  * @return LogLevel
  **/
 public function setId($id)
 {
     Assert::isNull($this->id, 'i am immutable one!');
     return parent::setId($id);
 }
開發者ID:onphp-framework,項目名稱:onphp-framework,代碼行數:8,代碼來源:LogLevel.class.php

示例3: logout

 /**
  * undocumented function
  *
  * @return void
  * @access public
  */
 static function logout()
 {
     Configure::delete('User');
     Assert::isNull(Configure::read('User'));
     $Session = Common::getComponent('Session');
     $Session->del('User');
     $Cookie = Common::getComponent('Cookie');
     $Cookie->del('Auth.key');
     Assert::isEmpty($Cookie->read('Auth.key'));
     $Cookie->del('Auth.name');
     return true;
 }
開發者ID:stripthis,項目名稱:donate,代碼行數:18,代碼來源:user.php

示例4: call

 protected function call($method, DTOMessage $request, $resultClass)
 {
     $requestDto = $request->makeDto();
     Assert::isInstance($requestDto, 'DTOClass');
     if (defined('__LOCAL_DEBUG__') && !defined('SIMPLE_TEST')) {
         // self-validation
         $form = ObjectToFormConverter::create($request->entityProto())->make($request);
         Assert::isTrue(!$form->getErrors() && $request->entityProto()->validate($request, $form), Assert::dumpArgument($request));
     }
     try {
         try {
             $resultDto = $this->getSoapClient()->{$method}($requestDto);
         } catch (BaseException $e) {
             if (get_class($e) == 'BaseException') {
                 throw new SoapFault('Server', get_class($e) . ': ' . $e->getMessage());
             } else {
                 $this->logCall();
                 throw $e;
             }
         }
     } catch (SoapFault $e) {
         $this->logCall();
         throw self::convertSoapFault($e);
     }
     $this->logCall();
     if (!$resultClass) {
         Assert::isNull($resultDto);
         $result = null;
     } else {
         Assert::isInstance($resultDto, 'DTOClass');
         Assert::isEqual($resultDto->entityProto()->className(), $resultClass);
         $form = DTOToFormImporter::create($resultDto->entityProto())->make($resultDto);
         Assert::isTrue(!$form->getErrors(), Assert::dumpArgument($resultDto));
         $result = $resultDto->makeObject($form);
         Assert::isInstance($result, 'DTOMessage');
         Assert::isEqual(get_class($result), $resultClass);
         Assert::isTrue($result->entityProto()->validate($result, $form), Assert::dumpArgument($result));
     }
     return $result;
 }
開發者ID:onphp-framework,項目名稱:onphp-framework,代碼行數:40,代碼來源:PrototypedSoapClient.class.php

示例5: commentState

 private function commentState()
 {
     Assert::isNull($this->tag);
     Assert::isNull($this->tagId);
     $content = $this->getComment();
     $this->tag = SgmlIgnoredTag::comment()->setCdata(Cdata::create()->setData($content));
     $this->makeTag();
     return self::INITIAL_STATE;
 }
開發者ID:onphp-framework,項目名稱:onphp-framework,代碼行數:9,代碼來源:HtmlTokenizer.class.php


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