| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Represents a Message/MessageValue parameter user group membership to be used with ParamType::OBJECT. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License along |
| 17 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | * http://www.gnu.org/copyleft/gpl.html |
| 20 | * |
| 21 | * @file |
| 22 | */ |
| 23 | |
| 24 | namespace MediaWiki\Message; |
| 25 | |
| 26 | use MediaWiki\User\UserIdentity; |
| 27 | use Stringable; |
| 28 | |
| 29 | /** |
| 30 | * @since 1.38 |
| 31 | * @deprecated since 1.43 Use Language::getGroupMemberName() instead |
| 32 | */ |
| 33 | class UserGroupMembershipParam implements Stringable { |
| 34 | /** @var string */ |
| 35 | private $group; |
| 36 | |
| 37 | /** @var UserIdentity */ |
| 38 | private $member; |
| 39 | |
| 40 | public function __construct( string $group, UserIdentity $member ) { |
| 41 | wfDeprecated( __CLASS__, '1.43' ); |
| 42 | $this->group = $group; |
| 43 | $this->member = $member; |
| 44 | } |
| 45 | |
| 46 | public function getGroup(): string { |
| 47 | return $this->group; |
| 48 | } |
| 49 | |
| 50 | public function getMember(): UserIdentity { |
| 51 | return $this->member; |
| 52 | } |
| 53 | |
| 54 | public function __toString() { |
| 55 | return $this->group . ':' . $this->member->getName(); |
| 56 | } |
| 57 | } |