diff --git a/README.md b/README.md index f0e5fabc0..a4147e4b3 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,21 @@ [![Build Status](https://scrutinizer-ci.com/g/bit-wasp/bitcoin-php/badges/build.png?b=master)](https://scrutinizer-ci.com/g/bit-wasp/bitcoin-php/build-status/master) [![Code Coverage](https://scrutinizer-ci.com/g/bit-wasp/bitcoin-php/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/bit-wasp/bitcoin-php/?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Bit-Wasp/bitcoin-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Bit-Wasp/bitcoin-php/?branch=master) -[![Latest Stable Version](https://poser.pugx.org/bitwasp/bitcoin/v/stable.png)](https://packagist.org/packages/bitwasp/bitcoin) +[![Latest Stable Version](https://poser.pugx.org/protonlabs/bitcoin/v/stable.png)](https://packagist.org/packages/protonlabs/bitcoin) This repository contains an implementation of Bitcoin using mostly pure PHP. +> This repository is a fork of [Bit-Wasp/bitcoin-php](https://github.com/Bit-Wasp/bitcoin-php) with modern PHP compatibility. + *Warning*: This library does not support 32-bit installs of PHP. Please also note that composer is the only supported installation method. ## Installation -You can install this library via Composer: `composer require bitwasp/bitcoin` +You can install this library via Composer: `composer require protonlabs/bitcoin` ## Contributing -All contributions are welcome. Please see [[this page](https://github.com/Bit-Wasp/bitcoin-php/blob/master/CONTRIBUTING.md)] before you get started +All contributions are welcome. Please see [[this page](https://github.com/ProtonMail/bitcoin-php/blob/master/CONTRIBUTING.md)] before you get started ## Documentation diff --git a/src/Collection/StaticCollection.php b/src/Collection/StaticCollection.php index e0ea54438..be24b571f 100644 --- a/src/Collection/StaticCollection.php +++ b/src/Collection/StaticCollection.php @@ -88,6 +88,7 @@ public function isNull(): bool /** * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->position = 0; @@ -112,6 +113,7 @@ public function key(): int /** * @return void */ + #[\ReturnTypeWillChange] public function next() { ++$this->position; @@ -129,6 +131,7 @@ public function valid(): bool * @param int $offset * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return array_key_exists($offset, $this->set); @@ -137,6 +140,7 @@ public function offsetExists($offset) /** * @param int $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { throw new \RuntimeException('Cannot unset from a Static Collection'); @@ -146,6 +150,7 @@ public function offsetUnset($offset) * @param int $offset * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { if (!array_key_exists($offset, $this->set)) { @@ -159,6 +164,7 @@ public function offsetGet($offset) * @param int $offset * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new \RuntimeException('Cannot add to a Static Collection'); diff --git a/src/Script/Interpreter/Stack.php b/src/Script/Interpreter/Stack.php index 57707b939..3ccd5014f 100644 --- a/src/Script/Interpreter/Stack.php +++ b/src/Script/Interpreter/Stack.php @@ -105,6 +105,7 @@ public function bottom() * @param int $offset * @return \BitWasp\Buffertools\BufferInterface */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { $index = count($this) + $offset; @@ -121,6 +122,7 @@ public function offsetGet($offset) * @param BufferInterface $value * @throws \InvalidArgumentException */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if (!$value instanceof BufferInterface) { @@ -144,6 +146,7 @@ public function offsetSet($offset, $value) * @param int $offset * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { $index = count($this) + $offset; @@ -154,6 +157,7 @@ public function offsetExists($offset) * @see \ArrayAccess::offsetUnset() * @param int $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { $count = count($this); diff --git a/src/Script/Opcodes.php b/src/Script/Opcodes.php index 7b81e5daf..98390e779 100644 --- a/src/Script/Opcodes.php +++ b/src/Script/Opcodes.php @@ -351,6 +351,7 @@ private function errorNoWrite() /** * @param int $pos */ + #[\ReturnTypeWillChange] public function offsetUnset($pos) { $this->errorNoWrite(); @@ -360,6 +361,7 @@ public function offsetUnset($pos) * @param int $pos * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($pos, $value) { $this->errorNoWrite(); diff --git a/src/Transaction/Mutator/AbstractCollectionMutator.php b/src/Transaction/Mutator/AbstractCollectionMutator.php index 222e69d03..936f90b40 100644 --- a/src/Transaction/Mutator/AbstractCollectionMutator.php +++ b/src/Transaction/Mutator/AbstractCollectionMutator.php @@ -38,6 +38,7 @@ public function count(): int /** * */ + #[\ReturnTypeWillChange] public function rewind() { $this->set->rewind(); @@ -46,6 +47,7 @@ public function rewind() /** * @return mixed */ + #[\ReturnTypeWillChange] public function current() { return $this->set->current(); @@ -54,6 +56,7 @@ public function current() /** * @return int */ + #[\ReturnTypeWillChange] public function key() { return $this->set->key(); @@ -62,6 +65,7 @@ public function key() /** * */ + #[\ReturnTypeWillChange] public function next() { $this->set->next(); @@ -70,6 +74,7 @@ public function next() /** * @return bool */ + #[\ReturnTypeWillChange] public function valid() { return $this->set->valid(); @@ -79,6 +84,7 @@ public function valid() * @param int $offset * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { return $this->set->offsetExists($offset); @@ -87,6 +93,7 @@ public function offsetExists($offset) /** * @param int $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { if (!$this->offsetExists($offset)) { @@ -100,6 +107,7 @@ public function offsetUnset($offset) * @param int $offset * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { if (!$this->set->offsetExists($offset)) { @@ -112,6 +120,7 @@ public function offsetGet($offset) * @param int $offset * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $this->set->offsetSet($offset, $value);