diff --git a/include/wb/Label.php b/include/wb/Label.php index 5cf8b92..3e6dd6d 100644 --- a/include/wb/Label.php +++ b/include/wb/Label.php @@ -1,69 +1,69 @@ . # Wikibase namespace wb; /** * An entity Label. * * @see https://www.wikidata.org/wiki/Wikidata:Glossary#Label */ class Label { - var $language; - var $value; + public $language; + public $value; public function __construct( $language, $value ) { $this->setLanguage( $language ) ->setValue( $value ); } public function getLanguage() { return $this->language; } public function getValue() { return $this->value; } public function setLanguage( $language ) { $this->language = $language; return $this; } public function setValue( $value ) { $this->value = $value; return $this; } public static function createFromData( $data ) { if( ! isset( $data['language'], $data['value'] ) ) { throw new WrongDataException( self::class ); } return new static( $data['language'], $data['value'] ); } /** * String rappresentation * * @return string */ public function __toString() { return sprintf( '%s: %s', $this->getLanguage(), $this->getValue() ); } }