for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Spatie\Backup\Notifications\Senders;
use Illuminate\Contracts\Config\Repository;
use Spatie\Backup\Notifications\BaseSender;
class Pushover extends BaseSender
{
/** @var array */
protected $config;
/**
* @param Repository $config
*/
public function __construct(Repository $config)
$this->config = $config->get('laravel-backup.notifications.pushover');
$config->get('laravel-ba...otifications.pushover')
*
array
$config
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* Sends the message to the Pushover API
* @return void
public function send()
curl_setopt_array($ch = curl_init(), [
CURLOPT_URL => 'https://api.pushover.net/1/messages.json',
CURLOPT_POSTFIELDS => [
'token' => $this->config['token'],
'user' => $this->config['user'],
'title' => $this->subject,
'message' => $this->message,
'sound' => $this->getSound(),
],
CURLOPT_SAFE_UPLOAD => true,
]);
curl_exec($ch);
curl_close($ch);
* Returns the proper sound for the notification type according to the config file
* @return string The sound string to use
private function getSound()
$sounds = isset($this->config['sounds']) ? $this->config['sounds'] : ['success' => 'pushover', 'error' => 'siren'];
$sound = $this->type === static::TYPE_SUCCESS ? $sounds['success'] : $sounds['error'];
return $sound;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..