当前位置: 首页>>代码示例>>PHP>>正文


PHP Assertion::notEmptyKey方法代码示例

本文整理汇总了PHP中Assert\Assertion::notEmptyKey方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::notEmptyKey方法的具体用法?PHP Assertion::notEmptyKey怎么用?PHP Assertion::notEmptyKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assert\Assertion的用法示例。


在下文中一共展示了Assertion::notEmptyKey方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: join

 /**
  * {@inheritdoc}
  */
 public function join(string $channel, array $data = [])
 {
     Assertion::notEmptyKey($data, 'socketId', "Invalid socket id");
     Assertion::notEmptyKey($data, 'userId', "Invalid user id");
     Assertion::notEmptyKey($data, 'fullName', "Invalid full name");
     return $this->pusher->presence_auth($channel, $data['socketId'], $data['userId'], ['id' => $data['userId'], 'name' => utf8_encode($data['fullName'])]);
 }
开发者ID:domynation,项目名称:domynation-framework,代码行数:10,代码来源:PusherWebSocket.php

示例2: __call

 /**
  * Returns dynamic properties passed to the object
  *
  * Notice: property names should be camelCased
  *
  * @param string $method
  * @param array  $arguments
  *
  * @return mixed
  *
  * @throws BadMethodCallException If $method is not a property
  */
 public function __call($method, array $arguments)
 {
     if (substr($method, 0, 3) === 'get' and $property = substr($method, 3)) {
         $property = lcfirst($property);
         Assertion::notEmptyKey($this->data, $property, 'User does not have a(n) "%s" property');
         return $this->data[$property];
     }
     throw new \BadMethodCallException(sprintf('Method "%s" does not exists', $method));
 }
开发者ID:indigophp,项目名称:guardian,代码行数:21,代码来源:Simple.php

示例3: identify

 /**
  * {@inheritdoc}
  */
 public function identify(array $subject)
 {
     Assertion::notEmptyKey($subject, 'username');
     if (!in_array($subject['username'], $this->userKeys)) {
         throw new IdentificationFailed('User not found');
     }
     $id = array_search($subject['username'], $this->userKeys);
     return new SimpleUser($id, $this->users[$id]);
 }
开发者ID:indigophp,项目名称:guardian,代码行数:12,代码来源:InMemory.php

示例4: __construct

 /**
  * @param array $configuration Array with configuration settings
  * @throws InvalidArgumentException
  */
 public function __construct(array $configuration)
 {
     // Validate and set base url
     Assertion::notEmptyKey($configuration, 'apiBaseUrl', 'apiBaseUrl is required');
     Assertion::url($configuration['apiBaseUrl'], 'apiBaseUrl has to be a valid url');
     $this->apiBaseUrl = rtrim($configuration['apiBaseUrl'], '/');
     // Validate username
     Assertion::notEmptyKey($configuration, 'username', 'username is required');
     Assertion::string($configuration['username'], 'username has to be a string');
     $this->username = trim($configuration['username']);
     // Validate api interface id
     Assertion::notEmptyKey($configuration, 'apiId', 'apiId is required');
     Assertion::integer($configuration['apiId'], 'apiId has to be an integer');
     $this->apiId = trim($configuration['apiId']);
     // Validate api key
     Assertion::notEmptyKey($configuration, 'apiKey', 'apiKey is required');
     Assertion::string($configuration['apiKey'], 'apiKey has to be a string');
     $this->apiKey = trim($configuration['apiKey']);
     // Check if clientConfiguration is set and valid
     if (isset($configuration['clientConfiguration'])) {
         Assertion::isArray($configuration['clientConfiguration'], 'clientConfiguration has to be an array');
         $this->clientConfiguration = $configuration['clientConfiguration'];
     }
 }
开发者ID:simplyadmire,项目名称:zaaksysteem,代码行数:28,代码来源:Configuration.php

示例5: testInvalidNotEmptyKey

 /**
  * @dataProvider invalidNotEmptyKeyDataprovider
  */
 public function testInvalidNotEmptyKey($invalidArray, $key)
 {
     $this->setExpectedException('Assert\\InvalidArgumentException');
     Assertion::notEmptyKey($invalidArray, $key);
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:8,代码来源:AssertTest.php

示例6: createResult

 private function createResult(array $result_data)
 {
     Assertion::notEmptyKey($result_data, self::OBJECT_TYPE);
     return $this->projection_type_map->getItem($result_data[self::OBJECT_TYPE])->createEntity($result_data);
 }
开发者ID:honeybee,项目名称:honeybee,代码行数:5,代码来源:ProjectionReader.php

示例7: detachSubject

 /**
  * Unregisters a subject from a specific event.
  *
  * @param string $event
  * @param string $key
  */
 public function detachSubject($event, $key)
 {
     Assertion::notEmptyKey($this->subjects, $event, 'Provided event does not exist.');
     Assertion::notEmptyKey($this->subjects[$event], $key, 'Subject to be detached does not exist.');
     unset($this->subjects[$event][$key]);
 }
开发者ID:liip,项目名称:dataaggregator,代码行数:12,代码来源:SubjectDispatcher.php


注:本文中的Assert\Assertion::notEmptyKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。