Completed
Push — develop ( 50ed76...6a48b5 )
by Adrien
63:50
created

Escher   B

Complexity

Total Complexity 46

Size/Duplication

Total Lines 660
Duplicated Lines 0 %

Test Coverage

Coverage 91.32%

Importance

Changes 0
Metric Value
eloc 250
dl 0
loc 660
ccs 242
cts 265
cp 0.9132
rs 8.72
c 0
b 0
f 0
wmc 46

22 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A readSpgrContainer() 0 23 2
A readOfficeArtRGFOPTE() 0 36 3
A readClientTextbox() 0 12 1
A readDgg() 0 7 1
A readBstoreContainer() 0 13 1
A readDggContainer() 0 13 1
A readDgContainer() 0 13 1
A readDefault() 0 16 1
A readOPT() 0 14 1
A readSpgr() 0 7 1
A readSpContainer() 0 15 1
A readClientData() 0 7 1
A readSp() 0 12 1
A readBSE() 0 61 1
A readDg() 0 7 1
A readSplitMenuColors() 0 7 1
D load() 0 95 20
A readClientAnchor() 0 49 1
A readBlipPNG() 0 36 2
A readBlipJPEG() 0 36 2
A readTertiaryOPT() 0 12 1

How to fix   Complexity   

Complex Class

