Code Duplication    Length = 7-8 lines in 2 locations

src/BlocktrailSDK.php 2 locations

@@ 598-604 (lines=7) @@
595
            throw new \InvalidArgumentException("Can't store Primary Mnemonic on server without a passphrase");
596
        }
597
598
        if ($primaryPrivateKey) {
599
            if (is_string($primaryPrivateKey)) {
600
                $primaryPrivateKey = [$primaryPrivateKey, "m"];
601
            }
602
        } else {
603
            $primaryPrivateKey = HierarchicalKeyFactory::fromEntropy((new Bip39SeedGenerator())->getSeed($primaryMnemonic, $options['passphrase']));
604
        }
605
606
        if (!$storePrimaryMnemonic) {
607
            $primaryMnemonic = false;
@@ 629-636 (lines=8) @@
626
            $backupPublicKey = $options['backup_public_key'];
627
        }
628
629
        if ($backupPublicKey) {
630
            if (is_string($backupPublicKey)) {
631
                $backupPublicKey = [$backupPublicKey, "m"];
632
            }
633
        } else {
634
            $backupPrivateKey = HierarchicalKeyFactory::fromEntropy((new Bip39SeedGenerator())->getSeed($backupMnemonic, ""));
635
            $backupPublicKey = BIP32Key::create($backupPrivateKey->toPublic(), "M");
636
        }
637
638
        // create a checksum of our private key which we'll later use to verify we used the right password
639
        $checksum = $primaryPrivateKey->getPublicKey()->getAddress()->getAddress();