Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/Collection/StaticCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function isNull(): bool
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->position = 0;
Expand All @@ -112,6 +113,7 @@ public function key(): int
/**
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
++$this->position;
Expand All @@ -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);
Expand All @@ -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');
Expand All @@ -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)) {
Expand All @@ -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');
Expand Down
4 changes: 4 additions & 0 deletions src/Script/Interpreter/Stack.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function bottom()
* @param int $offset
* @return \BitWasp\Buffertools\BufferInterface
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
$index = count($this) + $offset;
Expand All @@ -121,6 +122,7 @@ public function offsetGet($offset)
* @param BufferInterface $value
* @throws \InvalidArgumentException
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
if (!$value instanceof BufferInterface) {
Expand All @@ -144,6 +146,7 @@ public function offsetSet($offset, $value)
* @param int $offset
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
$index = count($this) + $offset;
Expand All @@ -154,6 +157,7 @@ public function offsetExists($offset)
* @see \ArrayAccess::offsetUnset()
* @param int $offset
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
$count = count($this);
Expand Down
2 changes: 2 additions & 0 deletions src/Script/Opcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ private function errorNoWrite()
/**
* @param int $pos
*/
#[\ReturnTypeWillChange]
public function offsetUnset($pos)
{
$this->errorNoWrite();
Expand All @@ -360,6 +361,7 @@ public function offsetUnset($pos)
* @param int $pos
* @param mixed $value
*/
#[\ReturnTypeWillChange]
public function offsetSet($pos, $value)
{
$this->errorNoWrite();
Expand Down
9 changes: 9 additions & 0 deletions src/Transaction/Mutator/AbstractCollectionMutator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function count(): int
/**
*
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->set->rewind();
Expand All @@ -46,6 +47,7 @@ public function rewind()
/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->set->current();
Expand All @@ -54,6 +56,7 @@ public function current()
/**
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->set->key();
Expand All @@ -62,6 +65,7 @@ public function key()
/**
*
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->set->next();
Expand All @@ -70,6 +74,7 @@ public function next()
/**
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->set->valid();
Expand All @@ -79,6 +84,7 @@ public function valid()
* @param int $offset
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return $this->set->offsetExists($offset);
Expand All @@ -87,6 +93,7 @@ public function offsetExists($offset)
/**
* @param int $offset
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
if (!$this->offsetExists($offset)) {
Expand All @@ -100,6 +107,7 @@ public function offsetUnset($offset)
* @param int $offset
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if (!$this->set->offsetExists($offset)) {
Expand All @@ -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);
Expand Down