# timetics/1.0.56/base/json-reader.php

Timetics – Appointment Booking Calendar &amp; Scheduling, version 1.0.56. 50 lines.

- Page: https://pluginprobe.com/plugins/timetics/1.0.56/code/base/json-reader.php
- Raw: https://pluginprobe.com/plugins/timetics/1.0.56/raw/base/json-reader.php
- Modified: 2026-04-27T10:49:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/timetics/1.0.56/code/base/json-reader.php#L10-L20`.

```php
<?php
/**
 * Read CSV file
 *
 * @package Timetics
 */
namespace Timetics\Base;

/**
 * JSON Reader Class
 */
class JsonReader implements FileReaderInterface {
    /**
     * Store file
     *
     * @var string
     */
    private static $file;

    /**
     * Get data that will be read from json file
     *
     * @param   file  $file
     *
     * @return  array
     */
    public static function get_data( $file ) {
        self::$file = $file;

        return self::read_file();
    }

    /**
     * Get from file
     *
     * @return  array
     */
    private static function read_file() {
        $file    = self::$file;
        $data    = [];
        $content = file_get_contents( $file );

        if ( $content ) {
            $data = json_decode( $content, true );
        }

        return $data;
    }
}

```
