Code Duplication    Length = 15-15 lines in 8 locations

src/mrcnpdlk/Teryt/NativeApi.php 8 locations

@@ 617-631 (lines=15) @@
614
     *
615
     * @return \SplFileObject
616
     */
617
    public function PobierzZmianyNTS(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
618
    {
619
        $toDate  = $toDate ?? new \DateTime();
620
        $res     = $this->oClient->request(
621
            'PobierzZmianyNTS',
622
            [
623
                'stanod' => $fromDate->format('Y-m-d'),
624
                'stando' => $toDate->format('Y-m-d'),
625
            ],
626
            false);
627
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
628
        $content = base64_decode($res->plik_zawartosc);
629
630
        return Helper::saveFile($sPath, $content);
631
    }
632
633
    /**
634
     * Zmiany w katalogu SIMC w wersji adresowej rejestru
@@ 641-655 (lines=15) @@
638
     *
639
     * @return \SplFileObject
640
     */
641
    public function PobierzZmianySimcAdresowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
642
    {
643
        $toDate  = $toDate ?? new \DateTime();
644
        $res     = $this->oClient->request(
645
            'PobierzZmianySimcAdresowy',
646
            [
647
                'stanod' => $fromDate->format('Y-m-d'),
648
                'stando' => $toDate->format('Y-m-d'),
649
            ],
650
            false);
651
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
652
        $content = base64_decode($res->plik_zawartosc);
653
654
        return Helper::saveFile($sPath, $content);
655
    }
656
657
    /**
658
     * Zmiany w katalogu SIMC w wersji statystycznej rejestru
@@ 665-679 (lines=15) @@
662
     *
663
     * @return \SplFileObject
664
     */
665
    public function PobierzZmianySimcStatystyczny(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
666
    {
667
        $toDate  = $toDate ?? new \DateTime();
668
        $res     = $this->oClient->request(
669
            'PobierzZmianySimcStatystyczny',
670
            [
671
                'stanod' => $fromDate->format('Y-m-d'),
672
                'stando' => $toDate->format('Y-m-d'),
673
            ],
674
            false);
675
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
676
        $content = base64_decode($res->plik_zawartosc);
677
678
        return Helper::saveFile($sPath, $content);
679
    }
680
681
    /**
682
     * Zmiany w katalogu SIMC w wersji urzędowej rejestru
@@ 689-703 (lines=15) @@
686
     *
687
     * @return \SplFileObject
688
     */
689
    public function PobierzZmianySimcUrzedowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
690
    {
691
        $toDate  = $toDate ?? new \DateTime();
692
        $res     = $this->oClient->request(
693
            'PobierzZmianySimcUrzedowy',
694
            [
695
                'stanod' => $fromDate->format('Y-m-d'),
696
                'stando' => $toDate->format('Y-m-d'),
697
            ],
698
            false);
699
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
700
        $content = base64_decode($res->plik_zawartosc);
701
702
        return Helper::saveFile($sPath, $content);
703
    }
704
705
    /**
706
     * Zmiany w katalogu TERC w wersji adresowej rejestru
@@ 713-727 (lines=15) @@
710
     *
711
     * @return \SplFileObject
712
     */
713
    public function PobierzZmianyTercAdresowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
714
    {
715
        $toDate  = $toDate ?? new \DateTime();
716
        $res     = $this->oClient->request(
717
            'PobierzZmianyTercAdresowy',
718
            [
719
                'stanod' => $fromDate->format('Y-m-d'),
720
                'stando' => $toDate->format('Y-m-d'),
721
            ],
722
            false);
723
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
724
        $content = base64_decode($res->plik_zawartosc);
725
726
        return Helper::saveFile($sPath, $content);
727
    }
728
729
    /**
730
     * Zmiany w katalogu TERC w wersji urzędowej rejestru
@@ 737-751 (lines=15) @@
734
     *
735
     * @return \SplFileObject
736
     */
737
    public function PobierzZmianyTercUrzedowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
738
    {
739
        $toDate  = $toDate ?? new \DateTime();
740
        $res     = $this->oClient->request(
741
            'PobierzZmianyTercUrzedowy',
742
            [
743
                'stanod' => $fromDate->format('Y-m-d'),
744
                'stando' => $toDate->format('Y-m-d'),
745
            ],
746
            false);
747
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
748
        $content = base64_decode($res->plik_zawartosc);
749
750
        return Helper::saveFile($sPath, $content);
751
    }
752
753
    /**
754
     * Zmiany w katalogu ULIC w wersji adresowej rejestru
@@ 761-775 (lines=15) @@
758
     *
759
     * @return \SplFileObject
760
     */
761
    public function PobierzZmianyUlicAdresowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
762
    {
763
        $toDate  = $toDate ?? new \DateTime();
764
        $res     = $this->oClient->request(
765
            'PobierzZmianyUlicAdresowy',
766
            [
767
                'stanod' => $fromDate->format('Y-m-d'),
768
                'stando' => $toDate->format('Y-m-d'),
769
            ],
770
            false);
771
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
772
        $content = base64_decode($res->plik_zawartosc);
773
774
        return Helper::saveFile($sPath, $content);
775
    }
776
777
    /**
778
     * Zmiany w katalogu ULIC w wersji urzędowej rejestru
@@ 785-799 (lines=15) @@
782
     *
783
     * @return \SplFileObject
784
     */
785
    public function PobierzZmianyUlicUrzedowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
786
    {
787
        $toDate  = $toDate ?? new \DateTime();
788
        $res     = $this->oClient->request(
789
            'PobierzZmianyUlicUrzedowy',
790
            [
791
                'stanod' => $fromDate->format('Y-m-d'),
792
                'stando' => $toDate->format('Y-m-d'),
793
            ],
794
            false);
795
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
796
        $content = base64_decode($res->plik_zawartosc);
797
798
        return Helper::saveFile($sPath, $content);
799
    }
800
801
    /**
802
     * Weryfikuje istnienie wskazanego obiektu w bazie TERYT do poziomu