Соответсвие расширения файла и формата
This commit is contained in:
parent
61bc5e5709
commit
9aa5f0fa09
1 changed files with 4 additions and 1 deletions
|
|
@ -16,7 +16,10 @@ class Settings extends Collection
|
|||
|
||||
public function __construct ($file = null, $format = false)
|
||||
{
|
||||
$this->format = $format ? $format : pathinfo($file, PATHINFO_EXTENSION);
|
||||
$fileFormat = ['theme' => 'json'];
|
||||
$extname = pathinfo($file, PATHINFO_EXTENSION);
|
||||
|
||||
$this->format = $format ? $format : Arr::get($fileFormat, $extname, $extname);
|
||||
$this->file = $file;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue