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


PHP Assertion::false方法代码示例

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


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

示例1: checkerParameter

 /**
  * {@inheritdoc}
  */
 public function checkerParameter(ClientInterface $client, array &$parameters)
 {
     if (!array_key_exists('prompt', $parameters)) {
         return;
     }
     Assertion::true(empty(array_diff($parameters['prompt'], $this->getAllowedPromptValues())), sprintf('Invalid parameter "prompt". Allowed values are %s', json_encode($this->getAllowedPromptValues())));
     Assertion::false(in_array('none', $parameters['prompt']) && 1 !== count($parameters['prompt']), 'Invalid parameter "prompt". Prompt value "none" must be used alone.');
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:11,代码来源:PromptParameterChecker.php

示例2: chooseLetter

 /**
  * @param string $gameId
  * @param string $letter
  * @return int
  */
 public function chooseLetter($gameId, $letter)
 {
     Assertion::false($this->gameWon, "Game already won");
     Assertion::false($this->gameLost, "Game already lost");
     // if letter already exists do nothing
     if ($this->lettersCorrectlyGuessed->LetterExistsInContainer($letter) || $this->lettersWrongGuessed->LetterExistsInContainer($letter)) {
         $this->wrongGuessedLetter($gameId, $letter);
         return;
     }
     // Execute the right event
     $wordContainsLetter = $this->word->wordContainsLetter($letter);
     if ($wordContainsLetter === false) {
         $this->wrongGuessedLetter($gameId, $letter);
         return;
     }
     // throw good guess
     $this->correctlyGuessedLetters($gameId, $letter);
 }
开发者ID:lenmen,项目名称:hangman_leon,代码行数:23,代码来源:Game.php

示例3: encrypt

 /**
  * {@inheritdoc}
  */
 public function encrypt(Object\JWEInterface &$jwe)
 {
     Assertion::false($jwe->isEncrypted(), 'The JWE is already encrypted.');
     Assertion::greaterThan($jwe->countRecipients(), 0, 'The JWE does not contain recipient.');
     $additional_headers = [];
     $nb_recipients = $jwe->countRecipients();
     $content_encryption_algorithm = $this->getContentEncryptionAlgorithm($jwe);
     $compression_method = $this->getCompressionMethod($jwe);
     $key_management_mode = $this->getKeyManagementMode($jwe);
     $cek = $this->determineCEK($jwe, $content_encryption_algorithm, $key_management_mode, $additional_headers);
     for ($i = 0; $i < $nb_recipients; $i++) {
         $this->processRecipient($jwe, $jwe->getRecipient($i), $cek, $content_encryption_algorithm, $additional_headers);
     }
     if (!empty($additional_headers) && 1 === $jwe->countRecipients()) {
         $jwe = $jwe->withSharedProtectedHeaders(array_merge($jwe->getSharedProtectedHeaders(), $additional_headers));
     }
     $iv_size = $content_encryption_algorithm->getIVSize();
     $iv = $this->createIV($iv_size);
     $this->encryptJWE($jwe, $content_encryption_algorithm, $cek, $iv, $compression_method);
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:23,代码来源:Encrypter.php

示例4: checkPayload

 /**
  * @param \Jose\Object\JWSInterface $jws
  * @param null|string               $detached_payload
  */
 private function checkPayload(Object\JWSInterface $jws, $detached_payload = null)
 {
     Assertion::false(null !== $detached_payload && !empty($jws->getPayload()), 'A detached payload is set, but the JWS already has a payload.');
     Assertion::true(!empty($jws->getPayload()) || null !== $detached_payload, 'No payload.');
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:9,代码来源:Verifier.php

示例5: getSignatureAlgorithm

 /**
  * @param array                     $complete_header The complete header
  * @param \Jose\Object\JWKInterface $key
  *
  * @return \Jose\Algorithm\SignatureAlgorithmInterface
  */
 private function getSignatureAlgorithm(array $complete_header, Object\JWKInterface $key)
 {
     Assertion::keyExists($complete_header, 'alg', 'No "alg" parameter set in the header.');
     Assertion::false($key->has('alg') && $key->get('alg') !== $complete_header['alg'], sprintf('The algorithm "%s" is not allowed with this key.', $complete_header['alg']));
     $signature_algorithm = $this->getJWAManager()->getAlgorithm($complete_header['alg']);
     Assertion::isInstanceOf($signature_algorithm, Algorithm\SignatureAlgorithmInterface::class, sprintf('The algorithm "%s" is not supported.', $complete_header['alg']));
     return $signature_algorithm;
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:14,代码来源:Signer.php

示例6: downloadContent

 /**
  * @throws \InvalidArgumentException
  *
  * @return string
  */
 private function downloadContent()
 {
     $params = [CURLOPT_RETURNTRANSFER => true, CURLOPT_URL => $this->url];
     if (false === $this->allow_unsecured_connection) {
         $params[CURLOPT_SSL_VERIFYPEER] = true;
         $params[CURLOPT_SSL_VERIFYHOST] = 2;
     }
     $ch = curl_init();
     curl_setopt_array($ch, $params);
     $content = curl_exec($ch);
     curl_close($ch);
     Assertion::false(false === $content, 'Unable to get content.');
     return $content;
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:19,代码来源:DownloadedJWKSet.php

示例7: ensureNotBlocked

 /**
  * @Then /^the block should not be confirmed$/
  */
 public function ensureNotBlocked()
 {
     Assertion::false($this->isBlocked);
 }
开发者ID:sententiaregum,项目名称:sententiaregum,代码行数:7,代码来源:BlockedAccountClusterContext.php

示例8: testInvalidFalse

 public function testInvalidFalse()
 {
     $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_FALSE);
     Assertion::false(true);
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:5,代码来源:AssertTest.php

示例9: uncompress

 /**
  * {@inheritdoc}
  */
 public function uncompress($data)
 {
     $data = gzuncompress($data);
     Assertion::false(false === $data, 'Unable to uncompress data');
     return $data;
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:9,代码来源:ZLib.php

示例10: validate

 private function validate()
 {
     Assertion::nullOrString($this->logMessageRegExp);
     Assertion::nullOrString($this->logMessageInString);
     Assertion::nullOrString($this->logContextFuzzy);
     Assertion::nullOrIsInstanceOf($this->logTimeLowerBounds, DateTimeInterface::class);
     Assertion::nullOrIsInstanceOf($this->logTimeUpperBounds, DateTimeInterface::class);
     Assertion::nullOrIsArray($this->logLevelList);
     if (!is_null($this->logLevelList)) {
         Assertion::notEmpty($this->logLevelList);
         Assertion::allInArray($this->logLevelList, array_values((new ReflectionClass(LogLevel::class))->getConstants()));
     }
     if (!is_null($this->logMessageRegExp)) {
         Assertion::true(RegexGuardFactory::getGuard()->isRegexValid($this->logMessageRegExp));
     }
     if (!is_null($this->logTimeLowerBounds) && !is_null($this->logTimeUpperBounds)) {
         Assertion::false($this->logTimeLowerBounds->diff($this->logTimeUpperBounds)->invert);
     }
 }
开发者ID:metasyntactical,项目名称:inmemory-logger,代码行数:19,代码来源:LogQuery.php

示例11: addServiceSource

 /**
  * @param \SpomkyLabs\JoseBundle\DependencyInjection\Source\SourceInterface $source
  */
 public function addServiceSource(Source\SourceInterface $source)
 {
     $name = $source->getName();
     Assertion::false(in_array($name, $this->service_sources), sprintf('The source "%s" is already set.', $name));
     $this->service_sources[$name] = $source;
 }
开发者ID:spomky-labs,项目名称:jose-bundle,代码行数:9,代码来源:SpomkyLabsJoseBundleExtension.php

示例12: checkRedirectUriForAllClient

 /**
  * @throws \InvalidArgumentException
  */
 private function checkRedirectUriForAllClient()
 {
     Assertion::false($this->isRedirectUriStorageEnforced(), 'Clients must register at least one redirect URI.');
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:7,代码来源:RedirectUriParameterChecker.php

示例13: loadPEM

 /**
  * @param string $data
  *
  * @throws \Exception
  * @throws \FG\ASN1\Exception\ParserException
  *
  * @return array
  */
 private function loadPEM($data)
 {
     $res = openssl_pkey_get_private($data);
     if (false === $res) {
         $res = openssl_pkey_get_public($data);
     }
     Assertion::false(false === $res, 'Unable to load the key');
     $details = openssl_pkey_get_details($res);
     Assertion::keyExists($details, 'rsa', 'Unable to load the key');
     $this->values['kty'] = 'RSA';
     $keys = ['n' => 'n', 'e' => 'e', 'd' => 'd', 'p' => 'p', 'q' => 'q', 'dp' => 'dmp1', 'dq' => 'dmq1', 'qi' => 'iqmp'];
     foreach ($details['rsa'] as $key => $value) {
         if (in_array($key, $keys)) {
             $value = Base64Url::encode($value);
             $this->values[array_search($key, $keys)] = $value;
         }
     }
 }
开发者ID:spomky-labs,项目名称:jose,代码行数:26,代码来源:RSAKey.php

示例14: ensureNoLogRemains

 /**
  * @Then /^no log about "(.*)" should exist on user "(.*)" should exist$/
  *
  * @param string $ip
  * @param string $username
  */
 public function ensureNoLogRemains(string $ip, string $username)
 {
     Assertion::false($this->getEntityManager()->getRepository('Account:User')->findOneBy(['username' => $username])->exceedsIpFailedAuthAttemptMaximum($ip, new DateTimeComparison()));
 }
开发者ID:sententiaregum,项目名称:sententiaregum,代码行数:10,代码来源:UsersContext.php

示例15: addPKCEMethod

 /**
  * {@inheritdoc}
  */
 public function addPKCEMethod(PKCEMethodInterface $method)
 {
     Assertion::false(array_key_exists($method->getMethodName(), $this->pkce_methods), sprintf('The method "%s" already exists.', $method->getMethodName()));
     $this->pkce_methods[$method->getMethodName()] = $method;
 }
开发者ID:spomky-labs,项目名称:oauth2-server-library,代码行数:8,代码来源:PKCEMethodManager.php


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