コード例 #1
0
ファイル: Field.php プロジェクト: eddmash/powerorm
 public function _checkFieldName()
 {
     $errors = [];
     if (!StringHelper::isValidVariableName($this->name)) {
         $errors = [CheckError::createObject(['message' => sprintf(' "%s" is not a valid field name on model %s .', $this->name, $this->scopeModel->getFullClassName()), 'hint' => null, 'context' => $this, 'id' => 'fields.E001'])];
     }
     return $errors;
 }
コード例 #2
0
ファイル: StringsTest.php プロジェクト: eddmash/powerorm
 /**
  * @dataProvider providerValidVariableName
  *
  * @param $originalString
  * @param $expectedString
  *
  * @since 1.1.0
  *
  * @author Eddilbert Macharia (http://eddmash.com) <*****@*****.**>
  */
 public function testIsValidVariableName($originalString)
 {
     $this->assertTrue(StringHelper::isValidVariableName($originalString));
 }