DiffMatchPatch\Diff::__construct PHP Method

__construct() public method

Init object and call main(), if texts passed.
public __construct ( string | null $text1 = null, string | null $text2 = null )
$text1 string | null
$text2 string | null
    public function __construct($text1 = null, $text2 = null)
    {
        $this->toolkit = new DiffToolkit();
        if (isset($text1, $text2)) {
            $this->main($text1, $text2);
        } elseif (isset($text1) || isset($text2)) {
            throw new \InvalidArgumentException('Only one text parameter passed');
        }
    }