Banner: remove Deque usages

originally I introduced this to make it easier to implement the various APIs addPattern removePattern etc, but those were later removed in favour of simple getPatterns() and setPatterns(), allowing plugin developers to use ext-ds APIs to manipulate patterns.
However, ds poses a number of headaches because of mutability combined with by-ref semantics, which make it a pain to use these on the APIs because we can't guarantee that they won't be modified.
As much as arrays suck, they have two significant advantages over ext-ds: 1) they have copy-on-write semantics, and 2) they support PHP 8.0 without any extra work from me.
This commit is contained in:
Dylan K. Taylor
2021-01-15 00:17:56 +00:00
parent 4c0d3d68af
commit a9f8afa077
4 changed files with 36 additions and 59 deletions

View File

@ -1,10 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Cannot access an offset on Ds\\\\Deque\\<pocketmine\\\\block\\\\utils\\\\BannerPattern\\>\\.$#"
count: 1
path: ../../../src/block/tile/Banner.php
-
message: "#^Cannot access offset int on Ds\\\\Deque\\<pocketmine\\\\item\\\\WritableBookPage\\>\\.$#"
count: 2