Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2/**
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15 */
16
17namespace ORES\Storage;
18
19/**
20 * Service interface to store score data in storage.
21 *
22 * @license GPL-3.0-or-later
23 */
24interface ScoreStorage {
25
26    /**
27     * Save scores to the database
28     *
29     * @param array[] $scores in the same structure as is returned by ORES.
30     * @param callable|null $errorCallback This callback is called when we cannot parse a revision
31     *   score response. The signature is errorCallback( string $errorMessage, string $revisionID )
32     * @param string[] $modelsToClean Models that need cleanup of old scores after inserting new ones
33     */
34    public function storeScores( $scores, callable $errorCallback = null, array $modelsToClean = [] );
35
36    /**
37     * Purge a given set of revision ids.
38     *
39     * @param int[] $revIds array of revision ids to remove from cached scores
40     */
41    public function purgeRows( array $revIds );
42
43}