Permalink
Browse files

参照渡しを要求するメソッドに値を直接渡さないように変更

  • Loading branch information...
1 parent c9c895f commit 8e7bf492ef0e625d11a72ffa22376d2346b1aa2c @mikoim mikoim committed Jul 3, 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 8e7bf49

Please sign in to comment.