Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ParseError
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getMessage
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getOffset
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4/**
5 * Copyright Wikimedia Foundation
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 *     http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * @file
20 * @license Apache-2.0
21 * @license MIT
22 * @license GPL-2.0-or-later
23 * @license LGPL-2.1-or-later
24 */
25
26namespace Wikimedia\Minify;
27
28/**
29 * Represent a JavaScript or CSS parser error
30 */
31class ParseError {
32    /** @var string */
33    private $message;
34    /** @var int */
35    private $offset;
36
37    /**
38     * @param string $message
39     * @param int $offset
40     */
41    public function __construct( $message, $offset ) {
42        $this->message = $message;
43        $this->offset = $offset;
44    }
45
46    public function getMessage(): string {
47        return $this->message;
48    }
49
50    public function getOffset(): int {
51        return $this->offset;
52    }
53}