-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d15837
commit b2f1dc7
Showing
18 changed files
with
187 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Imanghafoori\LaravelMicroscope\FileReaders; | ||
|
||
use JetBrains\PhpStorm\Pure; | ||
use Symfony\Component\Finder\Finder as SymfonyFinder; | ||
|
||
class PhpFinder | ||
{ | ||
public static $basePath = ''; | ||
|
||
public static $fileName = '*'; | ||
|
||
/** | ||
* get all ".php" files in directory by giving a path. | ||
* | ||
* @param string $path Directory path | ||
* @return \Symfony\Component\Finder\Finder | ||
*/ | ||
#[Pure] | ||
public static function getAllPhpFiles($path, $basePath = '') | ||
{ | ||
if ($basePath === '') { | ||
$basePath = self::$basePath; | ||
} | ||
|
||
$basePath = rtrim($basePath, '/\\'); | ||
$path = ltrim($path, '/\\'); | ||
$path = $basePath.DIRECTORY_SEPARATOR.$path; | ||
|
||
try { | ||
return SymfonyFinder::create()->files()->name(self::$fileName.'.php')->in($path); | ||
} catch (Exception $e) { | ||
return []; | ||
} | ||
} | ||
} |
Oops, something went wrong.