Skip to content

Commit e0b77de

Browse files
committed
fix: update documentation for fileTree sort type and unhybridized method
1 parent bddfb9f commit e0b77de

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ $fileList = $torrent->getFileList();
214214
* ]
215215
* ]
216216
*
217-
* > Add in v2.4.0
218-
* You can now pass argument to control the fileTree sort type. By default, this argument is TorrentFile::FILETREE_SORT_NORMAL.
217+
* @since v2.4.0 You can now pass argument to control the fileTree sort type.
218+
* By default, this argument is TorrentFile::FILETREE_SORT_NORMAL.
219+
*
219220
* Control Const (see different in `tests/TorrentFileTreeSortTest.php` file):
220221
* - TorrentFile::FILETREE_SORT_NORMAL : not sort, also means sort by torrent file parsed order
221222
* - TorrentFile::FILETREE_SORT_STRING : sort by filename ASC ("natural ordering" and "case-insensitively")
@@ -227,8 +228,6 @@ $fileTree = $torrent->getFileTree(?$sortType = TorrentFile::FILETREE_SORT_NORMAL
227228

228229
// 6. unhybridized
229230
/**
230-
* > Add in v2.5.0
231-
*
232231
* Create an unhybridized copy of a hybrid torrent for the specified single protocol version
233232
* (does not modify the original instance).
234233
*
@@ -237,6 +236,8 @@ $fileTree = $torrent->getFileTree(?$sortType = TorrentFile::FILETREE_SORT_NORMAL
237236
* For example:
238237
* when the target is `TorrentFile::PROTOCOL_V1`, v2 fields are removed;
239238
* when the target is `TorrentFile::PROTOCOL_V2`, v1 fields are removed.
239+
*
240+
* @since v2.5.0
240241
*/
241242
$v1ProtocolOnlyTorrent = $hybridTorrent->unhybridized(TorrentFile::PROTOCOL_V1);
242243
$v2ProtocolOnlyTorrent = $hybridTorrent->unhybridized(TorrentFile::PROTOCOL_V2);

src/TorrentFile.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,9 @@ private static function sortFileTreeRecursive(array &$fileTree, $sortByString =
769769
* ]
770770
* ]
771771
*
772-
* > Add in v2.4.0
773-
* You can now pass argument to control the fileTree sort type. By default, this argument is TorrentFile::FILETREE_SORT_NORMAL.
772+
* @since v2.4.0 You can now pass argument to control the fileTree sort type.
773+
* By default, this argument is TorrentFile::FILETREE_SORT_NORMAL.
774+
*
774775
* Control Const (see different in `tests/TorrentFileTreeSortTest.php` file):
775776
* - TorrentFile::FILETREE_SORT_NORMAL : not sort, also means sort by torrent file parsed order
776777
* - TorrentFile::FILETREE_SORT_STRING : sort by filename ASC ("natural ordering" and "case-insensitively")
@@ -795,8 +796,6 @@ public function getFileTree($sortType = self::FILETREE_SORT_NORMAL)
795796
}
796797

797798
/**
798-
* > Add in v2.5.0
799-
*
800799
* Create an unhybridized copy of a hybrid torrent for the specified single protocol version
801800
* (does not modify the original instance).
802801
*
@@ -807,9 +806,10 @@ public function getFileTree($sortType = self::FILETREE_SORT_NORMAL)
807806
* when the target is `TorrentFile::PROTOCOL_V2`, v1 fields are removed.
808807
*
809808
* @param string $targetProtocol Target protocol version, use class constants `TorrentFile::PROTOCOL_V1`
810-
* or `TorrentFile::PROTOCOL_V2`. Defaults to `TorrentFile::PROTOCOL_V1`.
809+
* or `TorrentFile::PROTOCOL_V2`. Defaults to `TorrentFile::PROTOCOL_V1`.
811810
* @return TorrentFile The cloned `TorrentFile` instance converted to the target version.
812811
* @throws ParseException If the current torrent is not hybrid or an unknown `$targetVersion` is provided.
812+
* @since v2.5.0
813813
*/
814814
public function unhybridized($targetProtocol = self::PROTOCOL_V1)
815815
{

0 commit comments

Comments
 (0)