Permalink
Browse files

Merge pull request #50 from mikoim/notify

参照渡しを要求するメソッドに値を直接渡さないように変更
  • Loading branch information...
2 parents c9c895f + 8e7bf49 commit 798ad3e1dbb3554c724d61387686ac5965db17ad @logue committed on GitHub Jul 4, 2016
@@ -35,7 +35,9 @@ public function __construct($tag, $tag2, $head, $text)
$this->level = min(3, strspn($text, $head));
$text = ltrim(substr($text, $this->level));
- parent::insert(new ListElement($this->level, $tag2));
+ $element = new ListElement($this->level, $tag2);
+
+ parent::insert($element);
if ( !empty($text) )
$this->last = $this->last->insert(ElementFactory::factory('InlineElement', null, $text));
}
@@ -124,7 +124,8 @@ public function parse($lines)
// Heading
if ($head === '*') {
- $this->insert(new Heading($this, $line));
+ $heading = new Heading($this, $line);
+ $this->insert($heading);
continue;
}
@@ -237,7 +238,8 @@ public function getAnchor($text, $level)
//var_dump($text, $id, $level);
// Add 'page contents' link to its heading
- $this->contents_last = $this->contents_last->add(new ContentsList($_text, $level, $id));
+ $contents = new ContentsList($_text, $level, $id);
+ $this->contents_last = $this->contents_last->add($contents);
// Add heding
return array($_text . $anchor, $this->count > 1 ? "\n" . $top : '', $autoid);

0 comments on commit 798ad3e

Please sign in to comment.