PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.1
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.1
2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.2 All 57 releases
easy-invoice / vendor / sabberworm / php-css-parser / src / Position / Position.php

Position.php in Easy Invoice – Invoice Generator, PDF Quotes & Payments 2.4.1, 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