Skip to content

Commit 34fdfc7

Browse files
committed
Cleanup some code
1 parent 3fd8da0 commit 34fdfc7

19 files changed

+361
-447
lines changed

app/Core/EloquentRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function requireById($id)
5252
return $model;
5353
}
5454

55-
public function getNew($attributes = array())
55+
public function getNew($attributes = [])
5656
{
5757
return $this->model->newInstance($attributes);
5858
}

app/Core/Entity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function getErrors()
3030
return $this->validator->errors();
3131
}
3232

33-
public function save(array $options = array())
33+
public function save(array $options = [])
3434
{
3535
if ( ! $this->isValid()) {
3636
return false;

app/Providers/CommentServiceProvider.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
namespace Lio\Providers;
33

44
use Illuminate\Support\ServiceProvider;
5+
use Lio\Comments\Comment;
6+
use Lio\Comments\CommentObserver;
57

68
class CommentServiceProvider extends ServiceProvider
79
{
8-
public function register() {}
9-
1010
public function boot()
1111
{
12-
\Lio\Comments\Comment::observe(new \Lio\Comments\CommentObserver);
12+
Comment::observe(new CommentObserver);
13+
}
14+
15+
public function register()
16+
{
17+
//
1318
}
1419
}

app/Providers/ContentServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public function register()
1313
{
1414
$this->app->bindShared(SpamDetector::class, function () {
1515
return new SpamFilter([
16-
new PhoneNumberSpamDetector(),
17-
new ForeignLanguageSpamDetector(),
16+
new PhoneNumberSpamDetector,
17+
new ForeignLanguageSpamDetector,
1818
]);
1919
});
2020
}

app/Providers/GithubServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ private function registerGithubAuthenticator()
3333

3434
public function provides()
3535
{
36-
return [GistEmbedFormatter::class, GithubAuthenticator::class];
36+
return [
37+
GistEmbedFormatter::class,
38+
GithubAuthenticator::class,
39+
];
3740
}
3841
}

app/Providers/HashidsServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class HashidsServiceProvider extends ServiceProvider
88
{
99
public function register()
1010
{
11-
$this->app->bind(['Hashids\Hashids' => 'hashids'], function($app) {
11+
$this->app->bind([Hashids::class => 'hashids'], function($app) {
1212
$key = $app['config']->get('app.key');
1313

1414
return new Hashids($key, 2);

app/lang/nl/backups.php

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/lang/nl/pagination.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

app/lang/nl/reminders.php

Lines changed: 0 additions & 24 deletions
This file was deleted.

app/lang/nl/validation.php

Lines changed: 0 additions & 98 deletions
This file was deleted.
Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
<?php
22

33
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
45

5-
class CreateSessionTable extends Migration {
6-
7-
/**
8-
* Run the migrations.
9-
*
10-
* @return void
11-
*/
12-
public function up()
13-
{
14-
Schema::create('sessions', function($t)
15-
{
16-
$t->string('id')->unique();
17-
$t->text('payload');
18-
$t->integer('last_activity');
19-
});
20-
}
21-
22-
/**
23-
* Reverse the migrations.
24-
*
25-
* @return void
26-
*/
27-
public function down()
28-
{
29-
Schema::drop('sessions');
30-
}
6+
class CreateSessionTable extends Migration
7+
{
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::create('sessions', function(Blueprint $table) {
16+
$table->string('id')->unique();
17+
$table->text('payload');
18+
$table->integer('last_activity');
19+
});
20+
}
3121

22+
/**
23+
* Reverse the migrations.
24+
*
25+
* @return void
26+
*/
27+
public function down()
28+
{
29+
Schema::drop('sessions');
30+
}
3231
}

database/migrations/2014_02_07_155103_forum_thread_visitation_timestamps_create_table.php

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,32 @@
33
use Illuminate\Database\Schema\Blueprint;
44
use Illuminate\Database\Migrations\Migration;
55

6-
class ForumThreadVisitationTimestampsCreateTable extends Migration {
7-
8-
/**
9-
* Run the migrations.
10-
*
11-
* @return void
12-
*/
13-
public function up()
14-
{
15-
Schema::table('forum_thread_visitations', function($t) {
16-
$t->create();
17-
$t->increments('id');
18-
$t->integer('user_id');
19-
$t->integer('thread_id');
20-
$t->timestamp('visited_at');
21-
$t->timestamps();
6+
class ForumThreadVisitationTimestampsCreateTable extends Migration
7+
{
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::table('forum_thread_visitations', function(Blueprint $table) {
16+
$table->create();
17+
$table->increments('id');
18+
$table->integer('user_id');
19+
$table->integer('thread_id');
20+
$table->timestamp('visited_at');
21+
$table->timestamps();
2222
});
23-
}
24-
25-
/**
26-
* Reverse the migrations.
27-
*
28-
* @return void
29-
*/
30-
public function down()
31-
{
32-
Schema::drop('forum_thread_visitations');
33-
}
23+
}
3424

25+
/**
26+
* Reverse the migrations.
27+
*
28+
* @return void
29+
*/
30+
public function down()
31+
{
32+
Schema::drop('forum_thread_visitations');
33+
}
3534
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
use Illuminate\Database\Schema\Blueprint;
4+
use Illuminate\Database\Migrations\Migration;
5+
6+
class DropUnusedTables extends Migration
7+
{
8+
/**
9+
* Run the migrations.
10+
*
11+
* @return void
12+
*/
13+
public function up()
14+
{
15+
Schema::drop('activity');
16+
Schema::drop('forum_thread_visitations');
17+
Schema::drop('sessions');
18+
}
19+
20+
/**
21+
* Reverse the migrations.
22+
*
23+
* @return void
24+
*/
25+
public function down()
26+
{
27+
Schema::table('activity', function(Blueprint $table) {
28+
$table->create();
29+
30+
$table->increments('id');
31+
$table->integer('user_id');
32+
$table->integer('activity_type');
33+
$table->integer('activity_id');
34+
$table->text('description');
35+
36+
$table->timestamps();
37+
});
38+
39+
Schema::table('forum_thread_visitations', function(Blueprint $table) {
40+
$table->create();
41+
$table->increments('id');
42+
$table->integer('user_id');
43+
$table->integer('thread_id');
44+
$table->timestamp('visited_at');
45+
$table->timestamps();
46+
});
47+
48+
Schema::create('sessions', function(Blueprint $table) {
49+
$table->string('id')->unique();
50+
$table->text('payload');
51+
$table->integer('last_activity');
52+
});
53+
}
54+
}

0 commit comments

Comments
 (0)