protected function addFile($phar, $file, $strip = true)
    {
        $path = strtr(str_replace($this->projectPath, '', $file->getRealPath()), '\\', '/');
        $content = file_get_contents($file);

        $this->logger->log('<comment>Adding file</comment> ' . $path);

        switch (true) {
            case ('LICENSE' === basename($file)):
                $content = "\n" . $content . "\n";
                break;

            case preg_match('#/In2pire/Cli/Configuration/PhpConfiguration.php$#', $path):
                if ($this->flag & STATIC::FLAG_CACHE) {
                    $configuration = $this->getAllConfiguration();
                    $content = str_replace('// [CONFIGURATION]', '$this->configuration = ' . var_export($configuration, 1) . ';', $content);
                    $content = str_replace(['@version', '@build'], [$this->buildVersion, $this->buildDate], $content);
                }
                break;

            case (pathinfo($file, PATHINFO_EXTENSION) == 'yml'):
                $content = str_replace(['@version', '@build'], [$this->buildVersion, $this->buildDate], $content);
                break;

            case $strip:
                $content = $this->stripWhitespace($content);
                break;
        }

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