src/Field.php
private function _getConfig(string $dir, string $file = null)
    {
        if (!$file) {
            return false;
        }

        $path = Craft::$app->getPath()->getConfigPath().DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.$file;

        if (!is_file($path)) {
            return false;
        }

        return Json::decode(file_get_contents($path));
    }
private function _getConfig(string $dir, string $file = null)
    {
        if (!$file) {
            return false;
        }

        $path = Craft::$app->getPath()->getConfigPath().DIRECTORY_SEPARATOR.$dir.DIRECTORY_SEPARATOR.$file;

        if (!is_file($path)) {
            return false;
        }

        return Json::decode(file_get_contents($path));
    }
private function _getConfig ( string $ dir , string $ file = null ) { if ( ! $ file ) { return false ; } $ path = Craft :: $ app -> getPath ( ) -> getConfigPath ( ) . DIRECTORY_SEPARATOR . $ dir . DIRECTORY_SEPARATOR . $ file ; if ( ! is_file ( $ path ) ) { return false ; } return Json :: decode ( file_get_contents ( $ path ) ) ; }
Returns a JSON-decoded config, if it exists.

@param string $dir The directory name within the config/ folder to look for the config file
@param string|null $file The filename to load
@return array|false The config, or false if the file doesn't exist
Returns a JSON - decoded config if it exists .