Code Duplication    Length = 23-23 lines in 4 locations

application/models/Site_Model.php 4 locations

@@ 810-832 (lines=23) @@
807
	}
808
}
809
810
class KireiCake extends Site_Model {
811
	public $site          = 'KireiCake';
812
	public $titleFormat   = '/^[a-z0-9_-]+$/';
813
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
814
815
	public function getFullTitleURL(string $title_url) : string {
816
		return "https://reader.kireicake.com/series/{$title_url}";
817
	}
818
819
	public function getChapterData(string $title_url, string $chapter) : array {
820
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
821
		$chapter_parts = explode('/', $chapter);
822
		return [
823
			'url'    => "https://reader.kireicake.com/read/{$title_url}/{$chapter}/",
824
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
825
		];
826
	}
827
828
	public function getTitleData(string $title_url) {
829
		$fullURL = $this->getFullTitleURL($title_url);
830
		return $this->parseFoolSlide($fullURL, $title_url);
831
	}
832
}
833
834
class SeaOtterScans extends Site_Model {
835
	public $site          = 'SeaOtterScans';
@@ 834-856 (lines=23) @@
831
	}
832
}
833
834
class SeaOtterScans extends Site_Model {
835
	public $site          = 'SeaOtterScans';
836
	public $titleFormat   = '/^[a-z0-9_-]+$/';
837
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
838
839
	public function getFullTitleURL(string $title_url) : string {
840
		return "https://reader.seaotterscans.com/series/{$title_url}";
841
	}
842
843
	public function getChapterData(string $title_url, string $chapter) : array {
844
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
845
		$chapter_parts = explode('/', $chapter);
846
		return [
847
			'url'    => "https://reader.seaotterscans.com/read/{$title_url}/{$chapter}/",
848
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
849
		];
850
	}
851
852
	public function getTitleData(string $title_url) {
853
		$fullURL = $this->getFullTitleURL($title_url);
854
		return $this->parseFoolSlide($fullURL, $title_url);
855
	}
856
}
857
858
class HelveticaScans extends Site_Model {
859
	public $site          = 'HelveticaScans';
@@ 858-880 (lines=23) @@
855
	}
856
}
857
858
class HelveticaScans extends Site_Model {
859
	public $site          = 'HelveticaScans';
860
	public $titleFormat   = '/^[a-z0-9_-]+$/';
861
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
862
863
	public function getFullTitleURL(string $title_url) : string {
864
		return "http://helveticascans.com/reader/series/{$title_url}";
865
	}
866
867
	public function getChapterData(string $title_url, string $chapter) : array {
868
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
869
		$chapter_parts = explode('/', $chapter);
870
		return [
871
			'url'    => "http://helveticascans.com/reader/read/{$title_url}/{$chapter}/",
872
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
873
		];
874
	}
875
876
	public function getTitleData(string $title_url) {
877
		$fullURL = $this->getFullTitleURL($title_url);
878
		return $this->parseFoolSlide($fullURL, $title_url);
879
	}
880
}
881
882
class SenseScans extends Site_Model {
883
	public $site          = 'SenseScans';
@@ 882-904 (lines=23) @@
879
	}
880
}
881
882
class SenseScans extends Site_Model {
883
	public $site          = 'SenseScans';
884
	public $titleFormat   = '/^[a-z0-9_-]+$/';
885
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
886
887
	public function getFullTitleURL(string $title_url) : string {
888
		return "http://reader.sensescans.com/series/{$title_url}";
889
	}
890
891
	public function getChapterData(string $title_url, string $chapter) : array {
892
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
893
		$chapter_parts = explode('/', $chapter);
894
		return [
895
			'url'    => "http://reader.sensescans.com/read/{$title_url}/{$chapter}/",
896
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
897
		];
898
	}
899
900
	public function getTitleData(string $title_url) {
901
		$fullURL = $this->getFullTitleURL($title_url);
902
		return $this->parseFoolSlide($fullURL, $title_url);
903
	}
904
}
905