pocketmine\permission\BanList::addBan PHP Method

addBan() public method

public addBan ( string $target, string $reason = null, DateTime $expires = null, string $source = null ) : BanEntry
$target string
$reason string
$expires DateTime
$source string
return BanEntry
    public function addBan($target, $reason = null, $expires = null, $source = null)
    {
        $entry = new BanEntry($target);
        $entry->setSource($source != null ? $source : $entry->getSource());
        $entry->setExpires($expires);
        $entry->setReason($reason != null ? $reason : $entry->getReason());
        $this->list[$entry->getName()] = $entry;
        $this->save();
        return $entry;
    }