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


PHP Assertion::choicesNotEmpty方法代碼示例

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


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

示例1: __construct

 /**
  * @param string|integer $id
  * @param array          $data
  */
 public function __construct($id, $data)
 {
     // TODO: check for id's type
     Assertion::choicesNotEmpty($data, ['username', 'password']);
     $this->id = $id;
     $this->data = $data;
 }
開發者ID:indigophp,項目名稱:guardian,代碼行數:11,代碼來源:Simple.php

示例2: authenticate

 /**
  * {@inheritdoc}
  */
 public function authenticate($subject, Caller $caller)
 {
     Assertion::isArray($subject);
     Assertion::choicesNotEmpty($subject, ['password']);
     Assertion::isInstanceOf($caller, 'Guardian\\User\\Caller', sprintf('The caller was expected to be an instance of "%s"', 'Indigo\\Guardian\\Caller\\User'));
     return $this->hasher->verify($subject['password'], $caller->getPassword());
 }
開發者ID:guardianphp,項目名稱:user,代碼行數:10,代碼來源:UserPassword.php

示例3: denormalize

 /**
  * {@inheritDoc}
  */
 public function denormalize($data, $class, $format = null, array $context = [])
 {
     Assertion::choicesNotEmpty($data, ['message', 'class', 'timestamp']);
     Assertion::classExists($data['class']);
     $envelope = new Envelope($this->aggregate->denormalize($data['message'], $data['class']));
     $this->forcePropertyValue($envelope, 'class', $data['class']);
     $this->forcePropertyValue($envelope, 'timestamp', $data['timestamp']);
     return $envelope;
 }
開發者ID:sheikhasadmuneer,項目名稱:bernard,代碼行數:12,代碼來源:EnvelopeNormalizer.php

示例4: testChoicesNotEmptyExpectingException

 /**
  * @dataProvider invalidChoicesProvider
  */
 public function testChoicesNotEmptyExpectingException($values, $choices, $exceptionCode)
 {
     $this->setExpectedException('Assert\\AssertionFailedException', null, $exceptionCode);
     Assertion::choicesNotEmpty($values, $choices);
 }
開發者ID:GerDner,項目名稱:luck-docker,代碼行數:8,代碼來源:AssertTest.php

示例5: denormalize

 /**
  * {@inheritdoc}
  */
 public function denormalize($data, $class, $format = null, array $context = [])
 {
     Assertion::choicesNotEmpty($data, ['name', 'arguments']);
     return new DefaultMessage($data['name'], $data['arguments']);
 }
開發者ID:acrobat,項目名稱:bernard,代碼行數:8,代碼來源:DefaultMessageNormalizer.php


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