<?php namespace Demo; class User { protected $id; public function __construct(int $id) { $this->id = $id; } /** * @return int */ public function getId(): int { return $this->id; } }