1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-30 06:59:01 +01:00

Documentation in Serialization class (#57)

* Documentation in Serialization class

* phpcs fix

* phpcs fi

* phpcs fix

* phpcs fix

* phpci fix

* phpci fix

* Fix in var type

* sintax fix

* fix
This commit is contained in:
Vitor Mattos 2017-02-04 13:28:07 -02:00 committed by Daniil Gentili
parent 8e9d31f06f
commit a8baba6057

View File

@ -17,6 +17,15 @@ namespace danog\MadelineProto;
*/
class Serialization
{
/**
* Serialize API class.
*
* @param string $filename the dump file
* @param API $instance
* @param bool $force
*
* @return number|bool
*/
public static function serialize($filename, $instance, $force = false)
{
if ($instance->API->should_serialize || !(file_exists($filename) && !empty(file_get_contents($filename))) || $force) {
@ -28,6 +37,13 @@ class Serialization
return false;
}
/**
* Deserialize API class.
*
* @param string $filename
*
* @return bool|API
*/
public static function deserialize($filename)
{
set_error_handler(['\danog\MadelineProto\Exception', 'ExceptionErrorHandler']);