Code Duplication    Length = 12-12 lines in 2 locations

src/services/traits/ModelById.php 2 locations

@@ 88-99 (lines=12) @@
85
     * @return ModelWithId|null
86
     * @throws ModelNotFoundException
87
     */
88
    public function getById(int $id, string $toScenario = null): ModelWithId
89
    {
90
91
        if (!$model = $this->findById($id, $toScenario)) {
92
93
            $this->notFoundByIdException($id);
94
95
        }
96
97
        return $model;
98
99
    }
100
101
    /**
102
     * @param int $id
@@ 126-137 (lines=12) @@
123
     * @return ModelWithId
124
     * @throws ModelNotFoundException
125
     */
126
    public function freshGetById(int $id, string $toScenario = null): ModelWithId
127
    {
128
129
        if (!$model = $this->freshFindById($id, $toScenario)) {
130
131
            $this->notFoundByIdException($id);
132
133
        }
134
135
        return $model;
136
137
    }
138
139
    /*******************************************
140
     * CACHE