Commit 4cb8c278 authored by Anton Smirnov's avatar Anton Smirnov
Browse files

Mark api

parent a66c7cab
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
<psalm
    errorLevel="4"
    resolveFromConfigFile="true"
    findUnusedBaselineEntry="true"
    findUnusedCode="true"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://getpsalm.org/schema/config"
    xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@ declare(strict_types=1);

namespace Arokettu\Bencode;

/**
 * @psalm-api
 */
final class Bencode
{
    /**
+12 −0
Original line number Diff line number Diff line
@@ -22,6 +22,9 @@ final class BigIntType implements \Stringable
        }
    }

    /**
     * @psalm-api
     */
    public function getValue(): string
    {
        return $this->value;
@@ -32,17 +35,26 @@ final class BigIntType implements \Stringable
        return $this->value;
    }

    /**
     * @psalm-api
     */
    public function toGMP(): \GMP
    {
        return \gmp_init($this->value);
    }

    /**
     * @psalm-api
     */
    public function toPear(): \Math_BigInteger
    {
        /** @psalm-suppress InvalidArgument bad annotation in Math_BigInteger */
        return new \Math_BigInteger($this->value);
    }

    /**
     * @psalm-api
     */
    public function toBrickMath(): BigInteger
    {
        return BigInteger::of($this->value);
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ trait IterableTypeTrait
    private Traversable $traversable;

    /**
     * @psalm-api
     * @param iterable $iterable Iterable to be wrapped
     */
    public function __construct(iterable $iterable)