src/Sulu/Component/Util/SuluVersionPass.php
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'];
    }
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'];
    }
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' ] ; }
Read composer.json file and return version of app.

@param string $dir

@return string
Read composer . json file and return version of app .