Code Duplication    Length = 12-12 lines in 2 locations

src/services/ModelByHandle.php 2 locations

@@ 96-107 (lines=12) @@
93
     * @return ModelWithHandle|null
94
     * @throws ModelNotFoundException
95
     */
96
    public function getByHandle(string $handle, string $toScenario = null): ModelWithHandle
97
    {
98
99
        if (!$model = $this->findByHandle($handle, $toScenario)) {
100
101
            $this->notFoundByHandleException($handle);
102
103
        }
104
105
        return $model;
106
107
    }
108
109
    /**
110
     * @param string $handle
@@ 135-146 (lines=12) @@
132
     * @return ModelWithHandle
133
     * @throws ModelNotFoundException
134
     */
135
    public function freshGetByHandle(string $handle, string $toScenario = null): ModelWithHandle
136
    {
137
138
        if (!$model = $this->freshFindByHandle($handle, $toScenario)) {
139
140
            $this->notFoundByHandleException($handle);
141
142
        }
143
144
        return $model;
145
146
    }
147
148
    /*******************************************
149
     * CACHE