PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Worksheet / ProtectedRange.php

ProtectedRange.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Worksheet/ProtectedRange.php

60 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Worksheet;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Cell\Coordinate;
6
7 class ProtectedRange
8 {
9 private string $name = '';
10
11 private string $password = '';
12
13 private string $sqref;
14
15 private string $securityDescriptor = '';
16
17 /**
18 * No setters aside from constructor.
19 */
20 public function __construct(string $sqref, string $password = '', string $name = '', string $securityDescriptor = '')
21 {
22 $this->sqref = $sqref;
23 $this->name = $name;
24 $this->password = $password;
25 $this->securityDescriptor = $securityDescriptor;
26 }
27
28 public function getSqref(): string
29 {
30 return $this->sqref;
31 }
32
33 public function getName(): string
34 {
35 return $this->name ?: ('p' . md5($this->sqref));
36 }
37
38 public function getPassword(): string
39 {
40 return $this->password;
41 }
42
43 public function getSecurityDescriptor(): string
44 {
45 return $this->securityDescriptor;
46 }
47
48 /**
49 * Split range into coordinate strings.
50 *
51 * @return array<array<string>> Array containing one or more arrays containing one or two coordinate strings
52 * e.g. ['B4','D9'] or [['B4','D9'], ['H2','O11']]
53 * or ['B4']
54 */
55 public function allRanges(): array
56 {
57 return Coordinate::allRanges($this->sqref, false);
58 }
59 }
60