@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** @var \Illuminate\Database\Eloquent\Factory $factory */ |
| 4 | -$factory->define(App\User::class, function (Faker\Generator $faker) { |
|
| 4 | +$factory->define(App\User::class, function(Faker\Generator $faker) { |
|
| 5 | 5 | static $password; |
| 6 | 6 | |
| 7 | 7 | return [ |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | ]; |
| 13 | 13 | }); |
| 14 | 14 | |
| 15 | -$factory->define(Larafolio\Models\Project::class, function () { |
|
| 15 | +$factory->define(Larafolio\Models\Project::class, function() { |
|
| 16 | 16 | $name = str_random(30); |
| 17 | 17 | |
| 18 | 18 | $types = ['web', 'github', 'volunteer']; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ]; |
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | -$factory->define(Larafolio\Models\Image::class, function (Faker\Generator $faker) { |
|
| 30 | +$factory->define(Larafolio\Models\Image::class, function(Faker\Generator $faker) { |
|
| 31 | 31 | $project = factory(Larafolio\Models\Project::class)->create(); |
| 32 | 32 | |
| 33 | 33 | return [ |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ]; |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | -$factory->define(Larafolio\Models\TextBlock::class, function (Faker\Generator $faker) { |
|
| 40 | +$factory->define(Larafolio\Models\TextBlock::class, function(Faker\Generator $faker) { |
|
| 41 | 41 | $text = $faker->paragraph(5, true); |
| 42 | 42 | |
| 43 | 43 | return [ |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ]; |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | -$factory->define(Larafolio\Models\Link::class, function (Faker\Generator $faker) { |
|
| 51 | +$factory->define(Larafolio\Models\Link::class, function(Faker\Generator $faker) { |
|
| 52 | 52 | return [ |
| 53 | 53 | 'name' => $faker->word, |
| 54 | 54 | 'text' => $faker->sentence, |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | ]; |
| 58 | 58 | }); |
| 59 | 59 | |
| 60 | -$factory->define(Larafolio\Models\Page::class, function () { |
|
| 60 | +$factory->define(Larafolio\Models\Page::class, function() { |
|
| 61 | 61 | $name = str_random(30); |
| 62 | 62 | |
| 63 | 63 | return [ |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | parent::boot(); |
| 55 | 55 | |
| 56 | - static::creating(function (Model $model) { |
|
| 56 | + static::creating(function(Model $model) { |
|
| 57 | 57 | $model->setSlug('name'); |
| 58 | 58 | }); |
| 59 | 59 | |
| 60 | - static::updating(function (Model $model) { |
|
| 60 | + static::updating(function(Model $model) { |
|
| 61 | 61 | $model->setSlug('name'); |
| 62 | 62 | }); |
| 63 | 63 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | if ($group) { |
| 85 | 85 | return $query->get() |
| 86 | - ->each(function (Model $model, $key) { |
|
| 86 | + ->each(function(Model $model, $key) { |
|
| 87 | 87 | $model->index = $key; |
| 88 | 88 | }) |
| 89 | 89 | ->groupBy('type'); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function scopeOrderRelationship($query, $relationship) |
| 152 | 152 | { |
| 153 | - return $query->with([$relationship => function ($query) { |
|
| 153 | + return $query->with([$relationship => function($query) { |
|
| 154 | 154 | $query->orderBy('order'); |
| 155 | 155 | }]); |
| 156 | 156 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | /** |
| 11 | 11 | * Add a blocks and links to model. |
| 12 | 12 | * |
| 13 | - * @param Larafolio\Models\HasContent $model Model to add extras to. |
|
| 13 | + * @param HasContent $model Model to add extras to. |
|
| 14 | 14 | * @param array $data Array of posted user data. |
| 15 | 15 | * |
| 16 | 16 | * @return Larafolio\Models\HasContent |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Update a HasContent model and its children. |
| 22 | 22 | * |
| 23 | - * @param Larafolio\Models\HasContent $model Model to update. |
|
| 23 | + * @param HasContent $model Model to update. |
|
| 24 | 24 | * @param array $data Array of posted user data. |
| 25 | 25 | * |
| 26 | 26 | * @return Larafolio\Models\HasContent |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * Permanently delete a model. |
| 32 | 32 | * |
| 33 | - * @param Larafolio\Models\HasContent $model Model to delete. |
|
| 33 | + * @param HasContent $model Model to delete. |
|
| 34 | 34 | * |
| 35 | 35 | * @return bool |
| 36 | 36 | */ |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * Update a page. |
| 57 | 57 | * |
| 58 | - * @param Larafolio\Models\Page $page Page to update. |
|
| 58 | + * @param Page $page Page to update. |
|
| 59 | 59 | * @param array $data Array of data to save. |
| 60 | 60 | * |
| 61 | 61 | * @return Larafolio\Models\Page |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * Remove a page. |
| 70 | 70 | * |
| 71 | - * @param Larafolio\Models\Page $page Page to remove. |
|
| 71 | + * @param Page $page Page to remove. |
|
| 72 | 72 | * |
| 73 | 73 | * @return bool|null |
| 74 | 74 | */ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Restore a soft deleted page. |
| 82 | 82 | * |
| 83 | - * @param Larafolio\Models\Page $page Page to restore. |
|
| 83 | + * @param Page $page Page to restore. |
|
| 84 | 84 | * |
| 85 | 85 | * @return bool|null |
| 86 | 86 | */ |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | /** |
| 95 | 95 | * Hard delete a page from the portfolio. |
| 96 | 96 | * |
| 97 | - * @param Larafolio\Models\Page $page Page to purge. |
|
| 97 | + * @param Page $page Page to purge. |
|
| 98 | 98 | * |
| 99 | 99 | * @return bool|null |
| 100 | 100 | */ |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | /** |
| 11 | 11 | * Add a blocks and links to model. |
| 12 | 12 | * |
| 13 | - * @param Larafolio\Models\HasContent $model Model to add extras to. |
|
| 13 | + * @param HasContent $model Model to add extras to. |
|
| 14 | 14 | * @param array $data Array of posted user data. |
| 15 | 15 | * |
| 16 | 16 | * @return Larafolio\Models\HasContent |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | /** |
| 21 | 21 | * Update a HasContent model and its children. |
| 22 | 22 | * |
| 23 | - * @param Larafolio\Models\HasContent $model Model to update. |
|
| 23 | + * @param HasContent $model Model to update. |
|
| 24 | 24 | * @param array $data Array of posted user data. |
| 25 | 25 | * |
| 26 | 26 | * @return Larafolio\Models\HasContent |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * Permanently delete a model. |
| 32 | 32 | * |
| 33 | - * @param Larafolio\Models\HasContent $model Model to delete. |
|
| 33 | + * @param HasContent $model Model to delete. |
|
| 34 | 34 | * |
| 35 | 35 | * @return bool |
| 36 | 36 | */ |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * Update a project in the portfolio. |
| 57 | 57 | * |
| 58 | - * @param Larafolio\Models\Project $project Project to update. |
|
| 58 | + * @param Project $project Project to update. |
|
| 59 | 59 | * @param array $data Array of data to save. |
| 60 | 60 | * |
| 61 | 61 | * @return Larafolio\Models\Project |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * Remove a project from the portfolio. |
| 70 | 70 | * |
| 71 | - * @param Larafolio\Models\Project $project Project to remove. |
|
| 71 | + * @param Project $project Project to remove. |
|
| 72 | 72 | * |
| 73 | 73 | * @return bool|null |
| 74 | 74 | */ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Restore a soft deleted project. |
| 82 | 82 | * |
| 83 | - * @param Larafolio\Models\Project $project Project to restore. |
|
| 83 | + * @param Project $project Project to restore. |
|
| 84 | 84 | * |
| 85 | 85 | * @return bool|null |
| 86 | 86 | */ |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | /** |
| 95 | 95 | * Hard delete a project from the portfolio. |
| 96 | 96 | * |
| 97 | - * @param Larafolio\Models\Project $project Project to purge. |
|
| 97 | + * @param Project $project Project to purge. |
|
| 98 | 98 | * |
| 99 | 99 | * @return bool|null |
| 100 | 100 | */ |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | /** |
| 19 | 19 | * Construct. |
| 20 | 20 | * |
| 21 | - * @param Larafolio\Http\Content\ContentImages $contentImages Service class for content images. |
|
| 21 | + * @param ContentImages $contentImages Service class for content images. |
|
| 22 | 22 | */ |
| 23 | 23 | public function __construct(ContentImages $contentImages) |
| 24 | 24 | { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * Show images for project. |
| 32 | 32 | * |
| 33 | 33 | * @param \Illuminate\Http\Request $request Request from user. |
| 34 | - * @param Larafolio\Models\Page $page Page to show. |
|
| 34 | + * @param Page $page Page to show. |
|
| 35 | 35 | * |
| 36 | 36 | * @return \Illuminate\Http\Response |
| 37 | 37 | */ |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * Add a new page image. |
| 45 | 45 | * |
| 46 | 46 | * @param \Illuminate\Http\Request $request Form request. |
| 47 | - * @param Larafolio\Models\Page $page The page to add the image too. |
|
| 47 | + * @param Page $page The page to add the image too. |
|
| 48 | 48 | */ |
| 49 | 49 | public function store(Request $request, Page $page) |
| 50 | 50 | { |
@@ -23,6 +23,6 @@ |
||
| 23 | 23 | $pages = $user ? Page::all() : collect([]); |
| 24 | 24 | |
| 25 | 25 | $view->with('navProjects', $projects) |
| 26 | - ->with('navPages', $pages); |
|
| 26 | + ->with('navPages', $pages); |
|
| 27 | 27 | } |
| 28 | 28 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | factory(Page::class) |
| 23 | 23 | ->create(['name' => $name]) |
| 24 | - ->each(function (Page $project) { |
|
| 24 | + ->each(function(Page $project) { |
|
| 25 | 25 | $project->blocks()->save(factory(TextBlock::class)->make()); |
| 26 | 26 | |
| 27 | 27 | $project->links()->save(factory(Link::class)->make()); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * |
| 43 | 43 | * @param Request $request Request data containing all projects. |
| 44 | 44 | * |
| 45 | - * @return \Illuminate\Http\Response |
|
| 45 | + * @return \Illuminate\Http\JsonResponse |
|
| 46 | 46 | */ |
| 47 | 47 | public function update(Request $request) |
| 48 | 48 | { |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $projects = Project::all()->sortBy('order')->values(); |
| 20 | 20 | |
| 21 | - $projectImages = $projects->mapWithKeys(function (Project $project) { |
|
| 21 | + $projectImages = $projects->mapWithKeys(function(Project $project) { |
|
| 22 | 22 | return [$project->name() => $project->getProjectImageUrl()]; |
| 23 | 23 | })->objectIfEmpty(); |
| 24 | 24 | |
| 25 | - $projectBlocks = $projects->mapWithKeys(function (Project $project) { |
|
| 25 | + $projectBlocks = $projects->mapWithKeys(function(Project $project) { |
|
| 26 | 26 | return [$project->name() => $project->getProjectBlockText()]; |
| 27 | 27 | })->objectIfEmpty(); |
| 28 | 28 | |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Illuminate\Support\Collection; |
| 4 | 4 | |
| 5 | -if (! Collection::hasMacro('objectIfEmpty')) { |
|
| 5 | +if (!Collection::hasMacro('objectIfEmpty')) { |
|
| 6 | 6 | /* |
| 7 | 7 | * Dump the arguments given followed by the collection. |
| 8 | 8 | */ |
| 9 | - Collection::macro('objectIfEmpty', function () { |
|
| 9 | + Collection::macro('objectIfEmpty', function() { |
|
| 10 | 10 | if ($this->isEmpty()) { |
| 11 | 11 | return new \stdClass(); |
| 12 | 12 | } |