From aa6681017e70252b960ae67d9b0e9308219aa865 Mon Sep 17 00:00:00 2001 From: Thomas Kerin Date: Sat, 24 Apr 2021 02:22:42 +0100 Subject: [PATCH] delete unused class WitnessCollectionMutator --- .../Mutator/WitnessCollectionMutator.php | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 src/Transaction/Mutator/WitnessCollectionMutator.php diff --git a/src/Transaction/Mutator/WitnessCollectionMutator.php b/src/Transaction/Mutator/WitnessCollectionMutator.php deleted file mode 100644 index 4da336936..000000000 --- a/src/Transaction/Mutator/WitnessCollectionMutator.php +++ /dev/null @@ -1,108 +0,0 @@ - $input) { - $set[$i] = new InputMutator($input); - } - - $this->set = \SplFixedArray::fromArray($set, false); - } - - /** - * @return InputMutator - */ - public function current() - { - return $this->set->current(); - } - - /** - * @param int $offset - * @return InputMutator - */ - public function offsetGet($offset): InputMutator - { - if (!$this->set->offsetExists($offset)) { - throw new \OutOfRangeException('Input does not exist'); - } - - return $this->set->offsetGet($offset); - } - - /** - * @return ScriptWitnessInterface[] - */ - public function done(): array - { - $set = []; - foreach ($this->set as $mutator) { - $set[] = $mutator->done(); - } - - return $set; - } - - /** - * @param int $start - * @param int $length - * @return $this - */ - public function slice(int $start, int $length) - { - $end = $this->set->getSize(); - if ($start > $end || $length > $end) { - throw new \RuntimeException('Invalid start or length'); - } - - $this->set = \SplFixedArray::fromArray(array_slice($this->set->toArray(), $start, $length), false); - return $this; - } - - /** - * @return $this - */ - public function null() - { - $this->slice(0, 0); - return $this; - } - - /** - * @param ScriptWitnessInterface $witness - * @return $this - */ - public function add(ScriptWitnessInterface $witness) - { - $size = $this->set->getSize(); - $this->set->setSize($size + 1); - - $this->set[$size] = new InputMutator($witness); - return $this; - } - - /** - * @param int $i - * @param ScriptWitnessInterface $input - * @return $this - */ - public function set(int $i, ScriptWitnessInterface $input) - { - $this->set[$i] = new InputMutator($input); - return $this; - } -}