private function verifyAndSave()
    {
        $this->pharValidator->assertPharValid($this->tmpPharPath);

        if (!@rename($this->tmpPharPath, $this->target)) {
            throw new RuntimeException(
                sprintf(
                    'Could not write to file "%s": %s',
                    $this->target,
                    @error_get_last()['message']
                )
            );
        }
        if (!@rename($this->tmpPubkeyPath, $this->target . '.pubkey')) {
            throw new RuntimeException(
                sprintf(
                    'Could not write to file "%s": %s',
                    $this->target,
                    @error_get_last()['message']
                )
            );
        }

        chmod($this->target, 0755);
    }