本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}