library/Garp/Service/Sentry.php
protected function _readGarpVersion() {
        $versionInCaseOfError = 'v0.0.0';
        $lockFilePath = APPLICATION_PATH . '/../composer.lock';
        if (!file_exists($lockFilePath)) {
            return $versionInCaseOfError;
        }
        $lockFile = json_decode(file_get_contents($lockFilePath), true);
        $packages = $lockFile['packages'];

        return array_reduce(
            $packages,
            function ($prevVersion, $package) {
                // Found Garp? Return its version
                if ($package['name'] === 'grrr-amsterdam/garp3') {
                    return $package['version'];
                }
                // Otherwise return whatever version we previously got
                return $prevVersion;
            },
            // Initial value
            $versionInCaseOfError
        );
    }
protected function _readGarpVersion() {
        $versionInCaseOfError = 'v0.0.0';
        $lockFilePath = APPLICATION_PATH . '/../composer.lock';
        if (!file_exists($lockFilePath)) {
            return $versionInCaseOfError;
        }
        $lockFile = json_decode(file_get_contents($lockFilePath), true);
        $packages = $lockFile['packages'];

        return array_reduce(
            $packages,
            function ($prevVersion, $package) {
                // Found Garp? Return its version
                if ($package['name'] === 'grrr-amsterdam/garp3') {
                    return $package['version'];
                }
                // Otherwise return whatever version we previously got
                return $prevVersion;
            },
            // Initial value
            $versionInCaseOfError
        );
    }
protected function _readGarpVersion ( ) { $ versionInCaseOfError = 'v0.0.0' ; $ lockFilePath = APPLICATION_PATH . '/../composer.lock' ; if ( ! file_exists ( $ lockFilePath ) ) { return $ versionInCaseOfError ; } $ lockFile = json_decode ( file_get_contents ( $ lockFilePath ) , true ) ; $ packages = $ lockFile [ 'packages' ] ; return array_reduce ( $ packages , function ( $ prevVersion , $ package ) { // Found Garp? Return its version if ( $ package [ 'name' ] === 'grrr-amsterdam/garp3' ) { return $ package [ 'version' ] ; } // Otherwise return whatever version we previously got return $ prevVersion ; } , // Initial value $ versionInCaseOfError ) ; }
Read Garp version from composer.lock. This will be available when Garp is installed as
dependency of some app.

@return string
Read Garp version from composer . lock . This will be available when Garp is installed as dependency of some app .