Return type hints, psr, readme.md, composer.json

This commit is contained in:
2020-04-27 17:53:30 +02:00
parent bf5fc9e23a
commit f1da79c869
7 changed files with 24 additions and 18 deletions

View File

@@ -1,10 +1,9 @@
<?php
namespace BMail;
use GuzzleHttp\Client;
use Psr\Http\Message\StreamInterface;
class BMailApi
{
@@ -25,7 +24,7 @@ class BMailApi
* @return \Psr\Http\Message\StreamInterface
* @throws BMailException
*/
public function send($template)
public function send($template): StreamInterface
{
$url = config('bmail.api_url');

View File

@@ -1,7 +1,5 @@
<?php
namespace BMail;
class BMailException extends \Exception {}

View File

@@ -1,11 +1,9 @@
<?php
namespace BMail;
use Illuminate\Support\ServiceProvider;
class BMailServiceProvider extends ServiceProvider
{
/**

View File

@@ -1,6 +1,5 @@
<?php
namespace BMail;
class BMailTemplate implements \JsonSerializable
@@ -153,7 +152,7 @@ class BMailTemplate implements \JsonSerializable
*
* @return array
*/
public function toArray()
public function toArray(): array
{
return [
'template' => $this->template,
@@ -168,5 +167,4 @@ class BMailTemplate implements \JsonSerializable
{
return $this->toArray();
}
}

View File

@@ -1,14 +1,19 @@
<?php
namespace BMail;
use Illuminate\Notifications\Notification;
use Psr\Http\Message\StreamInterface;
class BMailChannel
{
public function send($notifiable, Notification $notification)
/**
* @param $notifiable
* @param Notification $notification
* @return \Psr\Http\Message\StreamInterface
* @throws BMailException
*/
public function send($notifiable, Notification $notification): StreamInterface
{
$template = $notification->toTemplate($notifiable);