GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch v2 (b7a21f)
by Oliver
06:19 queued 03:39
created

Stub::getContent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace TYPO3\PharStreamWrapper\Phar;
3
4
/*
5
 * This file is part of the TYPO3 project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under the terms
8
 * of the MIT License (MIT). For the full copyright and license information,
9
 * please read the LICENSE file that was distributed with this source code.
10
 *
11
 * The TYPO3 project - inspiring people to share!
12
 */
13
14
/**
15
 * @internal Experimental implementation of Phar archive internals
16
 */
17
class Stub
18
{
19
    /**
20
     * @param string $content
21
     * @return self
22
     */
23
    public static function fromContent($content)
24
    {
25
        $target = new static();
26
        $target->content = $content;
27
28
        if (
29
            stripos($content, 'Phar::mapPhar(') !== false
30
            && preg_match('#Phar\:\:mapPhar\(([^)]+)\)#', $content, $matches)
31
        ) {
32
            // remove spaces, single & double quotes
33
            // @todo `'my' . 'alias' . '.phar'` is not evaluated here
34
            $target->mappedAlias = trim($matches[1], ' \'"');
35
        }
36
37
        return $target;
38
    }
39
40
    /**
41
     * @var string
42
     */
43
    private $content;
44
45
    /**
46
     * @var string
47
     */
48
    private $mappedAlias = '';
49
50
    /**
51
     * @return string
52
     */
53
    public function getContent()
54
    {
55
        return $this->content;
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getMappedAlias()
62
    {
63
        return $this->mappedAlias;
64
    }
65
}
66