mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
fix codestyle
This commit is contained in:
parent
350dbb5b59
commit
adef27f862
37 changed files with 556 additions and 488 deletions
|
@ -28,7 +28,7 @@ namespace adapters;
|
|||
/**
|
||||
* Adapter constructor, called when instanciated by RaspiSMS.
|
||||
*
|
||||
* @param json string $datas : JSON string of the datas to configure interaction with the implemented service
|
||||
* @param json string $datas : JSON string of the datas to configure interaction with the implemented service
|
||||
*/
|
||||
public function __construct(string $datas)
|
||||
{
|
||||
|
@ -42,12 +42,12 @@ namespace adapters;
|
|||
{
|
||||
return __CLASS__;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Uniq name of the adapter
|
||||
* It should be the classname of the adapter un snakecase
|
||||
* It should be the classname of the adapter un snakecase.
|
||||
*/
|
||||
public static function meta_uid() : string
|
||||
public static function meta_uid(): string
|
||||
{
|
||||
return 'gammu_adapter';
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ namespace adapters;
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Does the implemented service support reception callback.
|
||||
*/
|
||||
|
@ -125,7 +125,6 @@ namespace adapters;
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method called to send a SMS to a number.
|
||||
*
|
||||
|
@ -134,10 +133,10 @@ namespace adapters;
|
|||
* @param bool $flash : Is the SMS a Flash SMS
|
||||
*
|
||||
* @return array : [
|
||||
* bool 'error' => false if no error, true else
|
||||
* ?string 'error_message' => null if no error, else error message
|
||||
* ?string 'uid' => Uid of the sms created on success, null on error
|
||||
* ]
|
||||
* bool 'error' => false if no error, true else
|
||||
* ?string 'error_message' => null if no error, else error message
|
||||
* ?string 'uid' => Uid of the sms created on success, null on error
|
||||
* ]
|
||||
*/
|
||||
public function send(string $destination, string $text, bool $flash = false)
|
||||
{
|
||||
|
@ -151,6 +150,7 @@ namespace adapters;
|
|||
{
|
||||
$response['error'] = true;
|
||||
$response['error_message'] = 'Cannot unlock SIM.';
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,7 @@ namespace adapters;
|
|||
{
|
||||
$response['error'] = true;
|
||||
$response['error_message'] = 'Gammu command failed.';
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -187,6 +188,7 @@ namespace adapters;
|
|||
{
|
||||
$response['error'] = true;
|
||||
$response['error_message'] = 'Cannot find output OK.';
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -208,10 +210,12 @@ namespace adapters;
|
|||
{
|
||||
$response['error'] = true;
|
||||
$response['error_message'] = 'Cannot retrieve sms uid.';
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
$response['uid'] = $uid;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -219,10 +223,10 @@ namespace adapters;
|
|||
* Method called to read SMSs of the number.
|
||||
*
|
||||
* @return array : [
|
||||
* bool 'error' => false if no error, true else
|
||||
* ?string 'error_message' => null if no error, else error message
|
||||
* array 'sms' => Array of the sms reads
|
||||
* ]
|
||||
* bool 'error' => false if no error, true else
|
||||
* ?string 'error_message' => null if no error, else error message
|
||||
* array 'sms' => Array of the sms reads
|
||||
* ]
|
||||
*/
|
||||
public function read(): array
|
||||
{
|
||||
|
@ -236,6 +240,7 @@ namespace adapters;
|
|||
{
|
||||
$response['error'] = true;
|
||||
$response['error_message'] = 'Cannot unlock sim.';
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -249,6 +254,7 @@ namespace adapters;
|
|||
{
|
||||
$response['error'] = true;
|
||||
$response['error_message'] = 'Gammu command return failed.';
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
@ -292,6 +298,25 @@ namespace adapters;
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method called on reception of a sms notification.
|
||||
*
|
||||
* @return array : [
|
||||
* bool 'error' => false on success, true on error
|
||||
* ?string 'error_message' => null on success, error message else
|
||||
* array 'sms' => array [
|
||||
* string 'at' : Recepetion date format Y-m-d H:i:s,
|
||||
* string 'text' : SMS body,
|
||||
* string 'origin' : SMS sender,
|
||||
* ]
|
||||
*
|
||||
* ]
|
||||
*/
|
||||
public static function reception_callback(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to unlock pin.
|
||||
*
|
||||
|
@ -376,24 +401,4 @@ namespace adapters;
|
|||
|
||||
return (bool) $find;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method called on reception of a sms notification.
|
||||
*
|
||||
* @return array : [
|
||||
* bool 'error' => false on success, true on error
|
||||
* ?string 'error_message' => null on success, error message else
|
||||
* array 'sms' => array [
|
||||
* string 'at' : Recepetion date format Y-m-d H:i:s,
|
||||
* string 'text' : SMS body,
|
||||
* string 'origin' : SMS sender,
|
||||
* ]
|
||||
*
|
||||
* ]
|
||||
*/
|
||||
public static function reception_callback() : array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue