Skip to content

Commit

Permalink
Improve loadData method
Browse files Browse the repository at this point in the history
  • Loading branch information
DvogelHallowelt committed Aug 20, 2024
1 parent 0317545 commit 05ce096
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Workspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ public function __construct( SplFileInfo $workspaceDir ) {
/**
*
* @param string $filename
* @param string $path
* @return array
*/
public function loadData( $filename ): array {
public function loadData( $filename, $path = '' ): array {
$filepathname = $this->makeFilepathname( $filename );
if ( $path !== '' ) {
$filepathname = "$path/$filepathname";
}
$data = [];
if ( file_exists( $filepathname ) ) {
$data = require $filepathname;
Expand Down

0 comments on commit 05ce096

Please sign in to comment.