public static function from($repoDir)
 {
     // ask Git for the details
     $result = ExecInGitRepo::run($repoDir, ['git', 'branch', '--no-color']);
     // tidy up the returned text
     $branches = explode(PHP_EOL, $result->getOutput(), -1);
     $branches = ReplaceMatchingRegex::in($branches, '/^\\* /', '');
     $branches = TrimWhitespace::from($branches);
     // all done
     return $branches;
 }
 /**
  * @covers ::inArray
  * @dataProvider provideTraversablesToEdit
  */
 public function testCanProcessTraversables($data, $match, $replacement, $expectedResult)
 {
     // ----------------------------------------------------------------
     // setup your test
     $obj = new ReplaceMatchingRegex();
     // ----------------------------------------------------------------
     // perform the change
     $actualResult1 = $obj($data, $match, $replacement);
     $actualResult2 = ReplaceMatchingRegex::in($data, $match, $replacement);
     // ----------------------------------------------------------------
     // test the results
     $this->assertEquals($expectedResult, $actualResult1);
     $this->assertEquals($expectedResult, $actualResult2);
 }