Last active
February 22, 2018 12:07
-
-
Save xvilo/a23b1a5c55b1a032cea086f79a92adde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TypeCheckingObject { | |
/** @var string */ | |
private $storage = ''; | |
/** | |
* @return string | |
*/ | |
public function getStorage() : string | |
{ | |
return $this->storage; | |
} | |
/** | |
* @param string $data | |
*/ | |
public function setStorage(string $data) | |
{ | |
$this->storage = $data; | |
} | |
} | |
$obj = new TypeCheckingObject(); | |
$obj->setStorage(intval(10)); | |
var_dump($obj->getStorage()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment