PHP Класс Cascade\Config\Loader\FileLoader\Json

См. также: FileLoaderAbstract
Автор: Raphael Antonmattei ([email protected])
Наследование: extends FileLoaderAbstract
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$validExtensions array Valid file extensions for this loader

Открытые методы

Метод Описание
load ( string $resource, string | null $type = null ) : array Load a JSON string/file
supports ( string $resource, string $type = null ) : boolean Return whether or not the passed in resrouce is supported by this loader

Приватные методы

Метод Описание
isJson ( string $string ) : boolean Determine whether a given string is supposed to be a Json string This is a very simplified validation to avoid calling json_decode (which is much more expensive). If the json is invalid, it will throw an exception when we actually load it.

Описание методов

load() публичный метод

Load a JSON string/file
public load ( string $resource, string | null $type = null ) : array
$resource string JSON string or file path to a JSON file
$type string | null Not used.
Результат array Array containing data from the parsed JSON string or file

supports() публичный метод

Return whether or not the passed in resrouce is supported by this loader
public supports ( string $resource, string $type = null ) : boolean
$resource string Plain string or filepath
$type string Not used
Результат boolean Whether or not the passed in resource is supported by this loader

Описание свойств

$validExtensions публичное статическое свойство

Valid file extensions for this loader
public static array $validExtensions
Результат array