コード例 #1
0
ファイル: Builder.php プロジェクト: Rmtram/TextDatabase
 /**
  * @param string $table
  * @param \Closure $closure
  * @return bool
  */
 public function table($table, \Closure $closure)
 {
     Validator::type('string')->assert($table);
     Validator::regex('/^[A-Za-z_]+$/')->assert($table);
     /** @var Schema $schema */
     $schema = new $this->schemaClassName();
     $closure($schema);
     $writer = new SchemaWriter($table, $schema);
     return $writer->write($this->overwrite);
 }
コード例 #2
0
ファイル: WorkerCfg.php プロジェクト: bsmrs/bughunter
 /**
  * @param Integer $increment
  * @return WorkerCfg
  */
 public function setIncrement($increment)
 {
     Validator::type('int')->between(1, 65535, true)->check($increment);
     $this->increment = $increment;
     return $this;
 }
コード例 #3
0
ファイル: Variable.php プロジェクト: Rmtram/TextDatabase
 private function assertName($name)
 {
     Validator::notEmpty()->assert($name);
     Validator::type('string')->assert($name);
     Validator::regex('/^[A-Za-z_]+$/')->assert($name);
 }