Example #1
0
 /**
  * @expectedException \LogicException
  */
 public function testSetContentInvalidContent()
 {
     $obj = new KeyValueNode();
     $obj->setContent('; invalid');
 }
Example #2
0
File: Ini.php Project: sagephp/ini
 /**
  * adds a key/value node
  *
  * @param string $key
  * @param string $value
  * @param string $section
  * @param string $comment
  */
 public function set($key, $value, $section = null, $comment = '')
 {
     if ($this->hasKey($key, $section)) {
         $this->remove($key, $section);
     }
     if (strlen($comment) > 0) {
         $comment = ' ; ' . $comment;
     }
     $node = new KeyValueNode();
     $node->setContent($key . '=' . $value . $comment);
     $this->appendToSection($node, $section);
 }