1<?php
2
3namespace Doctrine\DBAL;
4
5use function str_replace;
6use function strtoupper;
7use function version_compare;
8
9/**
10 * Class to store and retrieve the version of Doctrine.
11 *
12 * @internal
13 * @deprecated Refrain from checking the DBAL version at runtime.
14 */
15class Version
16{
17    /**
18     * Current Doctrine Version.
19     */
20    public const VERSION = '2.13.5';
21
22    /**
23     * Compares a Doctrine version with the current one.
24     *
25     * @param string $version The Doctrine version to compare to.
26     *
27     * @return int -1 if older, 0 if it is the same, 1 if version passed as argument is newer.
28     */
29    public static function compare($version)
30    {
31        $version = str_replace(' ', '', strtoupper($version));
32
33        return version_compare($version, self::VERSION);
34    }
35}
36