From 4f8cbb99dd6b1fde47d8f28dd3b380409811f933 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Mon, 28 Jul 2014 18:58:46 +0200 Subject: [PATCH] doc/lib: Add `NonEmptyFileIterator' for iterating over non-empty files refs #4820 --- .../doc/library/Doc/NonEmptyFileIterator.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 modules/doc/library/Doc/NonEmptyFileIterator.php diff --git a/modules/doc/library/Doc/NonEmptyFileIterator.php b/modules/doc/library/Doc/NonEmptyFileIterator.php new file mode 100644 index 000000000..71bf5acfa --- /dev/null +++ b/modules/doc/library/Doc/NonEmptyFileIterator.php @@ -0,0 +1,31 @@ +getInnerIterator()->current(); + /* @var $current \SplFileInfo */ + if (! $current->isFile() + || $current->getSize() === 0 + ) { + return false; + } + return true; + } +}