public function testGetters()
 {
     $mod = new CodeInsertion(CodeInsertion::TYPE_BEFORE, '<?php codez');
     $this->assertEquals(CodeInsertion::TYPE_BEFORE, $mod->getType());
     $this->assertEquals('<?php codez', $mod->getCode());
 }
 /**
  * @param CodeInsertion $codeInsertion
  * @param array $statements
  * @return array
  */
 private function applyCodeInsertion(CodeInsertion $codeInsertion, array $statements)
 {
     try {
         $codeToInsert = $codeInsertion->getCode();
         $codeToInsert = sprintf('<?php %s', preg_replace('/^\\s*<\\?php/', '', $codeToInsert));
         $additionalStatements = $this->parser->parse($codeToInsert);
     } catch (Error $e) {
         //we should probably log this and have a dev mode or something
         return $statements;
     }
     switch ($codeInsertion->getType()) {
         case CodeInsertion::TYPE_BEFORE:
             array_unshift($statements, ...$additionalStatements);
             break;
         case CodeInsertion::TYPE_AFTER:
             array_push($statements, ...$additionalStatements);
             break;
     }
     return $statements;
 }