protected function addBinFile($phar, $binFile)
    {
        $relativeBinFile = str_replace($this->projectPath, '', $binFile);
        $this->logger->log('<comment>Adding file</comment> ' . $relativeBinFile);

        $content = file_get_contents($binFile);
        $content = preg_replace('{^#!/usr/bin/env php\s*}', '', $content);

        $phar->addFromString($relativeBinFile, $content);
        $this->increaseFileCounter();
    }