Skip to content

Commit

Permalink
psr-4
Browse files Browse the repository at this point in the history
  • Loading branch information
cjonstrup committed Sep 21, 2017
1 parent 619a1a0 commit 998174f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
14 changes: 12 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@
"phpunit/phpunit": "~6.0"
},
"autoload": {
"psr-0": {
"Lenius": "src/"
"psr-4": {
"Lenius\\Basket\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Lenius\\Basket\\BasketServiceProvider"
],
"aliases": {
"Basket": "Lenius\\Basket\\Facades\\Basket"
}
}
}
}
10 changes: 5 additions & 5 deletions src/Lenius/Basket/BasketServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ public function register()
});

// Shortcut so developers don't need to add an Alias in app/config/app.php
$this->app->booting(function()
{
$loader = AliasLoader::getInstance();
$loader->alias('Basket', 'Lenius\Basket\Facade');
});
//$this->app->booting(function()
//{
// $loader = AliasLoader::getInstance();
// $loader->alias('Basket', 'Lenius\Basket\Basket');
//});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*
*/

namespace Lenius\Basket;
namespace Lenius\Basket\Facades;

class Facade extends \Illuminate\Support\Facades\Facade
class Basket extends \Illuminate\Support\Facades\Facade
{
protected static function getFacadeAccessor()
{
Expand Down
21 changes: 12 additions & 9 deletions src/Lenius/Basket/Storage/LaravelSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace Lenius\Basket\Storage;

use Lenius\Basket\Item;
use Session;


class LaravelSession implements \Lenius\Basket\StorageInterface
{
Expand Down Expand Up @@ -70,9 +70,10 @@ public function &data($asArray = false)

/**
* Check if the item exists in the cart
*
* @param mixed $id
* @return boolean
*
* @param mixed $identifier
* @return bool
* @internal param mixed $id
*/
public function has($identifier)
{
Expand All @@ -87,9 +88,10 @@ public function has($identifier)

/**
* Get a single cart item by id
*
* @param mixed $id The item id
* @return Item The item class
*
* @param mixed $identifier
* @return Item The item class
* @internal param mixed $id The item id
*/
public function item($identifier)
{
Expand Down Expand Up @@ -146,8 +148,9 @@ public function destroy()

/**
* Set the cart identifier
*
* @param string $identifier
*
* @param string $id
* @internal param string $identifier
*/
public function setIdentifier($id)
{
Expand Down

0 comments on commit 998174f

Please sign in to comment.