Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Commit

Permalink
docs(lib/Utils): add DocBlocks for FileLoader Util (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
vandebled authored and Doğa Gürdal committed Jun 12, 2017
1 parent 8f25035 commit 5709a65
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/Utils/FileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@

class FileLoader
{
/**
* Iterates through a directory and executes the provided callback function
* on each file or folder in the directory (excluding dot files).
*
* @since 0.1.0
*
* @param $dir string Absolute path to the directory.
* @param $callback callable The callback function.
*
* @return array An array of the callback results.
*/
public static function iterateDir($dir, callable $callback)
{
$output = [];
Expand Down Expand Up @@ -34,9 +45,11 @@ public static function iterateDir($dir, callable $callback)
* Optionally able to specify the files in an array to load in a certain order.
* Starting and trailing slashes will be stripped for the directory and all files provided.
*
* @since 0.1.0
*
* @param string $dir Directory to search through.
* @param array $files Optional array of files to include. If this is set, only the files specified will be loaded.
**/
*/
public static function loadPhpFiles($dir, $files = [])
{
$dir = trim($dir, '/');
Expand Down

0 comments on commit 5709a65

Please # to comment.