Test Setup Failed
Pull Request — master (#1)
by
unknown
06:50
created

CreateQuotalogTable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 14 1
A down() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of laravel-quota
5
 *
6
 * (c) David Faith <[email protected]>
7
 *
8
 * Full copyright and license information is available
9
 * in the LICENSE file distributed with this source code.
10
 */
11
12
use Illuminate\Database\Schema\Blueprint;
13
use Illuminate\Database\Migrations\Migration;
14
15
/**
16
 * This is the quota log database migration.
17
 *
18
 * NOTE: currently supports daily period only.
19
 * TODO: REFACTOR to support multiple period types.
20
 *
21
 * @See PerodicQuota.php
22
 *
23
 */
24
class CreateQuotalogTable extends Migration
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
25
{
26
    /**
27
     * Run the migrations.
28
     *
29
     * @return void
30
     */
31
    public function up()
0 ignored issues
show
Coding Style introduced by
This method's name is shorter than the configured minimum length of 3 characters.

Even though PHP does not care about the name of your methods, it is generally a good practice to choose method names which can be easily understood by other human readers.

Loading history...
32
    {
33
        Schema::create('quotalog', function (Blueprint $table) {
34
            $table->increments('id');
35
            $table->date('date');
36
            $table->string('connection');   //@See config/quota.php
37
            $table->integer('hits')->default(0);
38
            $table->integer('misses')->default(0);
39
40
            $table->timestamps();
41
42
            $table->unique(['date', 'connection']);
43
        });
44
    }
45
46
    /**
47
     * Reverse the migrations.
48
     *
49
     * @return void
50
     */
51
    public function down()
52
    {
53
        Schema::drop('quotalog');
54
    }
55
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
56