This commit is contained in:
Daniil Gentili 2017-05-18 12:50:11 +01:00
parent 0484d8f52b
commit df7a5be164
5 changed files with 11 additions and 11 deletions

View File

@ -617,7 +617,7 @@ class MTProto extends \Volatile
public function getV()
{
return 29;
return 30;
}
public function get_self()

View File

@ -262,7 +262,7 @@ trait TL
return substr($object, 1);
}
if (!is_numeric($object)) {
throw new Exception('given value ('.$object.") isn't numeric");
throw new Exception("given value isn't numeric");
}
return $this->pack_signed_long($object);

View File

@ -45,7 +45,7 @@ class TLConstructor extends \Volatile
public function find_by_type($type)
{
$key = array_search($type, (array) $this->type);
$key = array_search($type, (array) $this->type, true);
return ($key === false) ? false : [
'id' => $this->id[$key],
@ -70,7 +70,7 @@ class TLConstructor extends \Volatile
}
}
} else {
$key = array_search($predicate, (array) $this->predicate);
$key = array_search($predicate, (array) $this->predicate, true);
}
return ($key === false) ? false : [
@ -83,7 +83,7 @@ class TLConstructor extends \Volatile
public function find_by_id($id)
{
$key = array_search($id, (array) $this->id);
$key = array_search($id, (array) $this->id, true);
return ($key === false) ? false : [
'id' => $this->id[$key],

View File

@ -46,7 +46,7 @@ class TLMethod extends \Volatile
public function find_by_method($method)
{
$key = array_search($method, (array) $this->method);
$key = array_search($method, (array) $this->method, true);
return ($key === false) ? false : [
'id' => $this->id[$key],
@ -58,7 +58,7 @@ class TLMethod extends \Volatile
public function find_by_id($id)
{
$key = array_search($id, (array) $this->id);
$key = array_search($id, (array) $this->id, true);
return ($key === false) ? false : [
'id' => $this->id[$key],

View File

@ -40,12 +40,12 @@ trait Tools
public function __call($method, $params)
{
return \danog\MadelineProto\Logger::$has_thread ? $method(...$this->array_cast_recursive($params)) : $method(...$params);
return (is_object($params[0]) || \danog\MadelineProto\Logger::$has_thread) ? $method(...$this->array_cast_recursive($params, true)) : $method(...$params);
}
public function array_cast_recursive($array)
public function array_cast_recursive($array, $force = false)
{
if (!\danog\MadelineProto\Logger::$has_thread) {
if (!\danog\MadelineProto\Logger::$has_thread && !$force) {
return $array;
}
if ($this->is_array($array)) {
@ -53,7 +53,7 @@ trait Tools
$array = (array) $array;
}
foreach ($array as $key => $value) {
$array[$key] = $this->array_cast_recursive($value);
$array[$key] = $this->array_cast_recursive($value, $force);
}
}