本文整理匯總了PHP中Hesper\Core\Base\Assert::dumpArgument方法的典型用法代碼示例。如果您正苦於以下問題:PHP Assert::dumpArgument方法的具體用法?PHP Assert::dumpArgument怎麽用?PHP Assert::dumpArgument使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Hesper\Core\Base\Assert
的用法示例。
在下文中一共展示了Assert::dumpArgument方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: cloneBuilder
/**
* @return PrototypedBuilder
**/
public function cloneBuilder(EntityProto $proto)
{
Assert::isTrue($this->proto->isInstanceOf($proto) || $proto->isInstanceOf($this->proto), Assert::dumpArgument($proto));
$result = new $this($proto);
$result->limitedPropertiesList = $this->limitedPropertiesList;
return $result;
}
示例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;
}