コード例 #1
0
 /**
  * @param string  $comment
  * @param boolean $internal
  */
 public function __construct($comment, $internal = false)
 {
     Assert\lazy()->that($comment, 'comment')->notEmpty()->string()->that($internal, 'internal')->boolean()->verifyNow();
     $this->comment = $comment;
     $this->internal = $internal;
     $this->createdAt = new \DateTime('now');
 }
コード例 #2
0
ファイル: Achievement.php プロジェクト: minecraftphp/commands
 /**
  * @param string $type
  * @param string $statName
  * @param string $player
  */
 public function __construct($type, $statName, $player)
 {
     Assert\lazy()->that($type, 'type')->string()->choice([self::GIVE, self::TAKE])->that($statName, 'statName')->notEmpty()->string()->that($player, 'player')->notEmpty()->string()->verifyNow();
     $this->type = $type;
     $this->statName = $statName;
     $this->player = $player;
 }
コード例 #3
0
 /**
  * @param string    $customerName
  * @param string    $customerPhone
  * @param string    $customerEmail
  * @param \DateTime $estimatedEnd
  * @param string    $description
  */
 public function __construct($customerName, $customerPhone, $customerEmail, \DateTime $estimatedEnd, $description = null)
 {
     \Assert\lazy()->that($customerName, 'customerName')->notEmpty()->string()->that($customerPhone, 'customerPhone')->notEmpty()->string()->that($customerEmail, 'customerEmail')->email()->that($description, 'description')->nullOr()->string()->verifyNow();
     $this->customerName = $customerName;
     $this->customerPhone = $customerPhone;
     $this->customerEmail = $customerEmail;
     $this->estimatedEnd = $estimatedEnd;
     $this->description = $description;
     $this->createdAt = new \DateTime('now');
     $this->comments = new ArrayCollection();
 }
コード例 #4
0
ファイル: Ban.php プロジェクト: minecraftphp/commands
 /**
  * @param string      $player
  * @param string|null $reason
  */
 public function __construct($player, $reason = null)
 {
     Assert\lazy()->that($player, 'player')->notEmpty()->string()->that($reason, 'reason')->nullOr()->string()->verifyNow();
     $this->player = $player;
     $this->reason = $reason;
 }
コード例 #5
0
ファイル: Banlist.php プロジェクト: minecraftphp/commands
 /**
  * @param string $list
  */
 public function __construct($list)
 {
     Assert\lazy()->that($list, 'list')->notEmpty()->choice(['ips', 'players'])->verifyNow();
     $this->list = $list;
 }
コード例 #6
0
 /**
  * @param string $username
  * @param string $password
  */
 public function __construct($username, $password)
 {
     Assert\lazy()->that($username, 'username')->string()->that($password, 'password')->string()->verifyNow();
     $this->username = $username;
     $this->password = $password;
 }
コード例 #7
0
ファイル: BanIp.php プロジェクト: minecraftphp/commands
 /**
  * @param string      $address
  * @param string|null $reason
  */
 public function __construct($address, $reason = null)
 {
     Assert\lazy()->that($address, 'address')->notEmpty()->string()->that($reason, 'reason')->nullOr()->string()->verifyNow();
     $this->address = $address;
     $this->reason = $reason;
 }