private function getAppVersion($dir)
    {
        $version = null;

        /** @var SplFileInfo $composerFile */
        $composerFile = new SplFileInfo($dir . '/composer.json', '', '');
        if (!$composerFile->isFile()) {
            return $version;
        }

        $composerJson = json_decode($composerFile->getContents(), true);
        if (!array_key_exists('version', $composerJson)) {
            return $version;
        }

        return $composerJson['version'];
    }