<?php











namespace Composer;

use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;






class InstalledVersions
{
private static $installed = array (
  'root' => 
  array (
    'pretty_version' => '1.18.2',
    'version' => '1.18.2.0',
    'aliases' => 
    array (
    ),
    'reference' => NULL,
    'name' => 'baluart/easyforms',
  ),
  'versions' => 
  array (
    '2amigos/2fa-library' => 
    array (
      'pretty_version' => '1.0.3',
      'version' => '1.0.3.0',
      'aliases' => 
      array (
      ),
      'reference' => 'd74e8cd99021d5b994a2690a82298627a1017305',
    ),
    '2amigos/qrcode-library' => 
    array (
      'pretty_version' => '1.1.2',
      'version' => '1.1.2.0',
      'aliases' => 
      array (
      ),
      'reference' => '5356f2355c7ba9a9ced67753411c88c2c095deb0',
    ),
    '2amigos/yii2-flysystem-component' => 
    array (
      'pretty_version' => '1.0.0',
      'version' => '1.0.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '1dfa1bcbd4790fa8b4404c7745bc6f8a8ac5dec9',
    ),
    '2amigos/yii2-selectize-widget' => 
    array (
      'pretty_version' => '1.1.0',
      'version' => '1.1.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '9762a34d1095f15b60f46b876dad245011755bfc',
    ),
    '2amigos/yii2-usuario' => 
    array (
      'pretty_version' => '1.5.1',
      'version' => '1.5.1.0',
      'aliases' => 
      array (
      ),
      'reference' => 'e2b041a32a9cd248c7849ff6cfb12a2f60822b57',
    ),
    'adyen/php-api-library' => 
    array (
      'pretty_version' => '6.0.1',
      'version' => '6.0.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '6aad932a6daa8167dcbe26b99b7220a1a0cbc0f9',
    ),
    'bacon/bacon-qr-code' => 
    array (
      'pretty_version' => '1.0.3',
      'version' => '1.0.3.0',
      'aliases' => 
      array (
      ),
      'reference' => '5a91b62b9d37cee635bbf8d553f4546057250bee',
    ),
    'baluart/easyforms' => 
    array (
      'pretty_version' => '1.18.2',
      'version' => '1.18.2.0',
      'aliases' => 
      array (
      ),
      'reference' => NULL,
    ),
    'bower-asset/bootstrap' => 
    array (
      'pretty_version' => 'v3.4.1',
      'version' => '3.4.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '68b0d231a13201eb14acd3dc84e51543d16e5f7e',
    ),
    'bower-asset/inputmask' => 
    array (
      'pretty_version' => '3.3.11',
      'version' => '3.3.11.0',
      'aliases' => 
      array (
      ),
      'reference' => '5e670ad62f50c738388d4dcec78d2888505ad77b',
    ),
    'bower-asset/jquery' => 
    array (
      'pretty_version' => '3.6.0',
      'version' => '3.6.0.0',
      'aliases' => 
      array (
      ),
      'reference' => 'e786e3d9707ffd9b0dd330ca135b66344dcef85a',
    ),
    'bower-asset/jquery-ui' => 
    array (
      'pretty_version' => '1.12.1',
      'version' => '1.12.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '44ecf3794cc56b65954cc19737234a3119d036cc',
    ),
    'bower-asset/microplugin' => 
    array (
      'pretty_version' => 'v0.0.3',
      'version' => '0.0.3.0',
      'aliases' => 
      array (
      ),
      'reference' => 'd8671e6cc769938648f8735610534427cdeeaf67',
    ),
    'bower-asset/punycode' => 
    array (
      'pretty_version' => 'v1.3.2',
      'version' => '1.3.2.0',
      'aliases' => 
      array (
      ),
      'reference' => '38c8d3131a82567bfef18da09f7f4db68c84f8a3',
    ),
    'bower-asset/selectize' => 
    array (
      'pretty_version' => '0.12.6-patch1',
      'version' => '0.12.6.0-patch1',
      'aliases' => 
      array (
      ),
      'reference' => 'b8df29c9d4733857a4df4ddbf40d72abfd7c3ae9',
    ),
    'bower-asset/sifter' => 
    array (
      'pretty_version' => 'v0.5.4',
      'version' => '0.5.4.0',
      'aliases' => 
      array (
      ),
      'reference' => '2009705c24ba9bb0fbe71fa3c60b1dfa682538d2',
    ),
    'bower-asset/yii2-pjax' => 
    array (
      'pretty_version' => '2.0.7.1',
      'version' => '2.0.7.1',
      'aliases' => 
      array (
      ),
      'reference' => 'aef7b953107264f00234902a3880eb50dafc48be',
    ),
    'cebe/markdown' => 
    array (
      'pretty_version' => '1.2.1',
      'version' => '1.2.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '9bac5e971dd391e2802dca5400bbeacbaea9eb86',
    ),
    'composer/ca-bundle' => 
    array (
      'pretty_version' => '1.3.4',
      'version' => '1.3.4.0',
      'aliases' => 
      array (
      ),
      'reference' => '69098eca243998b53eed7a48d82dedd28b447cd5',
    ),
    'ezyang/htmlpurifier' => 
    array (
      'pretty_version' => 'v4.16.0',
      'version' => '4.16.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '523407fb06eb9e5f3d59889b3978d5bfe94299c8',
    ),
    'faisalman/simple-excel-php' => 
    array (
      'pretty_version' => 'v0.3.15',
      'version' => '0.3.15.0',
      'aliases' => 
      array (
      ),
      'reference' => 'c392d9ee34cce210f034c9a9ef814f635320351c',
    ),
    'geoip2/geoip2' => 
    array (
      'pretty_version' => 'v2.10.0',
      'version' => '2.10.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '419557cd21d9fe039721a83490701a58c8ce784a',
    ),
    'giggsey/libphonenumber-for-php' => 
    array (
      'pretty_version' => '8.13.3',
      'version' => '8.13.3.0',
      'aliases' => 
      array (
      ),
      'reference' => 'f40e7696c207ec37465a9e841dd9d3b0a8e9c781',
    ),
    'giggsey/locale' => 
    array (
      'pretty_version' => '1.9',
      'version' => '1.9.0.0',
      'aliases' => 
      array (
      ),
      'reference' => 'b07f1eace8072ccc61445ad8fbd493ff9d783043',
    ),
    'guzzlehttp/psr7' => 
    array (
      'pretty_version' => '1.9.0',
      'version' => '1.9.0.0',
      'aliases' => 
      array (
      ),
      'reference' => 'e98e3e6d4f86621a9b75f623996e6bbdeb4b9318',
    ),
    'intervention/image' => 
    array (
      'pretty_version' => '2.7.2',
      'version' => '2.7.2.0',
      'aliases' => 
      array (
      ),
      'reference' => '04be355f8d6734c826045d02a1079ad658322dad',
    ),
    'kartik-v/bootstrap-fileinput' => 
    array (
      'pretty_version' => 'v5.5.2',
      'version' => '5.5.2.0',
      'aliases' => 
      array (
      ),
      'reference' => '35c29cd9fd5bc47eae5238feaabee95b2d7efe3c',
    ),
    'kartik-v/dependent-dropdown' => 
    array (
      'pretty_version' => 'v1.4.9',
      'version' => '1.4.9.0',
      'aliases' => 
      array (
      ),
      'reference' => '54a8806002ee21b744508a2edb95ed01d35c6cf9',
    ),
    'kartik-v/php-date-formatter' => 
    array (
      'pretty_version' => 'v1.3.6',
      'version' => '1.3.6.0',
      'aliases' => 
      array (
      ),
      'reference' => '514a53660b0d69439236fd3cbc3f41512adb00a0',
    ),
    'kartik-v/yii2-builder' => 
    array (
      'pretty_version' => 'v1.6.9',
      'version' => '1.6.9.0',
      'aliases' => 
      array (
      ),
      'reference' => '616c2f8d322a45c037a4d32f0ee1eb1457865e73',
    ),
    'kartik-v/yii2-date-range' => 
    array (
      'pretty_version' => 'v1.7.3',
      'version' => '1.7.3.0',
      'aliases' => 
      array (
      ),
      'reference' => '7d80d6e2598e252487fe1acf911b8cb43f45e3b1',
    ),
    'kartik-v/yii2-datecontrol' => 
    array (
      'pretty_version' => 'v1.9.9',
      'version' => '1.9.9.0',
      'aliases' => 
      array (
      ),
      'reference' => '88ac2401ce1858b0da98b498197373691953c3d6',
    ),
    'kartik-v/yii2-detail-view' => 
    array (
      'pretty_version' => 'v1.8.7',
      'version' => '1.8.7.0',
      'aliases' => 
      array (
      ),
      'reference' => '0b130581bce1ff26a98750433489cdc4816080a1',
    ),
    'kartik-v/yii2-dialog' => 
    array (
      'pretty_version' => 'v1.0.6',
      'version' => '1.0.6.0',
      'aliases' => 
      array (
      ),
      'reference' => '510c3a35ffe79987cde9a9366cedbff545fd92d4',
    ),
    'kartik-v/yii2-grid' => 
    array (
      'pretty_version' => 'v3.5.0',
      'version' => '3.5.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '7f8c9270dde525b60960b8c4cb2d40d861b3bdb9',
    ),
    'kartik-v/yii2-helpers' => 
    array (
      'pretty_version' => 'v1.3.9',
      'version' => '1.3.9.0',
      'aliases' => 
      array (
      ),
      'reference' => '0bec7a97bf9d0293d96be5c496fe9654c4dec94b',
    ),
    'kartik-v/yii2-krajee-base' => 
    array (
      'pretty_version' => 'v3.0.5',
      'version' => '3.0.5.0',
      'aliases' => 
      array (
      ),
      'reference' => '5c095126d1be47e0bb1f92779b7dc099f6feae31',
    ),
    'kartik-v/yii2-slider' => 
    array (
      'pretty_version' => 'v1.3.2',
      'version' => '1.3.2.0',
      'aliases' => 
      array (
      ),
      'reference' => '81a2463294fa88a58d0ed8214254c8a6b63b7e89',
    ),
    'kartik-v/yii2-widget-activeform' => 
    array (
      'pretty_version' => 'v1.6.2',
      'version' => '1.6.2.0',
      'aliases' => 
      array (
      ),
      'reference' => '98dbf789c9f71a35c76a8c2b667e86815ae51ac1',
    ),
    'kartik-v/yii2-widget-colorinput' => 
    array (
      'pretty_version' => 'v1.0.6',
      'version' => '1.0.6.0',
      'aliases' => 
      array (
      ),
      'reference' => 'e35e6c7615a735b65557d6c38d112b77e2628c69',
    ),
    'kartik-v/yii2-widget-datepicker' => 
    array (
      'pretty_version' => 'v1.4.8',
      'version' => '1.4.8.0',
      'aliases' => 
      array (
      ),
      'reference' => 'f5f8b396cf03d4a383aad5e7b338f8cb065abf66',
    ),
    'kartik-v/yii2-widget-datetimepicker' => 
    array (
      'pretty_version' => 'v1.5.1',
      'version' => '1.5.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '85b22d38553ca207f86be198f37e6531347e9a23',
    ),
    'kartik-v/yii2-widget-depdrop' => 
    array (
      'pretty_version' => 'v1.0.6',
      'version' => '1.0.6.0',
      'aliases' => 
      array (
      ),
      'reference' => 'ea347e3793fbd8273cc9bd1eb94c4b32bb55d318',
    ),
    'kartik-v/yii2-widget-fileinput' => 
    array (
      'pretty_version' => 'v1.1.1',
      'version' => '1.1.1.0',
      'aliases' => 
      array (
      ),
      'reference' => 'b5500b6855526837154694c2afab8dbc3afc8abd',
    ),
    'kartik-v/yii2-widget-select2' => 
    array (
      'pretty_version' => 'v2.2.4',
      'version' => '2.2.4.0',
      'aliases' => 
      array (
      ),
      'reference' => 'f74f2cfbd5b4628ea578735890c39f9a8e4ed062',
    ),
    'kartik-v/yii2-widget-sidenav' => 
    array (
      'pretty_version' => 'v1.0.1',
      'version' => '1.0.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '87e9c815624aa966d70bb4507b3d53c158db0d43',
    ),
    'kartik-v/yii2-widget-switchinput' => 
    array (
      'pretty_version' => 'v1.3.1',
      'version' => '1.3.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '7d8ee999d79bcdc1601da5cd59439ac7eb1f5ea6',
    ),
    'khanamiryan/qrcode-detector-decoder' => 
    array (
      'pretty_version' => '1.0.6',
      'version' => '1.0.6.0',
      'aliases' => 
      array (
      ),
      'reference' => '45326fb83a2a375065dbb3a134b5b8a5872da569',
    ),
    'kylekatarnls/update-helper' => 
    array (
      'pretty_version' => '1.2.1',
      'version' => '1.2.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '429be50660ed8a196e0798e5939760f168ec8ce9',
    ),
    'league/flysystem' => 
    array (
      'pretty_version' => '1.0.70',
      'version' => '1.0.70.0',
      'aliases' => 
      array (
      ),
      'reference' => '585824702f534f8d3cf7fab7225e8466cc4b7493',
    ),
    'matomo/network' => 
    array (
      'pretty_version' => '2.0.1',
      'version' => '2.0.1.0',
      'aliases' => 
      array (
      ),
      'reference' => 'ff654b8fc7778b80279815d06a368f7b41249501',
    ),
    'matomo/referrer-spam-blacklist' => 
    array (
      'pretty_version' => '3.11.0',
      'version' => '3.11.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '0968ea308924ed4b9c636133fff9eb54820626f7',
    ),
    'maxmind-db/reader' => 
    array (
      'pretty_version' => 'v1.6.0',
      'version' => '1.6.0.0',
      'aliases' => 
      array (
      ),
      'reference' => 'febd4920bf17c1da84cef58e56a8227dfb37fbe4',
    ),
    'maxmind/web-service-common' => 
    array (
      'pretty_version' => 'v0.7.0',
      'version' => '0.7.0.0',
      'aliases' => 
      array (
      ),
      'reference' => '74c996c218ada5c639c8c2f076756e059f5552fc',
    ),
    'monolog/monolog' => 
    array (
      'pretty_version' => '1.27.1',
      'version' => '1.27.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '904713c5929655dc9b97288b69cfeedad610c9a1',
    ),
    'mustangostang/spyc' => 
    array (
      'pretty_version' => '0.6.3',
      'version' => '0.6.3.0',
      'aliases' => 
      array (
      ),
      'reference' => '4627c838b16550b666d15aeae1e5289dd5b77da0',
    ),
    'nesbot/carbon' => 
    array (
      'pretty_version' => '1.39.1',
      'version' => '1.39.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '4be0c005164249208ce1b5ca633cd57bdd42ff33',
    ),
    'paragonie/constant_time_encoding' => 
    array (
      'pretty_version' => 'v2.6.3',
      'version' => '2.6.3.0',
      'aliases' => 
      array (
      ),
      'reference' => '58c3f47f650c94ec05a151692652a868995d2938',
    ),
    'paragonie/random_compat' => 
    array (
      'pretty_version' => 'v2.0.21',
      'version' => '2.0.21.0',
      'aliases' => 
      array (
      ),
      'reference' => '96c132c7f2f7bc3230723b66e89f8f150b29d5ae',
    ),
    'paypal/paypal-checkout-sdk' => 
    array (
      'pretty_version' => '1.0.2',
      'version' => '1.0.2.0',
      'aliases' => 
      array (
      ),
      'reference' => '19992ce7051ff9e47e643f28abb8cc1b3e5f1812',
    ),
    'paypal/paypalhttp' => 
    array (
      'pretty_version' => '1.0.1',
      'version' => '1.0.1.0',
      'aliases' => 
      array (
      ),
      'reference' => '7b09c89c80828e842c79230e7f156b61fbb68d25',
    ),
    'phpspec/php-diff' => 
    array (
      'pretty_version' => 'v1.1.3',
      'version' => '1.1.3.0',
      'aliases' => 
      array (
      ),
      'reference' => 'fc1156187f9f6c8395886fe85ed88a0a245d72e9',
    ),
    'piwik/device-detector' => 
    array (
      'pretty_version' => '3.13.1',
      'version' => '3.13.1.0',
      'aliases' => 
      array (
      ),
      'reference' => 'e90533302c58acf41f0d8075a0151537d0ddf34d',
    ),
    'piwik/referrer-spam-blacklist' => 
    array (
      'replaced' => 
      array (
        0 => '*',
      ),
    ),
    'psr/http-message' => 
    array (
      'pretty_version' => '1.0.1',
      'version' => '1.0.1.0',
      'aliases' => 
      array (
      ),
      'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363',
    ),
    'psr/http-message-implementation' => 
    array (
      'provided' => 
      array (
        0 => '1.0',
      ),
    ),
    'psr/log' => 
    array (
      'pretty_version' => '1.1.4',
      'version' => '1.1.4.0',
      'aliases' => 
      array (
      ),
      'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
    ),
    'psr/log-implementation' => 
    array (
      'provided' => 
      array (
        0 => '1.0.0',
      ),
    ),
    'ralouphie/getallheaders' => 
    array (
      'pretty_version' => '3.0.3',
      'version' => '3.0.3.0',
      'aliases' => 
      array (
      ),
      'reference' => '120b605dfeb996808c31b6477290a714d356e822',
    ),
    'select2/select2' => 
    array (
      'pretty_version' => '4.0.13',
      'version' => '4.0.13.0',
      'aliases' => 
      array (
      ),
      'reference' => '45f2b83ceed5231afa7b3d5b12b58ad335edd82e',
    ),
    'sendgrid/php-http-client' => 
    array (
      'pretty_version' => '3.14.4',
      'version' => '3.14.4.0',
      'aliases' => 
      array (
      ),
      'reference' => '6d589564522be290c7d7c18e51bcd8b03aeaf0b6',
    ),
    'sendgrid/sendgrid' => 
    array (
      'pretty_version' => '7.11.5',
      'version' => '7.11.5.0',
      'aliases' => 
      array (
      ),
      'reference' => '1d2fd3b72687fe82264853a8888b014f8f99e81f',
    ),
    'sendgrid/sendgrid-php' => 
    array (
      'replaced' => 
      array (
        0 => '*',
      ),
    ),
    'snowplow/referer-parser' => 
    array (
      'pretty_version' => 'dev-master',
      'version' => 'dev-master',
      'aliases' => 
      array (
        0 => '9999999-dev',
      ),
      'reference' => 'd96974a3318254c54597918c7fff1957cb608838',
    ),
    'starkbank/ecdsa' => 
    array (
      'pretty_version' => '0.0.5',
      'version' => '0.0.5.0',
      'aliases' => 
      array (
      ),
      'reference' => '484bedac47bac4012dc73df91da221f0a66845cb',
    ),
    'stripe/stripe-php' => 
    array (
      'pretty_version' => 'v7.128.0',
      'version' => '7.128.0.0',
      'aliases' => 
      array (
      ),
      'reference' => 'c704949c49b72985c76cc61063aa26fefbd2724e',
    ),
    'swiftmailer/swiftmailer' => 
    array (
      'pretty_version' => 'v5.4.12',
      'version' => '5.4.12.0',
      'aliases' => 
      array (
      ),
      'reference' => '181b89f18a90f8925ef805f950d47a7190e9b950',
    ),
    'symfony/polyfill-mbstring' => 
    array (
      'pretty_version' => 'v1.19.0',
      'version' => '1.19.0.0',
      'aliases' => 
      array (
      ),
      'reference' => 'b5f7b932ee6fa802fc792eabd77c4c88084517ce',
    ),
    'symfony/translation' => 
    array (
      'pretty_version' => 'v3.3.6',
      'version' => '3.3.6.0',
      'aliases' => 
      array (
      ),
      'reference' => '35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3',
    ),
    'yiisoft/yii2' => 
    array (
      'pretty_version' => '2.0.47',
      'version' => '2.0.47.0',
      'aliases' => 
      array (
      ),
      'reference' => '8ecf57895d9c4b29cf9658ffe57af5f3d0e25254',
    ),
    'yiisoft/yii2-authclient' => 
    array (
      'pretty_version' => '2.2.14',
      'version' => '2.2.14.0',
      'aliases' => 
      array (
      ),
      'reference' => '6bd4b4efc60db2b31bb957a473442900c704857e',
    ),
    'yiisoft/yii2-bootstrap' => 
    array (
      'pretty_version' => '2.0.11',
      'version' => '2.0.11.0',
      'aliases' => 
      array (
      ),
      'reference' => '83d144f4089adaa7064ad60dc4c1436daa2eb30e',
    ),
    'yiisoft/yii2-composer' => 
    array (
      'pretty_version' => '2.0.10',
      'version' => '2.0.10.0',
      'aliases' => 
      array (
      ),
      'reference' => '94bb3f66e779e2774f8776d6e1bdeab402940510',
    ),
    'yiisoft/yii2-debug' => 
    array (
      'pretty_version' => '2.1.22',
      'version' => '2.1.22.0',
      'aliases' => 
      array (
      ),
      'reference' => 'c0fa388c56b64edfb92987fdcc37d7a0243170d7',
    ),
    'yiisoft/yii2-gii' => 
    array (
      'pretty_version' => '2.2.5',
      'version' => '2.2.5.0',
      'aliases' => 
      array (
      ),
      'reference' => 'e2f2dcf0f16713e678df6ba70362c99a215a8f72',
    ),
    'yiisoft/yii2-httpclient' => 
    array (
      'pretty_version' => '2.0.14',
      'version' => '2.0.14.0',
      'aliases' => 
      array (
      ),
      'reference' => '50d670d2e1a30a354c27aeebf806a2db16954836',
    ),
    'yiisoft/yii2-jui' => 
    array (
      'pretty_version' => '2.0.7',
      'version' => '2.0.7.0',
      'aliases' => 
      array (
      ),
      'reference' => 'ce45c16d4fbbe7d1c516d8d0e8311e07f6138eed',
    ),
    'yiisoft/yii2-swiftmailer' => 
    array (
      'pretty_version' => '2.0.7',
      'version' => '2.0.7.0',
      'aliases' => 
      array (
      ),
      'reference' => '8a03a62cbcb82e7697d3002eb43a8d2637f566ec',
    ),
  ),
);
private static $canGetVendors;
private static $installedByVendor = array();







public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}


if (1 === \count($packages)) {
return $packages[0];
}

return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}









public static function isInstalled($packageName)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return true;
}
}

return false;
}














public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));

return $provided->matches($constraint);
}










public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}

$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}

return implode(' || ', $ranges);
}

throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}





public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}

if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}

return $installed['versions'][$packageName]['version'];
}

throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}





public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}

if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}

return $installed['versions'][$packageName]['pretty_version'];
}

throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}





public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}

if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}

return $installed['versions'][$packageName]['reference'];
}

throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}





public static function getRootPackage()
{
$installed = self::getInstalled();

return $installed[0]['root'];
}







public static function getRawData()
{
return self::$installed;
}



















public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}




private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}

$installed = array();

if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
}
}
}

$installed[] = self::$installed;

return $installed;
}
}
