| 1 | <?php |
||
| 10 | class Signature extends Serializable implements SignatureInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var \GMP |
||
| 14 | */ |
||
| 15 | private $r; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var \GMP |
||
| 19 | */ |
||
| 20 | private $s; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var EcAdapter |
||
| 24 | */ |
||
| 25 | private $ecAdapter; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param EcAdapter $ecAdapter |
||
| 29 | * @param \GMP $r |
||
| 30 | * @param \GMP $s |
||
| 31 | 189 | */ |
|
| 32 | public function __construct(EcAdapter $ecAdapter, \GMP $r, \GMP $s) |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @inheritdoc |
||
| 41 | 179 | */ |
|
| 42 | public function getR() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @inheritdoc |
||
| 49 | 179 | */ |
|
| 50 | public function getS() |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param Signature $signature |
||
| 57 | 3 | * @return bool |
|
| 58 | */ |
||
| 59 | 3 | public function doEquals(Signature $signature) |
|
| 65 | |||
| 66 | /** |
||
| 67 | * @param SignatureInterface $signature |
||
| 68 | * @return bool |
||
| 69 | */ |
||
| 70 | public function equals(SignatureInterface $signature) |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return \BitWasp\Buffertools\BufferInterface |
||
| 78 | */ |
||
| 79 | public function getBuffer() |
||
| 83 | } |
||
| 84 |
Let’s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let’s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: