swekaj / php-foldexpr.vim

Vim folding for PHP with foldexpr
MIT License
41 stars 10 forks source link

[] passed to method confused folding #8

Closed swekaj closed 10 years ago

swekaj commented 10 years ago

There appears to be a bug when there's a ([ ]) fold.

 function let(Config $config)
 {
     $config
         ->get(strtolower($this->module).'.buildable')
         ->willReturn([
             $this->classname,
             []
         ]);
     $config
         ->get(strtolower($this->nonexistentModule).'.buildable')
         ->willReturn([
             $this->nonexistantClassname,
             []
         ]);
     $config
         ->get(strtolower($this->moduleWithGoodConstruct).'.buildable')
         ->willReturn([
             $this->moduleWithGoodConstructClassname,
             [
                 'arg1',
                 'named' => 'arg'
             ]
         ]);
     $config
         ->get(strtolower($this->moduleWithBadConstruct).'.buildable')
         ->willReturn([
             $this->moduleWithBadConstructClassname,
             'badConstruct'
         ]);
     $this->beConstructedWith($config);
 }

resulted in

     function let(Config $config)
     {
         $config
             ->get(strtolower($this->module).'.buildable')
 +--- 27 lines:  ->willReturn([...}-----------------------------