Merge "Remove not used private member variable mParserWarnings from OutputPage"
[mediawiki.git] / includes / api / ApiSerializable.php
blob70e93a6c2ae692b58872f532b4af83a3ca6313e8
1 <?php
2 /**
3 * Created on Feb 25, 2015
5 * Copyright © 2015 Brad Jorsch "bjorsch@wikimedia.org"
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.
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.
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
22 * @file
25 /**
26 * This interface allows for overriding the default conversion applied by
27 * ApiResult::validateValue().
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.
34 * @ingroup API
35 * @since 1.25
37 interface ApiSerializable {
38 /**
39 * Return the value to be added to ApiResult in place of this object.
41 * The returned value must not be an object, and must pass
42 * all checks done by ApiResult::validateValue().
44 * @return mixed
46 public function serializeForApiResult();