Permalink
Browse files

nitpicks

  • Loading branch information...
1 parent ba2bd5e commit 7455fa5c373e2e51ba6c59779653bb2a87d65dc2 @freekmurze freekmurze committed Aug 11, 2016
View
@@ -1 +1,7 @@
# Changelog
+
+All Notable changes to `:package_name` will be documented in this file
+
+## 1.0.0 - 201X-XX-XX
+
+- initial release
View
@@ -1,7 +1,7 @@
# A Boilerplate repo for contributions
-Note: Replace :author_name :author_username :author_website :author_email :package_name :package_description with their correct values in README.md, CHANGELOG.md, CONTRIBUTING.md, LICENSE.md and composer.json files, then delete this line.
+**Note:** Replace ```:channel_namespace``` ```:author_name``` ```:author_username``` ```:author_website``` ```:author_email``` ```:package_name``` ```:package_description``` with their correct values in [README.md](README.md), [CHANGELOG.md](CHANGELOG.md), [CONTRIBUTING.md](CONTRIBUTING.md), [LICENSE.md](LICENSE.md) and [composer.json](composer.json) files, then delete this line.
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
## Installation
View
@@ -18,11 +18,17 @@
"illuminate/events": "^5.3@dev"
},
"require-dev": {
+ "mockery/mockery": "^0.9.5",
"phpunit/phpunit": "5.*"
},
"autoload": {
"psr-4": {
- "NotificationChannels\\CHANNEL_NAMESPACE\\": "src"
+ "NotificationChannels\\:channel_namespace\\": "src"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "NotificationChannels\\:channel_namespace\\Test\\": "tests"
}
},
"config": {
View
@@ -1,10 +1,10 @@
<?php
-namespace NotificationChannels\CHANNEL_NAMESPACE;
+namespace NotificationChannels\:channel_namespace;
-use NotificationChannels\CHANNEL_NAMESPACE\Exceptions\CouldNotSendNotification;
-use NotificationChannels\CHANNEL_NAMESPACE\Events\MessageWasSent;
-use NotificationChannels\CHANNEL_NAMESPACE\Events\SendingMessage;
+use NotificationChannels\:channel_namespace\Exceptions\CouldNotSendNotification;
+use NotificationChannels\:channel_namespace\Events\MessageWasSent;
+use NotificationChannels\:channel_namespace\Events\SendingMessage;
use Illuminate\Notifications\Notification;
class Channel
@@ -20,8 +20,7 @@ public function __construct()
* @param mixed $notifiable
* @param \Illuminate\Notifications\Notification $notification
*
- * @return void
- * @throws \NotificationChannels\CHANNEL_NAMESPACE\Exceptions\CouldNotSendNotification
+ * @throws \NotificationChannels\:channel_namespace\Exceptions\CouldNotSendNotification
*/
public function send($notifiable, Notification $notification)
{
@@ -31,7 +30,9 @@ public function send($notifiable, Notification $notification)
return;
}
-// if (error) {
+ //$response = [a call to the api of your notification send]
+
+// if ($response->error) { // replace this by the code need to check for errors
// throw CouldNotSendNotification::serviceRespondedWithAnError($response);
// }
@@ -1,24 +1,17 @@
<?php
-namespace NotificationChannels\CHANNEL_NAMESPACE\Events;
+namespace NotificationChannels\:channel_namespace\Events;
use Illuminate\Notifications\Notification;
class MessageWasSent
{
- /**
- * @var
- */
protected $notifiable;
- /**
- * @var \Illuminate\Notifications\Notification
- */
+ /** @var \Illuminate\Notifications\Notification */
protected $notification;
/**
- * MessageSending constructor.
- *
* @param $notifiable
* @param \Illuminate\Notifications\Notification $notification
*/
@@ -1,19 +1,15 @@
<?php
-namespace NotificationChannels\CHANNEL_NAMESPACE\Events;
+namespace NotificationChannels\:channel_namespace\Events;
use Illuminate\Notifications\Notification;
class SendingMessage
{
- /**
- * @var
- */
+
protected $notifiable;
- /**
- * @var \Illuminate\Notifications\Notification
- */
+ /** @var \Illuminate\Notifications\Notification */
protected $notification;
/**
@@ -1,10 +1,10 @@
<?php
-namespace NotificationChannels\CHANNEL_NAMESPACE\Exceptions;
+namespace NotificationChannels\:channel_namespace\Exceptions;
class CouldNotSendNotification extends \Exception
{
- public static function serviceRespondedWithAnError(array $response)
+ public static function serviceRespondedWithAnError($response)
{
return new static("Descriptive error message.");
}
View
@@ -1,6 +1,6 @@
<?php
-namespace NotificationChannels\CHANNEL_NAMESPACE;
+namespace NotificationChannels\:channel_namespace;
use Illuminate\Support\Arr;
View
@@ -1,9 +1,8 @@
<?php
-namespace NotificationChannels\CHANNEL_NAMESPACE;
+namespace NotificationChannels\:channel_namespace;
use Illuminate\Support\ServiceProvider;
-use Pusher;
class Provider extends ServiceProvider
{
@@ -13,6 +12,23 @@ class Provider extends ServiceProvider
public function boot()
{
// Bootstrap code here.
+
+ /**
+ * Here's some example code we use for the pusher package.
+
+ $this->app->when(Channel::class)
+ ->needs(Pusher::class)
+ ->give(function () {
+ $pusherConfig = config('broadcasting.connections.pusher');
+
+ return new Pusher(
+ $pusherConfig['key'],
+ $pusherConfig['secret'],
+ $pusherConfig['app_id']
+ );
+ });
+ */
+
}
/**
@@ -1,6 +1,6 @@
<?php
-namespace NotificationChannels\PusherPushNotifications\Test;
+namespace NotificationChannels\:channel_namespace\Test;
class ExampleTest extends \PHPUnit_Framework_TestCase
{

0 comments on commit 7455fa5

Please sign in to comment.