for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Slince/China package.
*
* (c) Slince <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace China\Nationality;
class Nationality implements NationalityInterface
{
/**
* @var string
protected $name;
protected $pinyin;
* @var number
protected $population;
public function __construct($name, $pinyin, $population)
$this->name = $name;
$this->pinyin = $pinyin;
$this->population = $population;
}
* {@inheritdoc}
public function getName()
return $this->name;
public function getPinyin()
return $this->pinyin;
public function getPopulation()
return $this->population;
public function jsonSerialize()
return [
'name' => $this->name,
'pinyin' => $this->pinyin,
'population' => $this->population,
];