Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
<?php
2
 
3
/*
4
 * This file is part of composer/pcre.
5
 *
6
 * (c) Composer <https://github.com/composer>
7
 *
8
 * For the full copyright and license information, please view
9
 * the LICENSE file that was distributed with this source code.
10
 */
11
 
12
namespace Composer\Pcre;
13
 
14
final class MatchAllWithOffsetsResult
15
{
16
    /**
17
     * An array of match group => list of matches, every match being a pair of string matched + offset in bytes (or -1 if no match)
18
     *
19
     * @readonly
20
     * @var array<int|string, list<array{string|null, int}>>
21
     * @phpstan-var array<int|string, list<array{string|null, int<-1, max>}>>
22
     */
23
    public $matches;
24
 
25
    /**
26
     * @readonly
27
     * @var 0|positive-int
28
     */
29
    public $count;
30
 
31
    /**
32
     * @readonly
33
     * @var bool
34
     */
35
    public $matched;
36
 
37
    /**
38
     * @param 0|positive-int $count
39
     * @param array<int|string, list<array{string|null, int}>> $matches
40
     * @phpstan-param array<int|string, list<array{string|null, int<-1, max>}>> $matches
41
     */
42
    public function __construct(int $count, array $matches)
43
    {
44
        $this->matches = $matches;
45
        $this->matched = (bool) $count;
46
        $this->count = $count;
47
    }
48
}