PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / vendor / sabberworm / php-css-parser / src / Position / Position.php

Position.php in Yatra – Travel Booking & Tour Operator Software 3.0.16, at vendor/sabberworm/php-css-parser/src/Position/Position.php

73 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Sabberworm\CSS\Position;
6
7 /**
8 * Provides a standard reusable implementation of `Positionable`.
9 *
10 * @internal
11 *
12 * @phpstan-require-implements Positionable
13 */
14 trait Position
15 {
16 /**
17 * @var int<1, max>|null
18 */
19 protected $lineNumber;
20
21 /**
22 * @var int<0, max>|null
23 */
24 protected $columnNumber;
25
26 /**
27 * @return int<1, max>|null
28 */
29 public function getLineNumber()
30 {
31 return $this->lineNumber;
32 }
33
34 /**
35 * @return int<0, max>
36 */
37 public function getLineNo()
38 {
39 $lineNumber = $this->getLineNumber();
40
41 return $lineNumber !== null ? $lineNumber : 0;
42 }
43
44 /**
45 * @return int<0, max>|null
46 */
47 public function getColumnNumber()
48 {
49 return $this->columnNumber;
50 }
51
52 /**
53 * @return int<0, max>
54 */
55 public function getColNo()
56 {
57 $columnNumber = $this->getColumnNumber();
58
59 return $columnNumber !== null ? $columnNumber : 0;
60 }
61
62 /**
63 * @param int<0, max>|null $lineNumber
64 * @param int<0, max>|null $columnNumber
65 */
66 public function setPosition($lineNumber, $columnNumber = null)
67 {
68 // The conditional is for backwards compatibility (backcompat); `0` will not be allowed in future.
69 $this->lineNumber = $lineNumber !== 0 ? $lineNumber : null;
70 $this->columnNumber = $columnNumber;
71 }
72 }
73