Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette authored Jun 15, 2019
2 parents b9f6fcf + a1b442b commit 2f3c0c4
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 65 deletions.
18 changes: 9 additions & 9 deletions locale/en_US/pastries.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

return [
"PASTRIES" => [
"@TRANSLATION" => "Pastries",
"PAGE" => "This page provides a yummy list of pastries",
"LIST" => "List of Pastries",
"NAME" => "Name",
"ORIGIN" => "Origin",
"DESCRIPTION" => "Description"
]
];
'PASTRIES' => [
'@TRANSLATION' => 'Pastries',
'PAGE' => 'This page provides a yummy list of pastries',
'LIST' => 'List of Pastries',
'NAME' => 'Name',
'ORIGIN' => 'Origin',
'DESCRIPTION' => 'Description',
],
];
18 changes: 9 additions & 9 deletions locale/fr_FR/pastries.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php

return [
"PASTRIES" => [
"@TRANSLATION" => "Pâtisseries",
"PAGE" => "Cette page propose une appétissante liste de pâtisseries",
"LIST" => "Liste des pâtisseries",
"NAME" => "Nom",
"ORIGIN" => "Origine",
"DESCRIPTION" => "Description"
]
];
'PASTRIES' => [
'@TRANSLATION' => 'Pâtisseries',
'PAGE' => 'Cette page propose une appétissante liste de pâtisseries',
'LIST' => 'Liste des pâtisseries',
'NAME' => 'Nom',
'ORIGIN' => 'Origine',
'DESCRIPTION' => 'Description',
],
];
2 changes: 1 addition & 1 deletion routes/pastries.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
$app->group('/pastries', function () {
$this->get('', 'UserFrosting\Sprinkle\Pastries\Controller\PastriesController:displayPage')
->setName('pastries');
})->add('authGuard');
})->add('authGuard');
5 changes: 2 additions & 3 deletions src/Controller/PastriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Exception\NotFoundException;
use UserFrosting\Sprinkle\Core\Controller\SimpleController;
use UserFrosting\Sprinkle\Core\Facades\Debug;
use UserFrosting\Support\Exception\ForbiddenException;
use UserFrosting\Sprinkle\Pastries\Database\Models\Pastries;
use UserFrosting\Support\Exception\ForbiddenException;

class PastriesController extends SimpleController
{
Expand All @@ -30,7 +29,7 @@ public function displayPage(Request $request, Response $response, $args)
//Debug::debug($pastries);

return $this->ci->view->render($response, 'pages/pastries.html.twig', [
'pastries' => $pastries
'pastries' => $pastries,
]);
}
}
28 changes: 13 additions & 15 deletions src/Database/Migrations/V100/DefaultPastries.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@

namespace UserFrosting\Sprinkle\Pastries\Database\Migrations\v100;

use UserFrosting\System\Bakery\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
use UserFrosting\Sprinkle\Pastries\Database\Models\Pastries;
use UserFrosting\System\Bakery\Migration;

class DefaultPastries extends Migration
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public $dependencies = [
'\UserFrosting\Sprinkle\Pastries\Database\Migrations\V100\PastriesTable'
'\UserFrosting\Sprinkle\Pastries\Database\Migrations\V100\PastriesTable',
];

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function up()
{
Expand All @@ -28,7 +26,7 @@ public function up()
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function down()
{
Expand All @@ -42,20 +40,20 @@ protected function pastries()
{
return [
[
'name' => 'Apple strudel',
'name' => 'Apple strudel',
'description' => 'Sliced apples and other fruit are wrapped and cooked in layers of filo pastry. The earliest known recipe is in Vienna, but several countries in central and eastern Europe claim this dish.',
'origin' => 'Central Europe'
'origin' => 'Central Europe',
],
[
'name' => 'Pain au chocolat',
'name' => 'Pain au chocolat',
'description' => '"Chocolate bread", also called a chocolatine in southern France and in French Canada, is a French pastry consisting of a cuboid-shaped piece of yeast-leavened laminated dough, similar to puff pastry, with one or two pieces of chocolate in the centre.',
'origin' => 'France'
'origin' => 'France',
],
[
'name' => 'Baklava',
'name' => 'Baklava',
'description' => 'A Turkish pastry that is rich and sweet, made of layers of filo pastry filled with chopped nuts and sweetened with syrup or honey.',
'origin' => 'Turkish/Greek'
]
'origin' => 'Turkish/Greek',
],
];
}
}
}
33 changes: 15 additions & 18 deletions src/Database/Migrations/V100/PastriesPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

namespace UserFrosting\Sprinkle\Pastries\Database\Migrations\v100;

use UserFrosting\System\Bakery\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
use UserFrosting\Sprinkle\Account\Database\Models\Permission;
use UserFrosting\Sprinkle\Account\Database\Models\Role;
use UserFrosting\System\Bakery\Migration;

class PastriesPermissions extends Migration
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public $dependencies = [
'\UserFrosting\Sprinkle\Account\Database\Migrations\v400\RolesTable',
'\UserFrosting\Sprinkle\Account\Database\Migrations\v400\PermissionsTable'
'\UserFrosting\Sprinkle\Account\Database\Migrations\v400\PermissionsTable',
];

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function up()
{
Expand All @@ -30,7 +27,7 @@ public function up()
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function down()
{
Expand All @@ -44,17 +41,17 @@ protected function pastryPermissions()
{
return [
[
'slug' => 'see_pastries',
'name' => 'See the pastries page',
'conditions' => 'always()',
'description' => 'Enables the user to see the pastries page'
'slug' => 'see_pastries',
'name' => 'See the pastries page',
'conditions' => 'always()',
'description' => 'Enables the user to see the pastries page',
],
[
'slug' => 'see_pastry_origin',
'name' => 'See pastry origin',
'conditions' => 'always()',
'description' => 'Allows the user to see the origin of a pastry'
]
'slug' => 'see_pastry_origin',
'name' => 'See pastry origin',
'conditions' => 'always()',
'description' => 'Allows the user to see the origin of a pastry',
],
];
}
}
}
9 changes: 4 additions & 5 deletions src/Database/Migrations/V100/PastriesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

namespace UserFrosting\Sprinkle\Pastries\Database\Migrations\v100;

use UserFrosting\System\Bakery\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
use UserFrosting\System\Bakery\Migration;

class PastriesTable extends Migration
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function up()
{
Expand All @@ -27,10 +26,10 @@ public function up()
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function down()
{
$this->schema->drop('pastries');
}
}
}
9 changes: 4 additions & 5 deletions src/Database/Models/Pastries.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

namespace UserFrosting\Sprinkle\Pastries\Database\Models;

use Illuminate\Database\Capsule\Manager as Capsule;
use UserFrosting\Sprinkle\Core\Database\Models\Model;

class Pastries extends Model
{
/**
* @var string The name of the table for the current model.
*/
protected $table = "pastries";
protected $table = 'pastries';

protected $fillable = [
"name",
"description",
"origin"
'name',
'description',
'origin',
];

/**
Expand Down

0 comments on commit 2f3c0c4

Please sign in to comment.