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


PHP Assert::notEq方法代码示例

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


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

示例1: validateTuples

 /**
  * @param array $setTuples
  * @param int $countTuples
  *
  * @return array
  *
  * @throws \InvalidArgumentException
  */
 private function validateTuples(array $setTuples, $countTuples)
 {
     Assert::notEq(0, $countTuples, 'The set builder requires a single array of one or more array sets.1');
     foreach ($setTuples as $tuple) {
         Assert::isArray($tuple, 'The set builder requires a single array of one or more array sets.');
     }
     return $setTuples;
 }
开发者ID:loic425,项目名称:Sylius,代码行数:16,代码来源:CartesianSetBuilder.php

示例2: getMessages

 /**
  * @param string $directory
  *
  * @return \Swift_Message[]
  */
 private function getMessages($directory)
 {
     $finder = new Finder();
     $finder->files()->name('*.message')->in($directory);
     Assert::notEq($finder->count(), 0, sprintf('No message files found in %s.', $directory));
     $messages = [];
     /** @var SplFileInfo $file */
     foreach ($finder as $file) {
         $messages[] = unserialize($file->getContents());
     }
     return $messages;
 }
开发者ID:TeamNovatek,项目名称:Sylius,代码行数:17,代码来源:EmailChecker.php

示例3: remove

 /**
  * {@inheritdoc}
  */
 public function remove($query, $language = 'glob')
 {
     $resources = $this->find($query, $language);
     $nbOfResources = count($this->resources);
     // Run the assertion after find(), so that we know that $query is valid
     Assert::notEq('', trim($query, '/'), 'The root directory cannot be removed.');
     foreach ($resources as $resource) {
         $this->removeResource($resource);
     }
     return $nbOfResources - count($this->resources);
 }
开发者ID:SenseException,项目名称:repository,代码行数:14,代码来源:InMemoryRepository.php

示例4: remove

 /**
  * {@inheritdoc}
  */
 public function remove($query, $language = 'glob')
 {
     $iterator = $this->getGlobIterator($query, $language);
     $removed = 0;
     Assert::notEq('', trim($query, '/'), 'The root directory cannot be removed.');
     // There's some problem with concurrent deletions at the moment
     foreach (iterator_to_array($iterator) as $filesystemPath) {
         $this->removeResource($filesystemPath, $removed);
     }
     return $removed;
 }
开发者ID:SenseException,项目名称:repository,代码行数:14,代码来源:FilesystemRepository.php


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