本文整理汇总了PHP中Webmozart\Assert\Assert::allStringNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP Assert::allStringNotEmpty方法的具体用法?PHP Assert::allStringNotEmpty怎么用?PHP Assert::allStringNotEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Webmozart\Assert\Assert
的用法示例。
在下文中一共展示了Assert::allStringNotEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: challengeDomains
/**
* Request and check a list of domain.
*
* @param array $domains
*
* @throws \Exception
*/
public function challengeDomains(array $domains)
{
Assert::allStringNotEmpty($domains, 'challengeDomains::$domains expected an array of non-empty string. Got: %s');
foreach (array_unique($domains) as $domain) {
$this->challengeDomain($domain);
}
}
示例2: __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;
}
示例3: __construct
/**
* @param string $commonName
* @param string $countryName
* @param string $stateOrProvinceName
* @param string $localityName
* @param string $organizationName
* @param string $organizationalUnitName
* @param string $emailAddress
* @param array $subjectAlternativeNames
*/
public function __construct($commonName, $countryName = null, $stateOrProvinceName = null, $localityName = null, $organizationName = null, $organizationalUnitName = null, $emailAddress = null, array $subjectAlternativeNames = [])
{
Assert::stringNotEmpty($commonName, __CLASS__ . '::$commonName expected a non empty string. Got: %s');
Assert::nullOrString($countryName, __CLASS__ . '::$countryName expected a string. Got: %s');
Assert::nullOrString($stateOrProvinceName, __CLASS__ . '::$stateOrProvinceName expected a string. Got: %s');
Assert::nullOrString($localityName, __CLASS__ . '::$localityName expected a string. Got: %s');
Assert::nullOrString($organizationName, __CLASS__ . '::$organizationName expected a string. Got: %s');
Assert::nullOrString($organizationalUnitName, __CLASS__ . '::$organizationalUnitName expected a string. Got: %s');
Assert::nullOrString($emailAddress, __CLASS__ . '::$emailAddress expected a string. Got: %s');
Assert::allStringNotEmpty($subjectAlternativeNames, __CLASS__ . '::$subjectAlternativeNames expected an array of non empty string. Got: %s');
$this->commonName = $commonName;
$this->countryName = $countryName;
$this->stateOrProvinceName = $stateOrProvinceName;
$this->localityName = $localityName;
$this->organizationName = $organizationName;
$this->organizationalUnitName = $organizationalUnitName;
$this->emailAddress = $emailAddress;
$this->subjectAlternativeNames = array_diff(array_unique($subjectAlternativeNames), [$commonName]);
}