Code Duplication    Length = 13-13 lines in 2 locations

src/Version.php 1 location

@@ 69-81 (lines=13) @@
66
     * @return Object
67
     * @throws Exception
68
     */
69
    protected function getStructure()
70
    {
71
        if (!$this->structure) {
72
            if (!is_file($this->getComposerPath())) {
73
                throw new Exception('composer.lock does not exist');
74
            }
75
            $this->structure = json_decode(file_get_contents($this->getComposerPath()));
76
            if (!$this->structure) {
77
                throw new Exception('composer.lock invalid structure');
78
            }
79
        }
80
        return $this->structure;
81
    }
82
}
83

src/ProjectVersion.php 1 location

@@ 100-112 (lines=13) @@
97
     * Get composer file structure
98
     * @return Object
99
     */
100
    protected function getStructure()
101
    {
102
        if (!$this->structure) {
103
            if (!is_file($this->getComposerPath())) {
104
                throw new \LogicException('composer.json does not exist');
105
            }
106
            $this->structure = json_decode(file_get_contents($this->getComposerPath()));
107
            if (!$this->structure) {
108
                throw new \LogicException('composer.json invalid structure');
109
            }
110
        }
111
        return $this->structure;
112
    }
113
}
114