public function __construct(Parser $parser, Config $config) { $this->config = $config; $this->parser = $parser; $this->writer = new Writer(['indentation_character' => $config->getIndentation('character') == 'tab' ? "\t" : ' ', 'indentation_size' => $config->getIndentation('size')]); // define rules $this->defaultFormatter = new DefaultFormatter($parser, $config, $this->writer); $this->commentsFormatter = new CommentsFormatter($parser, $config, $this->writer, $this->defaultFormatter); $this->indentationFormatter = new IndentationFormatter($parser, $config, $this->writer, $this->defaultFormatter); $this->newlineFormatter = new NewlineFormatter($parser, $config, $this->writer, $this->defaultFormatter); $this->whitespaceFormatter = new WhitespaceFormatter($parser, $config, $this->writer, $this->defaultFormatter); $this->blanksFormatter = new BlanksFormatter($parser, $config, $this->writer, $this->defaultFormatter); }
public function testIndentation() { $config = new Config(); $this->assertEquals('tab', $config->getIndentation('character')); }