Complex classes like Escher often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Escher, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace PhpOffice\PhpSpreadsheet\Reader\Xls;
4
5
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
6
use PhpOffice\PhpSpreadsheet\Reader\Xls;
7
use PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer;
8
use PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer;
9
use PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer;
10
use PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer;
11
use PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer;
12
use PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE;
13
use PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip;
14
15
class Escher
16
{
17
    const DGGCONTAINER = 0xF000;
18
    const BSTORECONTAINER = 0xF001;
19
    const DGCONTAINER = 0xF002;
20
    const SPGRCONTAINER = 0xF003;
21
    const SPCONTAINER = 0xF004;
22
    const DGG = 0xF006;
23
    const BSE = 0xF007;
24
    const DG = 0xF008;
25
    const SPGR = 0xF009;
26
    const SP = 0xF00A;
27
    const OPT = 0xF00B;
28
    const CLIENTTEXTBOX = 0xF00D;
29
    const CLIENTANCHOR = 0xF010;
30
    const CLIENTDATA = 0xF011;
31
    const BLIPJPEG = 0xF01D;
32
    const BLIPPNG = 0xF01E;
33
    const SPLITMENUCOLORS = 0xF11E;
34
    const TERTIARYOPT = 0xF122;
35
36
    /**
37
     * Escher stream data (binary).
38
     *
39
     * @var string
40
     */
41
    private $data;
42
43
    /**
44
     * Size in bytes of the Escher stream data.
45
     *
46
     * @var int
47
     */
48
    private $dataSize;
49
50
    /**
51
     * Current position of stream pointer in Escher stream data.
52
     *
53
     * @var int
54
     */
55
    private $pos;
56
57
    /**
58
     * The object to be returned by the reader. Modified during load.
59
     *
60
     * @var BSE|BstoreContainer|DgContainer|DggContainer|\PhpOffice\PhpSpreadsheet\Shared\Escher|SpContainer|SpgrContainer
61
     */
62
    private $object;
63
64
    /**
65
     * Create a new Escher instance.
66
     *
67
     * @param mixed $object
68
     */
69 3
    public function __construct($object)
70
    {
71 3
        $this->object = $object;
72 3
    }
73
74
    /**
75
     * Load Escher stream data. May be a partial Escher stream.
76
     *
77
     * @param string $data
78
     *
79
     * @return BSE|BstoreContainer|DgContainer|DggContainer|\PhpOffice\PhpSpreadsheet\Shared\Escher|SpContainer|SpgrContainer
80
     */
81 3
    public function load($data)
82
    {
83 3
        $this->data = $data;
84
85
        // total byte size of Excel data (workbook global substream + sheet substreams)
86 3
        $this->dataSize = strlen($this->data);
87
88 3
        $this->pos = 0;
89
90
        // Parse Escher stream
91 3
        while ($this->pos < $this->dataSize) {
92
            // offset: 2; size: 2: Record Type
93 3
            $fbt = Xls::getUInt2d($this->data, $this->pos + 2);
94
95
            switch ($fbt) {
96 3
                case self::DGGCONTAINER:
97 3
                    $this->readDggContainer();
98
99 3
                    break;
100 3
                case self::DGG:
101 3
                    $this->readDgg();
102
103 3
                    break;
104 3
                case self::BSTORECONTAINER:
105 3
                    $this->readBstoreContainer();
106
107 3
                    break;
108 3
                case self::BSE:
109 3
                    $this->readBSE();
110
111 3
                    break;
112 3
                case self::BLIPJPEG:
113 3
                    $this->readBlipJPEG();
114
115 3
                    break;
116 3
                case self::BLIPPNG:
117 3
                    $this->readBlipPNG();
118
119 3
                    break;
120 3
                case self::OPT:
121 3
                    $this->readOPT();
122
123 3
                    break;
124 3
                case self::TERTIARYOPT:
125
                    $this->readTertiaryOPT();
126
127
                    break;
128 3
                case self::SPLITMENUCOLORS:
129 2
                    $this->readSplitMenuColors();
130
131 2
                    break;
132 3
                case self::DGCONTAINER:
133 3
                    $this->readDgContainer();
134
135 3
                    break;
136 3
                case self::DG:
137 3
                    $this->readDg();
138
139 3
                    break;
140 3
                case self::SPGRCONTAINER:
141 3
                    $this->readSpgrContainer();
142
143 3
                    break;
144 3
                case self::SPCONTAINER:
145 3
                    $this->readSpContainer();
146
147 3
                    break;
148 3
                case self::SPGR:
149 3
                    $this->readSpgr();
150
151 3
                    break;
152 3
                case self::SP:
153 3
                    $this->readSp();
154
155 3
                    break;
156 3
                case self::CLIENTTEXTBOX:
157 1
                    $this->readClientTextbox();
158
159 1
                    break;
160 3
                case self::CLIENTANCHOR:
161 3
                    $this->readClientAnchor();
162
163 3
                    break;
164 3
                case self::CLIENTDATA:
165 3
                    $this->readClientData();
166
167 3
                    break;
168
                default:
169
                    $this->readDefault();
170
171
                    break;
172
            }
173
        }
174
175 3
        return $this->object;
176
    }
177
178
    /**
179
     * Read a generic record.
180
     */
181
    private function readDefault()
182
    {
183
        // offset 0; size: 2; recVer and recInstance
184
        $verInstance = Xls::getUInt2d($this->data, $this->pos);
185
186
        // offset: 2; size: 2: Record Type
187
        $fbt = Xls::getUInt2d($this->data, $this->pos + 2);
0 ignored issues
show
Unused Code introduced by
The assignment to $fbt is dead and can be removed.
Loading history...
188
189
        // bit: 0-3; mask: 0x000F; recVer
190
        $recVer = (0x000F & $verInstance) >> 0;
0 ignored issues
show
Unused Code introduced by
The assignment to $recVer is dead and can be removed.
Loading history...
191
192
        $length = Xls::getInt4d($this->data, $this->pos + 4);
193
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
194
195
        // move stream pointer to next record
196
        $this->pos += 8 + $length;
197
    }
198
199
    /**
200
     * Read DggContainer record (Drawing Group Container).
201
     */
202 3
    private function readDggContainer()
203
    {
204 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
205 3
        $recordData = substr($this->data, $this->pos + 8, $length);
206
207
        // move stream pointer to next record
208 3
        $this->pos += 8 + $length;
209
210
        // record is a container, read contents
211 3
        $dggContainer = new DggContainer();
212 3
        $this->object->setDggContainer($dggContainer);
6 ignored issues
show
Bug introduced by
The method setDggContainer() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

212
        $this->object->/** @scrutinizer ignore-call */ 
213
                       setDggContainer($dggContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDggContainer() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. Did you maybe mean setSpgrContainer()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

212
        $this->object->/** @scrutinizer ignore-call */ 
213
                       setDggContainer($dggContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDggContainer() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

212
        $this->object->/** @scrutinizer ignore-call */ 
213
                       setDggContainer($dggContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDggContainer() does not exist on PhpOffice\PhpSpreadsheet...grContainer\SpContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

212
        $this->object->/** @scrutinizer ignore-call */ 
213
                       setDggContainer($dggContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDggContainer() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

212
        $this->object->/** @scrutinizer ignore-call */ 
213
                       setDggContainer($dggContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDggContainer() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

212
        $this->object->/** @scrutinizer ignore-call */ 
213
                       setDggContainer($dggContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
213 3
        $reader = new self($dggContainer);
214 3
        $reader->load($recordData);
215 3
    }
216
217
    /**
218
     * Read Dgg record (Drawing Group).
219
     */
220 3
    private function readDgg()
221
    {
222 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
223 3
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
224
225
        // move stream pointer to next record
226 3
        $this->pos += 8 + $length;
227 3
    }
228
229
    /**
230
     * Read BstoreContainer record (Blip Store Container).
231
     */
232 3
    private function readBstoreContainer()
233
    {
234 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
235 3
        $recordData = substr($this->data, $this->pos + 8, $length);
236
237
        // move stream pointer to next record
238 3
        $this->pos += 8 + $length;
239
240
        // record is a container, read contents
241 3
        $bstoreContainer = new BstoreContainer();
242 3
        $this->object->setBstoreContainer($bstoreContainer);
5 ignored issues
show
Bug introduced by
The method setBstoreContainer() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

242
        $this->object->/** @scrutinizer ignore-call */ 
243
                       setBstoreContainer($bstoreContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBstoreContainer() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

242
        $this->object->/** @scrutinizer ignore-call */ 
243
                       setBstoreContainer($bstoreContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBstoreContainer() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

242
        $this->object->/** @scrutinizer ignore-call */ 
243
                       setBstoreContainer($bstoreContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBstoreContainer() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

242
        $this->object->/** @scrutinizer ignore-call */ 
243
                       setBstoreContainer($bstoreContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBstoreContainer() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

242
        $this->object->/** @scrutinizer ignore-call */ 
243
                       setBstoreContainer($bstoreContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBstoreContainer() does not exist on PhpOffice\PhpSpreadsheet...grContainer\SpContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

242
        $this->object->/** @scrutinizer ignore-call */ 
243
                       setBstoreContainer($bstoreContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
243 3
        $reader = new self($bstoreContainer);
244 3
        $reader->load($recordData);
245 3
    }
246
247
    /**
248
     * Read BSE record.
249
     */
250 3
    private function readBSE()
251
    {
252
        // offset: 0; size: 2; recVer and recInstance
253
254
        // bit: 4-15; mask: 0xFFF0; recInstance
255 3
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;
256
257 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
258 3
        $recordData = substr($this->data, $this->pos + 8, $length);
259
260
        // move stream pointer to next record
261 3
        $this->pos += 8 + $length;
262
263
        // add BSE to BstoreContainer
264 3
        $BSE = new BSE();
265 3
        $this->object->addBSE($BSE);
5 ignored issues
show
Bug introduced by
The method addBSE() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
        $this->object->/** @scrutinizer ignore-call */ 
266
                       addBSE($BSE);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addBSE() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
        $this->object->/** @scrutinizer ignore-call */ 
266
                       addBSE($BSE);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addBSE() does not exist on PhpOffice\PhpSpreadsheet...grContainer\SpContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
        $this->object->/** @scrutinizer ignore-call */ 
266
                       addBSE($BSE);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addBSE() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
        $this->object->/** @scrutinizer ignore-call */ 
266
                       addBSE($BSE);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addBSE() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
        $this->object->/** @scrutinizer ignore-call */ 
266
                       addBSE($BSE);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addBSE() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

265
        $this->object->/** @scrutinizer ignore-call */ 
266
                       addBSE($BSE);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
266
267 3
        $BSE->setBLIPType($recInstance);
268
269
        // offset: 0; size: 1; btWin32 (MSOBLIPTYPE)
270 3
        $btWin32 = ord($recordData[0]);
0 ignored issues
show
Unused Code introduced by
The assignment to $btWin32 is dead and can be removed.
Loading history...
271
272
        // offset: 1; size: 1; btWin32 (MSOBLIPTYPE)
273 3
        $btMacOS = ord($recordData[1]);
0 ignored issues
show
Unused Code introduced by
The assignment to $btMacOS is dead and can be removed.
Loading history...
274
275
        // offset: 2; size: 16; MD4 digest
276 3
        $rgbUid = substr($recordData, 2, 16);
0 ignored issues
show
Unused Code introduced by
The assignment to $rgbUid is dead and can be removed.
Loading history...
277
278
        // offset: 18; size: 2; tag
279 3
        $tag = Xls::getUInt2d($recordData, 18);
0 ignored issues
show
Unused Code introduced by
The assignment to $tag is dead and can be removed.
Loading history...
280
281
        // offset: 20; size: 4; size of BLIP in bytes
282 3
        $size = Xls::getInt4d($recordData, 20);
0 ignored issues
show
Unused Code introduced by
The assignment to $size is dead and can be removed.
Loading history...
283
284
        // offset: 24; size: 4; number of references to this BLIP
285 3
        $cRef = Xls::getInt4d($recordData, 24);
0 ignored issues
show
Unused Code introduced by
The assignment to $cRef is dead and can be removed.
Loading history...
286
287
        // offset: 28; size: 4; MSOFO file offset
288 3
        $foDelay = Xls::getInt4d($recordData, 28);
0 ignored issues
show
Unused Code introduced by
The assignment to $foDelay is dead and can be removed.
Loading history...
289
290
        // offset: 32; size: 1; unused1
291 3
        $unused1 = ord($recordData[32]);
0 ignored issues
show
Unused Code introduced by
The assignment to $unused1 is dead and can be removed.
Loading history...
292
293
        // offset: 33; size: 1; size of nameData in bytes (including null terminator)
294 3
        $cbName = ord($recordData[33]);
295
296
        // offset: 34; size: 1; unused2
297 3
        $unused2 = ord($recordData[34]);
0 ignored issues
show
Unused Code introduced by
The assignment to $unused2 is dead and can be removed.
Loading history...
298
299
        // offset: 35; size: 1; unused3
300 3
        $unused3 = ord($recordData[35]);
0 ignored issues
show
Unused Code introduced by
The assignment to $unused3 is dead and can be removed.
Loading history...
301
302
        // offset: 36; size: $cbName; nameData
303 3
        $nameData = substr($recordData, 36, $cbName);
0 ignored issues
show
Unused Code introduced by
The assignment to $nameData is dead and can be removed.
Loading history...
304
305
        // offset: 36 + $cbName, size: var; the BLIP data
306 3
        $blipData = substr($recordData, 36 + $cbName);
307
308
        // record is a container, read contents
309 3
        $reader = new self($BSE);
310 3
        $reader->load($blipData);
311 3
    }
312
313
    /**
314
     * Read BlipJPEG record. Holds raw JPEG image data.
315
     */
316 3
    private function readBlipJPEG()
317
    {
318
        // offset: 0; size: 2; recVer and recInstance
319
320
        // bit: 4-15; mask: 0xFFF0; recInstance
321 3
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;
322
323 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
324 3
        $recordData = substr($this->data, $this->pos + 8, $length);
325
326
        // move stream pointer to next record
327 3
        $this->pos += 8 + $length;
328
329 3
        $pos = 0;
330
331
        // offset: 0; size: 16; rgbUid1 (MD4 digest of)
332 3
        $rgbUid1 = substr($recordData, 0, 16);
0 ignored issues
show
Unused Code introduced by
The assignment to $rgbUid1 is dead and can be removed.
Loading history...
333 3
        $pos += 16;
334
335
        // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3
336 3
        if (in_array($recInstance, [0x046B, 0x06E3])) {
337
            $rgbUid2 = substr($recordData, 16, 16);
0 ignored issues
show
Unused Code introduced by
The assignment to $rgbUid2 is dead and can be removed.
Loading history...
338
            $pos += 16;
339
        }
340
341
        // offset: var; size: 1; tag
342 3
        $tag = ord($recordData[$pos]);
0 ignored issues
show
Unused Code introduced by
The assignment to $tag is dead and can be removed.
Loading history...
343 3
        $pos += 1;
344
345
        // offset: var; size: var; the raw image data
346 3
        $data = substr($recordData, $pos);
347
348 3
        $blip = new Blip();
349 3
        $blip->setData($data);
350
351 3
        $this->object->setBlip($blip);
5 ignored issues
show
Bug introduced by
The method setBlip() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

351
        $this->object->/** @scrutinizer ignore-call */ 
352
                       setBlip($blip);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBlip() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

351
        $this->object->/** @scrutinizer ignore-call */ 
352
                       setBlip($blip);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBlip() does not exist on PhpOffice\PhpSpreadsheet...grContainer\SpContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

351
        $this->object->/** @scrutinizer ignore-call */ 
352
                       setBlip($blip);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBlip() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

351
        $this->object->/** @scrutinizer ignore-call */ 
352
                       setBlip($blip);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBlip() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

351
        $this->object->/** @scrutinizer ignore-call */ 
352
                       setBlip($blip);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setBlip() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

351
        $this->object->/** @scrutinizer ignore-call */ 
352
                       setBlip($blip);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
352 3
    }
353
354
    /**
355
     * Read BlipPNG record. Holds raw PNG image data.
356
     */
357 3
    private function readBlipPNG()
358
    {
359
        // offset: 0; size: 2; recVer and recInstance
360
361
        // bit: 4-15; mask: 0xFFF0; recInstance
362 3
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;
363
364 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
365 3
        $recordData = substr($this->data, $this->pos + 8, $length);
366
367
        // move stream pointer to next record
368 3
        $this->pos += 8 + $length;
369
370 3
        $pos = 0;
371
372
        // offset: 0; size: 16; rgbUid1 (MD4 digest of)
373 3
        $rgbUid1 = substr($recordData, 0, 16);
0 ignored issues
show
Unused Code introduced by
The assignment to $rgbUid1 is dead and can be removed.
Loading history...
374 3
        $pos += 16;
375
376
        // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3
377 3
        if ($recInstance == 0x06E1) {
378
            $rgbUid2 = substr($recordData, 16, 16);
0 ignored issues
show
Unused Code introduced by
The assignment to $rgbUid2 is dead and can be removed.
Loading history...
379
            $pos += 16;
380
        }
381
382
        // offset: var; size: 1; tag
383 3
        $tag = ord($recordData[$pos]);
0 ignored issues
show
Unused Code introduced by
The assignment to $tag is dead and can be removed.
Loading history...
384 3
        $pos += 1;
385
386
        // offset: var; size: var; the raw image data
387 3
        $data = substr($recordData, $pos);
388
389 3
        $blip = new Blip();
390 3
        $blip->setData($data);
391
392 3
        $this->object->setBlip($blip);
393 3
    }
394
395
    /**
396
     * Read OPT record. This record may occur within DggContainer record or SpContainer.
397
     */
398 3
    private function readOPT()
399
    {
400
        // offset: 0; size: 2; recVer and recInstance
401
402
        // bit: 4-15; mask: 0xFFF0; recInstance
403 3
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;
404
405 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
406 3
        $recordData = substr($this->data, $this->pos + 8, $length);
407
408
        // move stream pointer to next record
409 3
        $this->pos += 8 + $length;
410
411 3
        $this->readOfficeArtRGFOPTE($recordData, $recInstance);
412 3
    }
413
414
    /**
415
     * Read TertiaryOPT record.
416
     */
417
    private function readTertiaryOPT()
418
    {
419
        // offset: 0; size: 2; recVer and recInstance
420
421
        // bit: 4-15; mask: 0xFFF0; recInstance
422
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;
0 ignored issues
show
Unused Code introduced by
The assignment to $recInstance is dead and can be removed.
Loading history...
423
424
        $length = Xls::getInt4d($this->data, $this->pos + 4);
425
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
426
427
        // move stream pointer to next record
428
        $this->pos += 8 + $length;
429
    }
430
431
    /**
432
     * Read SplitMenuColors record.
433
     */
434 2
    private function readSplitMenuColors()
435
    {
436 2
        $length = Xls::getInt4d($this->data, $this->pos + 4);
437 2
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
438
439
        // move stream pointer to next record
440 2
        $this->pos += 8 + $length;
441 2
    }
442
443
    /**
444
     * Read DgContainer record (Drawing Container).
445
     */
446 3
    private function readDgContainer()
447
    {
448 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
449 3
        $recordData = substr($this->data, $this->pos + 8, $length);
450
451
        // move stream pointer to next record
452 3
        $this->pos += 8 + $length;
453
454
        // record is a container, read contents
455 3
        $dgContainer = new DgContainer();
456 3
        $this->object->setDgContainer($dgContainer);
6 ignored issues
show
Bug introduced by
The method setDgContainer() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

456
        $this->object->/** @scrutinizer ignore-call */ 
457
                       setDgContainer($dgContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDgContainer() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

456
        $this->object->/** @scrutinizer ignore-call */ 
457
                       setDgContainer($dgContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDgContainer() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

456
        $this->object->/** @scrutinizer ignore-call */ 
457
                       setDgContainer($dgContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDgContainer() does not exist on PhpOffice\PhpSpreadsheet...grContainer\SpContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

456
        $this->object->/** @scrutinizer ignore-call */ 
457
                       setDgContainer($dgContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDgContainer() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

456
        $this->object->/** @scrutinizer ignore-call */ 
457
                       setDgContainer($dgContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setDgContainer() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

456
        $this->object->/** @scrutinizer ignore-call */ 
457
                       setDgContainer($dgContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
457 3
        $reader = new self($dgContainer);
458 3
        $escher = $reader->load($recordData);
0 ignored issues
show
Unused Code introduced by
The assignment to $escher is dead and can be removed.
Loading history...
459 3
    }
460
461
    /**
462
     * Read Dg record (Drawing).
463
     */
464 3
    private function readDg()
465
    {
466 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
467 3
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
468
469
        // move stream pointer to next record
470 3
        $this->pos += 8 + $length;
471 3
    }
472
473
    /**
474
     * Read SpgrContainer record (Shape Group Container).
475
     */
476 3
    private function readSpgrContainer()
477
    {
478
        // context is either context DgContainer or SpgrContainer
479
480 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
481 3
        $recordData = substr($this->data, $this->pos + 8, $length);
482
483
        // move stream pointer to next record
484 3
        $this->pos += 8 + $length;
485
486
        // record is a container, read contents
487 3
        $spgrContainer = new SpgrContainer();
488
489 3
        if ($this->object instanceof DgContainer) {
490
            // DgContainer
491 3
            $this->object->setSpgrContainer($spgrContainer);
492
        } else {
493
            // SpgrContainer
494
            $this->object->addChild($spgrContainer);
4 ignored issues
show
Bug introduced by
The method addChild() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

494
            $this->object->/** @scrutinizer ignore-call */ 
495
                           addChild($spgrContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addChild() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

494
            $this->object->/** @scrutinizer ignore-call */ 
495
                           addChild($spgrContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addChild() does not exist on PhpOffice\PhpSpreadsheet...grContainer\SpContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

494
            $this->object->/** @scrutinizer ignore-call */ 
495
                           addChild($spgrContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addChild() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

494
            $this->object->/** @scrutinizer ignore-call */ 
495
                           addChild($spgrContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method addChild() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

494
            $this->object->/** @scrutinizer ignore-call */ 
495
                           addChild($spgrContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
495
        }
496
497 3
        $reader = new self($spgrContainer);
498 3
        $escher = $reader->load($recordData);
0 ignored issues
show
Unused Code introduced by
The assignment to $escher is dead and can be removed.
Loading history...
499 3
    }
500
501
    /**
502
     * Read SpContainer record (Shape Container).
503
     */
504 3
    private function readSpContainer()
505
    {
506 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
507 3
        $recordData = substr($this->data, $this->pos + 8, $length);
508
509
        // add spContainer to spgrContainer
510 3
        $spContainer = new SpContainer();
511 3
        $this->object->addChild($spContainer);
1 ignored issue
show
Bug introduced by
The method addChild() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

511
        $this->object->/** @scrutinizer ignore-call */ 
512
                       addChild($spContainer);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
512
513
        // move stream pointer to next record
514 3
        $this->pos += 8 + $length;
515
516
        // record is a container, read contents
517 3
        $reader = new self($spContainer);
518 3
        $escher = $reader->load($recordData);
0 ignored issues
show
Unused Code introduced by
The assignment to $escher is dead and can be removed.
Loading history...
519 3
    }
520
521
    /**
522
     * Read Spgr record (Shape Group).
523
     */
524 3
    private function readSpgr()
525
    {
526 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
527 3
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
528
529
        // move stream pointer to next record
530 3
        $this->pos += 8 + $length;
531 3
    }
532
533
    /**
534
     * Read Sp record (Shape).
535
     */
536 3
    private function readSp()
537
    {
538
        // offset: 0; size: 2; recVer and recInstance
539
540
        // bit: 4-15; mask: 0xFFF0; recInstance
541 3
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;
0 ignored issues
show
Unused Code introduced by
The assignment to $recInstance is dead and can be removed.
Loading history...
542
543 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
544 3
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
545
546
        // move stream pointer to next record
547 3
        $this->pos += 8 + $length;
548 3
    }
549
550
    /**
551
     * Read ClientTextbox record.
552
     */
553 1
    private function readClientTextbox()
554
    {
555
        // offset: 0; size: 2; recVer and recInstance
556
557
        // bit: 4-15; mask: 0xFFF0; recInstance
558 1
        $recInstance = (0xFFF0 & Xls::getUInt2d($this->data, $this->pos)) >> 4;
0 ignored issues
show
Unused Code introduced by
The assignment to $recInstance is dead and can be removed.
Loading history...
559
560 1
        $length = Xls::getInt4d($this->data, $this->pos + 4);
561 1
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
562
563
        // move stream pointer to next record
564 1
        $this->pos += 8 + $length;
565 1
    }
566
567
    /**
568
     * Read ClientAnchor record. This record holds information about where the shape is anchored in worksheet.
569
     */
570 3
    private function readClientAnchor()
571
    {
572 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
573 3
        $recordData = substr($this->data, $this->pos + 8, $length);
574
575
        // move stream pointer to next record
576 3
        $this->pos += 8 + $length;
577
578
        // offset: 2; size: 2; upper-left corner column index (0-based)
579 3
        $c1 = Xls::getUInt2d($recordData, 2);
580
581
        // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width
582 3
        $startOffsetX = Xls::getUInt2d($recordData, 4);
583
584
        // offset: 6; size: 2; upper-left corner row index (0-based)
585 3
        $r1 = Xls::getUInt2d($recordData, 6);
586
587
        // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height
588 3
        $startOffsetY = Xls::getUInt2d($recordData, 8);
589
590
        // offset: 10; size: 2; bottom-right corner column index (0-based)
591 3
        $c2 = Xls::getUInt2d($recordData, 10);
592
593
        // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width
594 3
        $endOffsetX = Xls::getUInt2d($recordData, 12);
595
596
        // offset: 14; size: 2; bottom-right corner row index (0-based)
597 3
        $r2 = Xls::getUInt2d($recordData, 14);
598
599
        // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height
600 3
        $endOffsetY = Xls::getUInt2d($recordData, 16);
601
602
        // set the start coordinates
603 3
        $this->object->setStartCoordinates(Coordinate::stringFromColumnIndex($c1 + 1) . ($r1 + 1));
5 ignored issues
show
Bug introduced by
The method setStartCoordinates() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

603
        $this->object->/** @scrutinizer ignore-call */ 
604
                       setStartCoordinates(Coordinate::stringFromColumnIndex($c1 + 1) . ($r1 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartCoordinates() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

603
        $this->object->/** @scrutinizer ignore-call */ 
604
                       setStartCoordinates(Coordinate::stringFromColumnIndex($c1 + 1) . ($r1 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartCoordinates() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

603
        $this->object->/** @scrutinizer ignore-call */ 
604
                       setStartCoordinates(Coordinate::stringFromColumnIndex($c1 + 1) . ($r1 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartCoordinates() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

603
        $this->object->/** @scrutinizer ignore-call */ 
604
                       setStartCoordinates(Coordinate::stringFromColumnIndex($c1 + 1) . ($r1 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartCoordinates() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

603
        $this->object->/** @scrutinizer ignore-call */ 
604
                       setStartCoordinates(Coordinate::stringFromColumnIndex($c1 + 1) . ($r1 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartCoordinates() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

603
        $this->object->/** @scrutinizer ignore-call */ 
604
                       setStartCoordinates(Coordinate::stringFromColumnIndex($c1 + 1) . ($r1 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
604
605
        // set the start offsetX
606 3
        $this->object->setStartOffsetX($startOffsetX);
5 ignored issues
show
Bug introduced by
The method setStartOffsetX() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

606
        $this->object->/** @scrutinizer ignore-call */ 
607
                       setStartOffsetX($startOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetX() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

606
        $this->object->/** @scrutinizer ignore-call */ 
607
                       setStartOffsetX($startOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetX() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

606
        $this->object->/** @scrutinizer ignore-call */ 
607
                       setStartOffsetX($startOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetX() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

606
        $this->object->/** @scrutinizer ignore-call */ 
607
                       setStartOffsetX($startOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetX() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

606
        $this->object->/** @scrutinizer ignore-call */ 
607
                       setStartOffsetX($startOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetX() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

606
        $this->object->/** @scrutinizer ignore-call */ 
607
                       setStartOffsetX($startOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
607
608
        // set the start offsetY
609 3
        $this->object->setStartOffsetY($startOffsetY);
5 ignored issues
show
Bug introduced by
The method setStartOffsetY() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

609
        $this->object->/** @scrutinizer ignore-call */ 
610
                       setStartOffsetY($startOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetY() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

609
        $this->object->/** @scrutinizer ignore-call */ 
610
                       setStartOffsetY($startOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetY() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

609
        $this->object->/** @scrutinizer ignore-call */ 
610
                       setStartOffsetY($startOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetY() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

609
        $this->object->/** @scrutinizer ignore-call */ 
610
                       setStartOffsetY($startOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetY() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

609
        $this->object->/** @scrutinizer ignore-call */ 
610
                       setStartOffsetY($startOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setStartOffsetY() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

609
        $this->object->/** @scrutinizer ignore-call */ 
610
                       setStartOffsetY($startOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
610
611
        // set the end coordinates
612 3
        $this->object->setEndCoordinates(Coordinate::stringFromColumnIndex($c2 + 1) . ($r2 + 1));
5 ignored issues
show
Bug introduced by
The method setEndCoordinates() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

612
        $this->object->/** @scrutinizer ignore-call */ 
613
                       setEndCoordinates(Coordinate::stringFromColumnIndex($c2 + 1) . ($r2 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndCoordinates() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

612
        $this->object->/** @scrutinizer ignore-call */ 
613
                       setEndCoordinates(Coordinate::stringFromColumnIndex($c2 + 1) . ($r2 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndCoordinates() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

612
        $this->object->/** @scrutinizer ignore-call */ 
613
                       setEndCoordinates(Coordinate::stringFromColumnIndex($c2 + 1) . ($r2 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndCoordinates() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

612
        $this->object->/** @scrutinizer ignore-call */ 
613
                       setEndCoordinates(Coordinate::stringFromColumnIndex($c2 + 1) . ($r2 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndCoordinates() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

612
        $this->object->/** @scrutinizer ignore-call */ 
613
                       setEndCoordinates(Coordinate::stringFromColumnIndex($c2 + 1) . ($r2 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndCoordinates() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

612
        $this->object->/** @scrutinizer ignore-call */ 
613
                       setEndCoordinates(Coordinate::stringFromColumnIndex($c2 + 1) . ($r2 + 1));

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
613
614
        // set the end offsetX
615 3
        $this->object->setEndOffsetX($endOffsetX);
5 ignored issues
show
Bug introduced by
The method setEndOffsetX() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

615
        $this->object->/** @scrutinizer ignore-call */ 
616
                       setEndOffsetX($endOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetX() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

615
        $this->object->/** @scrutinizer ignore-call */ 
616
                       setEndOffsetX($endOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetX() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

615
        $this->object->/** @scrutinizer ignore-call */ 
616
                       setEndOffsetX($endOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetX() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

615
        $this->object->/** @scrutinizer ignore-call */ 
616
                       setEndOffsetX($endOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetX() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

615
        $this->object->/** @scrutinizer ignore-call */ 
616
                       setEndOffsetX($endOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetX() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

615
        $this->object->/** @scrutinizer ignore-call */ 
616
                       setEndOffsetX($endOffsetX);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
616
617
        // set the end offsetY
618 3
        $this->object->setEndOffsetY($endOffsetY);
5 ignored issues
show
Bug introduced by
The method setEndOffsetY() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

618
        $this->object->/** @scrutinizer ignore-call */ 
619
                       setEndOffsetY($endOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetY() does not exist on PhpOffice\PhpSpreadsheet...red\Escher\DggContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

618
        $this->object->/** @scrutinizer ignore-call */ 
619
                       setEndOffsetY($endOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetY() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

618
        $this->object->/** @scrutinizer ignore-call */ 
619
                       setEndOffsetY($endOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetY() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

618
        $this->object->/** @scrutinizer ignore-call */ 
619
                       setEndOffsetY($endOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetY() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

618
        $this->object->/** @scrutinizer ignore-call */ 
619
                       setEndOffsetY($endOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setEndOffsetY() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

618
        $this->object->/** @scrutinizer ignore-call */ 
619
                       setEndOffsetY($endOffsetY);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
619 3
    }
620
621
    /**
622
     * Read ClientData record.
623
     */
624 3
    private function readClientData()
625
    {
626 3
        $length = Xls::getInt4d($this->data, $this->pos + 4);
627 3
        $recordData = substr($this->data, $this->pos + 8, $length);
0 ignored issues
show
Unused Code introduced by
The assignment to $recordData is dead and can be removed.
Loading history...
628
629
        // move stream pointer to next record
630 3
        $this->pos += 8 + $length;
631 3
    }
632
633
    /**
634
     * Read OfficeArtRGFOPTE table of property-value pairs.
635
     *
636
     * @param string $data Binary data
637
     * @param int $n Number of properties
638
     */
639 3
    private function readOfficeArtRGFOPTE($data, $n)
640
    {
641 3
        $splicedComplexData = substr($data, 6 * $n);
642
643
        // loop through property-value pairs
644 3
        for ($i = 0; $i < $n; ++$i) {
645
            // read 6 bytes at a time
646 3
            $fopte = substr($data, 6 * $i, 6);
647
648
            // offset: 0; size: 2; opid
649 3
            $opid = Xls::getUInt2d($fopte, 0);
650
651
            // bit: 0-13; mask: 0x3FFF; opid.opid
652 3
            $opidOpid = (0x3FFF & $opid) >> 0;
653
654
            // bit: 14; mask 0x4000; 1 = value in op field is BLIP identifier
655 3
            $opidFBid = (0x4000 & $opid) >> 14;
0 ignored issues
show
Unused Code introduced by
The assignment to $opidFBid is dead and can be removed.
Loading history...
656
657
            // bit: 15; mask 0x8000; 1 = this is a complex property, op field specifies size of complex data
658 3
            $opidFComplex = (0x8000 & $opid) >> 15;
659
660
            // offset: 2; size: 4; the value for this property
661 3
            $op = Xls::getInt4d($fopte, 2);
662
663 3
            if ($opidFComplex) {
664 2
                $complexData = substr($splicedComplexData, 0, $op);
665 2
                $splicedComplexData = substr($splicedComplexData, $op);
666
667
                // we store string value with complex data
668 2
                $value = $complexData;
669
            } else {
670
                // we store integer value
671 3
                $value = $op;
672
            }
673
674 3
            $this->object->setOPT($opidOpid, $value);
5 ignored issues
show
Bug introduced by
The method setOPT() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

674
            $this->object->/** @scrutinizer ignore-call */ 
675
                           setOPT($opidOpid, $value);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setOPT() does not exist on PhpOffice\PhpSpreadsheet...ntainer\BstoreContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

674
            $this->object->/** @scrutinizer ignore-call */ 
675
                           setOPT($opidOpid, $value);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setOPT() does not exist on PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

674
            $this->object->/** @scrutinizer ignore-call */ 
675
                           setOPT($opidOpid, $value);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setOPT() does not exist on PhpOffice\PhpSpreadsheet...Container\SpgrContainer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

674
            $this->object->/** @scrutinizer ignore-call */ 
675
                           setOPT($opidOpid, $value);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method setOPT() does not exist on PhpOffice\PhpSpreadsheet...ner\BstoreContainer\BSE. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

674
            $this->object->/** @scrutinizer ignore-call */ 
675
                           setOPT($opidOpid, $value);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
675
        }
676 3
    }
677
}
678