JsonRepository::read()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace RichanFongdasen\I18n\Repositories;
4
5
class JsonRepository extends Repository
6
{
7
    /**
8
     * Read the json datasource.
9
     *
10
     * @return array
11
     */
12
    protected function read(): array
13
    {
14
        $content = file_get_contents($this->datasource);
15
16
        return ($content !== false) ? json_decode($content) : [];
17
    }
18
}
19