当前位置: 首页>>代码示例>>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;未经允许,请勿转载。