]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - includes/api/ApiSerializable.php
MediaWiki 1.30.2-scripts2
[autoinstalls/mediawiki.git] / includes / api / ApiSerializable.php
1 <?php
2 /**
3  * Created on Feb 25, 2015
4  *
5  * Copyright © 2015 Wikimedia Foundation and contributors
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  * http://www.gnu.org/copyleft/gpl.html
21  *
22  * @file
23  */
24
25 /**
26  * This interface allows for overriding the default conversion applied by
27  * ApiResult::validateValue().
28  *
29  * @note This is currently an informal interface; it need not be explicitly
30  *   implemented, as long as the method is provided. This allows for extension
31  *   code to maintain compatibility with older MediaWiki while still taking
32  *   advantage of this where it exists.
33  *
34  * @ingroup API
35  * @since 1.25
36  */
37 interface ApiSerializable {
38         /**
39          * Return the value to be added to ApiResult in place of this object.
40          *
41          * The returned value must not be an object, and must pass
42          * all checks done by ApiResult::validateValue().
43          *
44          * @return mixed
45          */
46         public function serializeForApiResult();
47 }