コード例 #1
0
 public function test_valueOf()
 {
     foreach (TextStyle::values() as $style) {
         $this->assertEquals(TextStyle::valueOf($style->name()), $style);
     }
 }
コード例 #2
0
 /**
  * Implements JsonSerializable::jsonSerialize().
  */
 public function jsonSerialize()
 {
     $valid = !isset($this->textAlignment) || $this->validateTextAlignment($this->textAlignment);
     if (!$valid) {
         return NULL;
     }
     return parent::jsonSerialize();
 }