本文整理汇总了PHP中Webmozart\Assert\Assert::nullOrBoolean方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::nullOrBoolean方法的具体用法?PHP Assert::nullOrBoolean怎么用?PHP Assert::nullOrBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Assert\Assert
的用法示例。
在下文中一共展示了Assert::nullOrBoolean方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param Certificate $source
* @param string $subject
* @param string $issuer
* @param bool $selfSigned
* @param \DateTime $validFrom
* @param \DateTime $validTo
* @param string $serialNumber
* @param array $subjectAlternativeNames
*/
public function __construct(Certificate $source, $subject, $issuer = null, $selfSigned = true, \DateTime $validFrom = null, \DateTime $validTo = null, $serialNumber = null, array $subjectAlternativeNames = [])
{
Assert::stringNotEmpty($subject, __CLASS__ . '::$subject expected a non empty string. Got: %s');
Assert::nullOrString($issuer, __CLASS__ . '::$issuer expected a string or null. Got: %s');
Assert::nullOrBoolean($selfSigned, __CLASS__ . '::$selfSigned expected a boolean or null. Got: %s');
Assert::nullOrString($serialNumber, __CLASS__ . '::$serialNumber expected a string or null. Got: %s');
Assert::allStringNotEmpty($subjectAlternativeNames, __CLASS__ . '::$subjectAlternativeNames expected a array of non empty string. Got: %s');
$this->source = $source;
$this->subject = $subject;
$this->issuer = $issuer;
$this->selfSigned = $selfSigned;
$this->validFrom = $validFrom;
$this->validTo = $validTo;
$this->serialNumber = $serialNumber;
$this->subjectAlternativeNames = $subjectAlternativeNames;
}