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


PHP Assertion::allString方法代码示例

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


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

示例1: withCountryCodes

 /**
  * @param array $countryCodes
  *
  * @throws \InvalidArgumentException
  *
  * @return static
  */
 public function withCountryCodes(array $countryCodes)
 {
     Assertion::allString($countryCodes);
     Assertion::allNotBlank($countryCodes);
     $instance = clone $this;
     $instance->countryCodes = $countryCodes;
     return $instance;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:15,代码来源:Restriction.php

示例2: checkResponseTypes

 /**
  * @param \OAuth2\Client\ClientInterface $client
  * @param array                          $registration_parameters
  */
 private function checkResponseTypes(ClientInterface $client, array $registration_parameters)
 {
     Assertion::isArray($registration_parameters['response_types'], 'The parameter "response_types" must be an array of strings.');
     Assertion::allString($registration_parameters['response_types'], 'The parameter "grant_types" must be an array of strings.');
     foreach ($registration_parameters['response_types'] as $response_type) {
         $types = $this->getResponseTypeManager()->getResponseTypes($response_type);
         if (!in_array($response_type, $client->get('response_types'))) {
             $response_types = $client->get('response_types');
             $response_types[] = $response_type;
             $client->set('response_types', $response_types);
         }
         foreach ($types as $type) {
             $associated_grant_types = $type->getAssociatedGrantTypes();
             $diff = array_diff($associated_grant_types, $registration_parameters['grant_types']);
             Assertion::true(empty($diff), sprintf('The response type "%s" is associated with the grant types "%s" but this response type is missing.', $type->getResponseType(), json_encode($diff)));
             $client->set('grant_types', array_unique(array_merge($client->get('grant_types'), $associated_grant_types)));
         }
     }
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:23,代码来源:GrantTypeFlowRule.php

示例3: recordCustomEvent

 public function recordCustomEvent($name, array $attributes)
 {
     Assertion::string($name);
     Assertion::notBlank($name);
     Assertion::allString(array_keys($attributes));
     Assertion::allScalar(array_values($attributes));
     $this->handle('newrelic_record_custom_event', [$name, $attributes]);
 }
开发者ID:refinery29,项目名称:newrelic,代码行数:8,代码来源:Agent.php

示例4: enableRequestObjectSupport

 /**
  * {@inheritdoc}
  */
 public function enableRequestObjectSupport(JWTLoaderInterface $jwt_loader, array $mandatory_claims = [])
 {
     Assertion::allString($mandatory_claims, 'The mandatory claims array should contain only claims.');
     $this->setJWTLoader($jwt_loader);
     $this->request_object_allowed = true;
     $this->mandatory_claims = $mandatory_claims;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:10,代码来源:AuthorizationRequestLoader.php

示例5: getJWKSetsConfiguration

 /**
  * @param string   $name
  * @param string[] $jwksets
  * @param bool     $is_public
  *
  * @return array
  */
 private static function getJWKSetsConfiguration($name, array $jwksets, $is_public = true)
 {
     self::checkParameters($name, $is_public);
     Assertion::isArray($jwksets);
     Assertion::allString($jwksets);
     Assertion::allNotEmpty($jwksets);
     return [self::BUNDLE_ALIAS => ['key_sets' => [$name => ['jwksets' => ['is_public' => $is_public, 'id' => $jwksets]]]]];
 }
开发者ID:spomky-labs,项目名称:jose-bundle,代码行数:15,代码来源:ConfigurationHelper.php

示例6: createProcessDataTaskFromDefinition

 /**
  * @param array $taskDefinition
  * @return ProcessData
  */
 private function createProcessDataTaskFromDefinition(array $taskDefinition)
 {
     Assertion::keyExists($taskDefinition, "target");
     Assertion::notEmpty($taskDefinition["target"]);
     Assertion::string($taskDefinition["target"]);
     Assertion::keyExists($taskDefinition, "allowed_types");
     Assertion::isArray($taskDefinition["allowed_types"]);
     Assertion::allString($taskDefinition["allowed_types"]);
     $preferredType = isset($taskDefinition["preferred_type"]) ? $taskDefinition["preferred_type"] : null;
     $metadata = isset($taskDefinition['metadata']) ? $taskDefinition['metadata'] : array();
     return ProcessData::address($taskDefinition["target"], $taskDefinition["allowed_types"], $preferredType, $metadata);
 }
开发者ID:prooph,项目名称:processing,代码行数:16,代码来源:ProcessFactory.php

示例7: __construct

 /**
  * @param array $cookies
  */
 public function __construct(array $cookies = [])
 {
     Assertion::allString(array_keys($cookies), 'CookieJar must be instantiated with an associative array');
     $this->cookies = $cookies;
 }
开发者ID:refinery29,项目名称:piston,代码行数:8,代码来源:CookieJar.php

示例8: withStockTickers

 /**
  * @param array $stockTickers
  *
  * @throws \InvalidArgumentException
  *
  * @return static
  */
 public function withStockTickers(array $stockTickers)
 {
     Assertion::allString($stockTickers);
     Assertion::allNotBlank($stockTickers);
     Assertion::lessOrEqualThan(count($stockTickers), NewsInterface::STOCK_TICKERS_MAX_COUNT);
     $instance = clone $this;
     $instance->stockTickers = $stockTickers;
     return $instance;
 }
开发者ID:refinery29,项目名称:sitemap,代码行数:16,代码来源:News.php


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