@@ -53,7 +53,7 @@ class TorrentFile
5353 protected static function checkTorrentDict ($ dict , $ key , $ type = null )
5454 {
5555 if (!is_array ($ dict )) {
56- throw new ParseException ('Checking non-dictionary value. ' );
56+ throw new ParseException ('Checking non-dictionary value ' );
5757 }
5858
5959 if (!isset ($ dict [$ key ])) {
@@ -578,7 +578,7 @@ public function parse()
578578 if ($ this ->getProtocol () === self ::PROTOCOL_V1 ) { // Do what we do in protocol v1
579579 $ pieces = self ::checkTorrentDict ($ info , 'pieces ' , 'string ' );
580580 if (strlen ($ pieces ) % 20 != 0 ) {
581- throw new ParseException ('Invalid pieces length. ' );
581+ throw new ParseException ('Invalid pieces length ' );
582582 }
583583
584584 if ($ this ->getFileMode () === self ::FILEMODE_SINGLE ) {
@@ -596,7 +596,7 @@ public function parse()
596596
597597 foreach ($ paths as $ path ) {
598598 if (!is_string ($ path )) {
599- throw new ParseException ('Invalid path with non-string value. ' );
599+ throw new ParseException ('Invalid path with non-string value ' );
600600 }
601601 }
602602
@@ -635,15 +635,14 @@ public function parse()
635635 $ length = self ::checkTorrentDict ($ file , 'length ' , 'integer ' );
636636 if ($ length > $ pieceLength ) { // check pieces root of large file is exist in $root['picec layers'] or not
637637 if (!array_key_exists ($ piecesRoot , $ pieceLayers )) {
638- throw new ParseException ('Pieces not exist in piece layers. ' );
638+ throw new ParseException ('Pieces not exist in piece layers ' );
639639 }
640640 }
641641
642642 $ addFile ($ paths , $ length );
643643 $ merkleTree = $ length ; // rewrite merkleTree to size, it's safe since it not affect $data['info']['file tree']
644644 } else {
645645 $ parent_path = $ paths ; // store parent paths
646- /** @noinspection PhpParameterByRefIsNotUsedAsReferenceInspection */
647646 foreach ($ merkleTree as $ k => &$ v ) { // Loop tree
648647 $ paths [] = $ k ; // push current path into paths
649648 $ loopMerkleTree ($ v , $ paths ); // Loop check
0 commit comments