Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 200
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
3
/*
3
/*
4
 * This file is part of Psy Shell.
4
 * This file is part of Psy Shell.
5
 *
5
 *
6
 * (c) 2012-2022 Justin Hileman
6
 * (c) 2012-2023 Justin Hileman
7
 *
7
 *
8
 * For the full copyright and license information, please view the LICENSE
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
9
 * file that was distributed with this source code.
Zeile 17... Zeile 17...
17
{
17
{
18
    const URL = 'https://api.github.com/repos/bobthecow/psysh/releases/latest';
18
    const URL = 'https://api.github.com/repos/bobthecow/psysh/releases/latest';
Zeile 19... Zeile 19...
19
 
19
 
Zeile 20... Zeile -...
20
    private $latest;
-
 
21
 
-
 
22
    /**
-
 
23
     * @return bool
20
    private $latest;
24
     */
21
 
25
    public function isLatest(): bool
22
    public function isLatest(): bool
26
    {
23
    {
27
        // version_compare doesn't handle semver completely;
24
        // version_compare doesn't handle semver completely;
Zeile 28... Zeile 25...
28
        // strip pre-release and build metadata before comparing
25
        // strip pre-release and build metadata before comparing
29
        $version = \preg_replace('/[+-]\w+/', '', Shell::VERSION);
26
        $version = \preg_replace('/[+-]\w+/', '', Shell::VERSION);
Zeile 30... Zeile -...
30
 
-
 
31
        return \version_compare($version, $this->getLatest(), '>=');
-
 
32
    }
-
 
33
 
27
 
34
    /**
28
        return \version_compare($version, $this->getLatest(), '>=');
35
     * @return string
29
    }
36
     */
30
 
37
    public function getLatest(): string
31
    public function getLatest(): string