本文整理汇总了PHP中Hesper\Core\Base\Assert::isNull方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::isNull方法的具体用法?PHP Assert::isNull怎么用?PHP Assert::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hesper\Core\Base\Assert
的用法示例。
在下文中一共展示了Assert::isNull方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setId
/**
* @return RequestType
**/
public function setId($id)
{
Assert::isNull($this->id, 'i am immutable one!');
return parent::setId($id);
}
示例2: call
protected function call($method, DTOMessage $request, $resultClass)
{
$requestDto = $request->makeDto();
Assert::isInstance($requestDto, DTOClass::class);
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::class) {
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::class);
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::class);
Assert::isEqual(get_class($result), $resultClass);
Assert::isTrue($result->entityProto()->validate($result, $form), Assert::dumpArgument($result));
}
return $result;
}
示例3: setPort
/**
* @return Socket
**/
public function setPort($port)
{
Assert::isNull($this->port);
$this->port = $port;
return $this;
}
示例4: 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;
}