mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
doc: Remove iterators because they are superseded by iterators from Icinga Web 2's library
This commit is contained in:
parent
5f772c3620
commit
001eba73e7
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
|
||||||
|
|
||||||
namespace Icinga\Module\Doc;
|
|
||||||
|
|
||||||
use RecursiveFilterIterator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recursive iterator over Markdown files
|
|
||||||
*/
|
|
||||||
class MarkdownFileIterator extends RecursiveFilterIterator
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Accept files with '.md' suffix
|
|
||||||
*
|
|
||||||
* @return bool Whether the current element of the iterator is acceptable
|
|
||||||
* through this filter
|
|
||||||
*/
|
|
||||||
public function accept()
|
|
||||||
{
|
|
||||||
$current = $this->getInnerIterator()->current();
|
|
||||||
/* @var $current \SplFileInfo */
|
|
||||||
if (! $current->isFile()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$filename = $current->getFilename();
|
|
||||||
$sfx = substr($filename, -3);
|
|
||||||
return $sfx === false ? false : strtolower($sfx) === '.md';
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}
|
|
||||||
|
|
||||||
namespace Icinga\Module\Doc;
|
|
||||||
|
|
||||||
use RecursiveFilterIterator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Recursive iterator over non-empty files
|
|
||||||
*/
|
|
||||||
class NonEmptyFileIterator extends RecursiveFilterIterator
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Accept non-empty files
|
|
||||||
*
|
|
||||||
* @return bool Whether the current element of the iterator is acceptable
|
|
||||||
* through this filter
|
|
||||||
*/
|
|
||||||
public function accept()
|
|
||||||
{
|
|
||||||
$current = $this->getInnerIterator()->current();
|
|
||||||
/* @var $current \SplFileInfo */
|
|
||||||
if (! $current->isFile()
|
|
||||||
|| $current->getSize() === 0
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user