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


PHP Assertion::inArray方法代码示例

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


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

示例1: checkKey

 /**
  * @param JWKInterface $key
  */
 private function checkKey(JWKInterface $key)
 {
     Assertion::eq($key->get('kty'), 'OKP', 'Wrong key type.');
     Assertion::true($key->has('x'), 'The key parameter "x" is missing.');
     Assertion::true($key->has('crv'), 'The key parameter "crv" is missing.');
     Assertion::inArray($key->get('crv'), ['Ed25519'], 'Unsupported curve');
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:10,代码来源:EdDSA.php

示例2: setHandlerLoggerLevel

 private function setHandlerLoggerLevel($handlerLoggerLevel)
 {
     $levels = [Logger::DEBUG, Logger::INFO, Logger::NOTICE, Logger::WARNING, Logger::ERROR, Logger::CRITICAL, Logger::ALERT, Logger::EMERGENCY];
     Assertion::inArray($handlerLoggerLevel, $levels);
     $this->handlerLoggerLevel = $handlerLoggerLevel;
     return $this;
 }
开发者ID:smsapi,项目名称:monolog-smsapi,代码行数:7,代码来源:SmsapiConfig.php

示例3: assertConfig

 private function assertConfig(array $config)
 {
     Assertion::keyExists($config, "dbname");
     Assertion::string($config['dbname']);
     Assertion::keyExists($config, "driver");
     Assertion::inArray($config["driver"], $this->supportedDrivers);
 }
开发者ID:prooph,项目名称:link-sql-connector,代码行数:7,代码来源:DbalConnection.php

示例4: __construct

 /**
  * @param string $type
  * @param string $code
  */
 public function __construct($type, $code)
 {
     Assertion::inArray($type, $this->types);
     Assertion::string($code);
     $this->type = $type;
     $this->code = $code;
 }
开发者ID:jacmoe,项目名称:php-workshop,代码行数:11,代码来源:CodeInsertion.php

示例5: __construct

 /**
  * @param string $text
  * @param string $position
  */
 public function __construct($text, $position = self::POSITION_CENTER)
 {
     Assertion::string($text);
     Assertion::inArray($position, [self::POSITION_CENTER, self::POSITION_RIGHT, self::POSITION_LEFT]);
     $this->text = $text;
     $this->position = $position;
     $this->artLength = max(array_map('mb_strlen', explode("\n", $text)));
 }
开发者ID:mops1k,项目名称:cli-menu,代码行数:12,代码来源:AsciiArtItem.php

示例6: thumbprint

 public function thumbprint($hash_algorithm)
 {
     Assertion::inArray($hash_algorithm, hash_algos(), sprintf('Hash algorithm "%s" is not supported', $hash_algorithm));
     $values = array_intersect_key($this->getAll(), array_flip(['kty', 'n', 'e', 'crv', 'x', 'y', 'k']));
     ksort($values);
     $input = json_encode($values);
     return Base64Url::encode(hash($hash_algorithm, $input, true));
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:8,代码来源:JWK.php

示例7: __construct

 /**
  * @param string        $aType
  * @param array         $aProcessStepCollection
  * @param AgentOptions  $anOptions
  */
 public function __construct($aType, array $aProcessStepCollection, AgentOptions $anOptions = null)
 {
     Assertion::inArray($aType, array(self::SEQUENCE, self::SPLIT, self::FORK, self::LOOP));
     Assertion::allIsInstanceOf($aProcessStepCollection, 'GingerCore\\Model\\JsonWDL\\ProcessStep');
     $this->type = $aType;
     $this->processSteps = $aProcessStepCollection;
     $this->options = is_null($anOptions) ? new AgentOptions(array()) : $anOptions;
 }
开发者ID:gingerwfms,项目名称:ginger-core,代码行数:13,代码来源:AgentDescription.php

示例8: addElement

 /**
  * @param string $name
  * @param array $options
  * @return ElementMetadata
  */
 protected function addElement($name, array $options)
 {
     Assertion::inArray($options['type'], array_keys($this->types), "'{$options['type']}' is not a valid type");
     /** @var ElementMetadata $element */
     $element = new ElementMetadata($this->types[$options['type']]);
     $element->setElementName($name);
     $element->configure($options);
     return $element;
 }
开发者ID:comphppuebla,项目名称:easy-forms,代码行数:14,代码来源:FormMetadata.php

示例9: __construct

 /**
  * @param string $aPathWithKey
  * @param string $aValueType
  */
 public function __construct($aPathWithKey, $aValueType)
 {
     Assertion::string($aPathWithKey);
     $aPathWithKey = trim($aPathWithKey);
     Assertion::notEmpty($aPathWithKey);
     Assertion::inArray($aValueType, array(StructureDefinition::BOOLEAN, StructureDefinition::INTEGER, StructureDefinition::FLOAT, StructureDefinition::STRING, StructureDefinition::COLLECTION, StructureDefinition::HASHTABLE));
     $this->extractPathFromKey($aPathWithKey);
     $this->valueType = $aValueType;
 }
开发者ID:gingerwfms,项目名称:ginger-core,代码行数:13,代码来源:StructureItem.php

示例10: __construct

 public function __construct(DateTimeInterface $logDate, $logLevel, $logMessage, array $logContext, array $logCallGraph)
 {
     Assertion::inArray($logLevel, (new ReflectionClass(LogLevel::class))->getConstants());
     Assertion::string($logMessage);
     $this->logDate = $logDate;
     $this->logLevel = $logLevel;
     $this->logMessage = $logMessage;
     $this->logContext = $logContext;
     $this->logCallGraph = $logCallGraph;
 }
开发者ID:metasyntactical,项目名称:inmemory-logger,代码行数:10,代码来源:LogEntry.php

示例11: enableSignedResponsesSupport

 /**
  * @param \Jose\JWTCreatorInterface    $jwt_creator
  * @param string                       $issuer
  * @param string                       $signature_algorithm
  * @param \Jose\Object\JWKSetInterface $signature_key_set
  */
 public function enableSignedResponsesSupport(JWTCreatorInterface $jwt_creator, $issuer, $signature_algorithm, JWKSetInterface $signature_key_set)
 {
     Assertion::string($issuer);
     Assertion::inArray($signature_algorithm, $jwt_creator->getSupportedSignatureAlgorithms());
     Assertion::greaterThan($signature_key_set->countKeys(), 0, 'The signature key set must have at least one key.');
     $this->setJWTCreator($jwt_creator);
     $this->setIssuer($issuer);
     $this->signature_key_set = $signature_key_set;
     $this->signature_algorithm = $signature_algorithm;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:16,代码来源:UserInfoEndpoint.php

示例12: create

 /**
  * Static constructor.
  *
  * @param string             $type
  * @param int                $id
  * @param int                $userId
  * @param \DateTimeInterface $date
  *
  * @return TwitterDelete
  */
 public static function create($type, $id, $userId, \DateTimeInterface $date)
 {
     $obj = new self();
     Assertion::inArray($type, [self::TWEET, self::DM]);
     $obj->type = $type;
     $obj->id = $id;
     $obj->userId = $userId;
     $obj->date = $date;
     return $obj;
 }
开发者ID:remi-san,项目名称:twitter,代码行数:20,代码来源:TwitterDelete.php

示例13: __construct

 /**
  * EncryptedSubjectIdentifier constructor.
  *
  * @param string $pairwise_hash_key
  * @param string $algorithm
  * @param string $salt
  */
 public function __construct($pairwise_hash_key, $algorithm, $salt)
 {
     Assertion::string($pairwise_hash_key);
     Assertion::string($algorithm);
     Assertion::string($salt);
     Assertion::inArray($algorithm, hash_algos(), sprintf('The algorithm "%s" is not supported.', $algorithm));
     $this->pairwise_hash_key = $pairwise_hash_key;
     $this->algorithm = $algorithm;
     $this->salt = $salt;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:17,代码来源:HashedSubjectIdentifier.php

示例14: __construct

 /**
  * EncryptedSubjectIdentifier constructor.
  *
  * @param string      $pairwise_encryption_key
  * @param string      $algorithm
  * @param null|string $iv
  * @param string      $salt
  */
 public function __construct($pairwise_encryption_key, $algorithm, $iv, $salt)
 {
     Assertion::nullOrString($iv);
     Assertion::string($salt);
     Assertion::string($pairwise_encryption_key);
     Assertion::string($algorithm);
     Assertion::inArray($algorithm, openssl_get_cipher_methods(), sprintf('The algorithm "%s" is not supported.', $algorithm));
     $this->pairwise_encryption_key = $pairwise_encryption_key;
     $this->algorithm = $algorithm;
     $this->salt = $salt;
     $this->iv = $iv;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:20,代码来源:EncryptedSubjectIdentifier.php

示例15: check

 /**
  * {@inheritdoc}
  */
 public function check(ClientInterface $client, array $registration_parameters)
 {
     if (!array_key_exists('id_token_encrypted_response_alg', $registration_parameters) || !array_key_exists('id_token_encrypted_response_enc', $registration_parameters)) {
         return;
     }
     Assertion::string($registration_parameters['id_token_encrypted_response_alg'], 'Invalid parameter "id_token_encrypted_response_alg". The value must be a string.');
     Assertion::string($registration_parameters['id_token_encrypted_response_enc'], 'Invalid parameter "id_token_encrypted_response_enc". The value must be a string.');
     Assertion::inArray($registration_parameters['id_token_encrypted_response_alg'], $this->getIdTokenManager()->getSupportedKeyEncryptionAlgorithms(), sprintf('The ID Token content encryption algorithm "%s" is not supported. Please choose one of the following algorithm: %s', $registration_parameters['id_token_encrypted_response_alg'], json_encode($this->getIdTokenManager()->getSupportedContentEncryptionAlgorithms())));
     Assertion::inArray($registration_parameters['id_token_encrypted_response_enc'], $this->getIdTokenManager()->getSupportedContentEncryptionAlgorithms(), sprintf('The ID Token key encryption algorithm "%s" is not supported. Please choose one of the following algorithm: %s', $registration_parameters['id_token_encrypted_response_enc'], json_encode($this->getIdTokenManager()->getSupportedKeyEncryptionAlgorithms())));
     $client->set('id_token_encrypted_response_alg', $registration_parameters['id_token_encrypted_response_alg']);
     $client->set('id_token_encrypted_response_enc', $registration_parameters['id_token_encrypted_response_enc']);
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:15,代码来源:IdTokenEncryptionAlgorithmsRule.php


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