Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Sep 1, 2017
1 parent 7fd3c6b commit 8bfe8f8
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 96 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/Notify/releas

## Table of contents

0. [Home](_docs/0-Home.md)
1. [Installation and Setup](_docs/1-Installation-and-Setup.md)
2. [Configuration](_docs/2-Configuration.md)
3. [Usage](_docs/3-Usage.md)
Expand Down
7 changes: 3 additions & 4 deletions _docs/1-Installation-and-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

## Table of contents

0. [Home](0-Home.md)
1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)

## Server Requirements

Expand Down
1 change: 0 additions & 1 deletion _docs/2-Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Table of contents

0. [Home](0-Home.md)
1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
Expand Down
1 change: 0 additions & 1 deletion _docs/3-Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Table of contents

0. [Home](0-Home.md)
1. [Installation and Setup](1-Installation-and-Setup.md)
2. [Configuration](2-Configuration.md)
3. [Usage](3-Usage.md)
Expand Down
12 changes: 7 additions & 5 deletions src/Contracts/Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
*/
interface Notify
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Getters & Setters
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* Get the notification message.
*
Expand Down Expand Up @@ -61,10 +62,11 @@ public function hasOption($key);
*/
public function ready();

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Flash a message.
*
Expand Down
7 changes: 4 additions & 3 deletions src/Contracts/SessionStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
*/
interface SessionStore
{
/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Flash a message to the session.
*
Expand Down
6 changes: 2 additions & 4 deletions src/Facades/Notify.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Arcanedev\Notify\Facades;

use Arcanedev\Notify\Contracts\Notify as NotifyContract;
use Illuminate\Support\Facades\Facade as Facade;

/**
Expand All @@ -15,8 +16,5 @@ class Notify extends Facade
*
* @return string
*/
protected static function getFacadeAccessor()
{
return \Arcanedev\Notify\Contracts\Notify::class;
}
protected static function getFacadeAccessor() { return NotifyContract::class; }
}
29 changes: 17 additions & 12 deletions src/Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
*/
class Notify implements NotifyContract
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Properties
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* Session prefix name.
*
Expand All @@ -30,10 +31,11 @@ class Notify implements NotifyContract
*/
private $session;

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* Create a new flash notifier instance.
*
Expand All @@ -46,10 +48,11 @@ public function __construct(SessionStore $session, $prefix)
$this->sessionPrefix = $prefix;
}

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Getters & Setters
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* Get the notification message.
*
Expand Down Expand Up @@ -117,10 +120,11 @@ public function ready()
return ! empty($this->message());
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Flash a message.
*
Expand All @@ -141,10 +145,11 @@ public function flash($message, $type = '', array $options = [])
return $this;
}

/* ------------------------------------------------------------------------------------------------
| Other Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Other Methods
| -----------------------------------------------------------------
*/

/**
* Prefix the name.
*
Expand Down
21 changes: 5 additions & 16 deletions src/NotifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
*/
class NotifyServiceProvider extends ServiceProvider
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Properties
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* Package name.
*
Expand All @@ -28,20 +29,6 @@ class NotifyServiceProvider extends ServiceProvider
*/
protected $defer = true;

/* ------------------------------------------------------------------------------------------------
| Getters & Setters
| ------------------------------------------------------------------------------------------------
*/
/**
* Get the base path of the package.
*
* @return string
*/
public function getBasePath()
{
return dirname(__DIR__);
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
Expand All @@ -51,6 +38,8 @@ public function getBasePath()
*/
public function register()
{
parent::register();

$this->registerConfig();

$this->bindSession();
Expand Down
17 changes: 10 additions & 7 deletions src/Storage/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
*/
class Session implements SessionStore
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Properties
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* The Illuminate Session instance.
*
* @var \Illuminate\Session\Store
*/
private $session;

/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
| -----------------------------------------------------------------
*/

/**
* Make session store instance.
*
Expand All @@ -36,10 +38,11 @@ public function __construct(IlluminateSession $session)
$this->session = $session;
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Flash a message to the session.
*
Expand Down
7 changes: 4 additions & 3 deletions tests/Facades/NotifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
*/
class NotifyTest extends TestCase
{
/* ------------------------------------------------------------------------------------------------
| Test Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Tests
| -----------------------------------------------------------------
*/

/** @test */
public function it_can_flash_a_notification_with_only_message()
{
Expand Down
14 changes: 8 additions & 6 deletions tests/HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@
*/
class HelperTest extends TestCase
{
/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

public function setUp()
{
parent::setUp();

$this->assertFalse(notify()->ready());
}

/* ------------------------------------------------------------------------------------------------
| Test Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Tests
| -----------------------------------------------------------------
*/

/** @test */
public function it_can_flash_a_notification_with_only_message()
{
Expand Down
38 changes: 27 additions & 11 deletions tests/NotifyServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
*/
class NotifyServiceProviderTest extends TestCase
{
/* ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Properties
| ------------------------------------------------------------------------------------------------
*/
/**
* @var NotifyServiceProvider
| -----------------------------------------------------------------
*/

/** @var \Arcanedev\Notify\NotifyServiceProvider */
private $provider;

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

public function setUp()
{
parent::setUp();
Expand All @@ -37,10 +37,26 @@ public function tearDown()
parent::tearDown();
}

/* ------------------------------------------------------------------------------------------------
| Test Functions
| ------------------------------------------------------------------------------------------------
/* -----------------------------------------------------------------
| Tests
| -----------------------------------------------------------------
*/

/** @test */
public function it_can_be_instantiated()
{
$expectations = [
\Illuminate\Support\ServiceProvider::class,
\Arcanedev\Support\ServiceProvider::class,
\Arcanedev\Support\PackageServiceProvider::class,
\Arcanedev\Notify\NotifyServiceProvider::class,
];

foreach ($expectations as $expected) {
$this->assertInstanceOf($expected, $this->provider);
}
}

/** @test */
public function it_can_provides()
{
Expand Down
Loading

0 comments on commit 8bfe8f8

Please sign in to comment.