Moar typehints

This commit is contained in:
Dylan K. Taylor
2017-07-05 18:21:04 +01:00
parent 08b8debd78
commit 8fc1501e89
14 changed files with 111 additions and 88 deletions

View File

@ -25,19 +25,27 @@ namespace pocketmine\scheduler;
class FileWriteTask extends AsyncTask{
/** @var string */
private $path;
/** @var mixed */
private $contents;
/** @var int */
private $flags;
public function __construct($path, $contents, $flags = 0){
/**
* @param string $path
* @param mixed $contents
* @param int $flags
*/
public function __construct(string $path, $contents, int $flags = 0){
$this->path = $path;
$this->contents = $contents;
$this->flags = (int) $flags;
$this->flags = $flags;
}
public function onRun(){
try{
file_put_contents($this->path, $this->contents, (int) $this->flags);
file_put_contents($this->path, $this->contents, $this->flags);
}catch(\Throwable $e){
}