Loading CHANGELOG.md +6 −0 Original line number Diff line number Diff line # Changelog ## 2.3.0 *Oct 4, 2020* * Shorten `dictionaryType` to `dictType`. `dictionaryType` will be removed in 3.0 * Trigger silent deprecations for deprecated stuff ## 2.2.0 *Oct 3, 2020* Loading docs/main.rst +3 −1 Original line number Diff line number Diff line Loading @@ -120,13 +120,15 @@ Decoding // You can control lists and dictionaries types with options $data = Bencode::decode( "...", dictionaryType: ArrayObject::class, // pass class name, new $type($array) will be created dictType: ArrayObject::class, // pass class name, new $type($array) will be created listType: function ($array) { // or callback for greater flexibility return new ArrayObject($array, ArrayObject::ARRAY_AS_PROPS); }, ]); // default value for both types is 'array'. you can also use 'object' for stdClass .. note:: Parameter order is not guaranteed for options, use named parameters Working with files ================== Loading Loading
CHANGELOG.md +6 −0 Original line number Diff line number Diff line # Changelog ## 2.3.0 *Oct 4, 2020* * Shorten `dictionaryType` to `dictType`. `dictionaryType` will be removed in 3.0 * Trigger silent deprecations for deprecated stuff ## 2.2.0 *Oct 3, 2020* Loading
docs/main.rst +3 −1 Original line number Diff line number Diff line Loading @@ -120,13 +120,15 @@ Decoding // You can control lists and dictionaries types with options $data = Bencode::decode( "...", dictionaryType: ArrayObject::class, // pass class name, new $type($array) will be created dictType: ArrayObject::class, // pass class name, new $type($array) will be created listType: function ($array) { // or callback for greater flexibility return new ArrayObject($array, ArrayObject::ARRAY_AS_PROPS); }, ]); // default value for both types is 'array'. you can also use 'object' for stdClass .. note:: Parameter order is not guaranteed for options, use named parameters Working with files ================== Loading