Passed
Push — master ( 2eff58...565fcc )
by Tyler
03:04
created
src/Concerns/MorphsTo.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,33 +7,33 @@
 block discarded – undo
7 7
 trait MorphsTo
8 8
 {
9 9
     /**
10
-	 * Defines a Belongs To Column and Relationship.
11
-	 *
10
+     * Defines a Belongs To Column and Relationship.
11
+     *
12 12
      * @param  string       $morphable
13 13
      * @param  string|null  $index
14 14
      *
15 15
      * @return \Reed\Blueprints\Columns
16
-	 */
16
+     */
17 17
     public function morphsTo($morphable, $index = null)
18 18
     {
19 19
         // Define the ID
20 20
         $id = $this->morphsToIdColumn($morphable);
21 21
 
22
-    	// Define the Type
23
-    	$type = $this->morphsToTypeColumn($morphable);
22
+        // Define the Type
23
+        $type = $this->morphsToTypeColumn($morphable);
24 24
 
25 25
         // Return the Columns
26 26
         return $this->newColumns([$id, $type]);
27 27
     }
28 28
 
29 29
     /**
30
-	 * Defines a Belongs To Column and Relationship using a Big Integer.
31
-	 *
30
+     * Defines a Belongs To Column and Relationship using a Big Integer.
31
+     *
32 32
      * @param  string       $morphable
33 33
      * @param  string|null  $index
34 34
      *
35 35
      * @return \Reed\Blueprints\Columns
36
-	 */
36
+     */
37 37
     public function bigMorphsTo($morphable, $index = null)
38 38
     {
39 39
         // Define the ID
Please login to merge, or discard this patch.
src/Concerns/TimestampsBy.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function timestampsBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null)
19 19
     {
20
-    	// Add the 'created_by_id' Reference
20
+        // Add the 'created_by_id' Reference
21 21
         $this->createdBy($table, $local, $name, $onUpdate, $onDelete);
22 22
 
23
-		// Add the 'updated_by_id' Reference
23
+        // Add the 'updated_by_id' Reference
24 24
         $this->updatedBy($table, $local, $name, $onUpdate, $onDelete);
25 25
     }
26 26
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         }
96 96
 
97 97
         // Create the Belongs to Relation
98
-    	return $this->belongsTo($table, 'created_by_id', $local, $name, $onUpdate, $onDelete)->nullable();
98
+        return $this->belongsTo($table, 'created_by_id', $local, $name, $onUpdate, $onDelete)->nullable();
99 99
     }
100 100
 
101 101
     /**
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         }
178 178
 
179 179
         // Create the Belongs to Relation
180
-    	return $this->belongsTo($table, 'updated_by_id', $local, $name, $onUpdate, $onDelete)->nullable();
180
+        return $this->belongsTo($table, 'updated_by_id', $local, $name, $onUpdate, $onDelete)->nullable();
181 181
     }
182 182
 
183 183
     /**
Please login to merge, or discard this patch.
src/Concerns/BelongsTo.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 trait BelongsTo
8 8
 {
9 9
     /**
10
-	 * Defines a Belongs To Column and Relationship.
11
-	 *
10
+     * Defines a Belongs To Column and Relationship.
11
+     *
12 12
      * @param  string       $table
13 13
      * @param  string|null  $foreign
14 14
      * @param  string|null  $local
@@ -17,27 +17,27 @@  discard block
 block discarded – undo
17 17
      * @param  string|null  $onDelete
18 18
      *
19 19
      * @return \Illuminate\Support\Fluent
20
-	 */
20
+     */
21 21
     public function belongsTo($table, $foreign = null, $local = null, $name = null, $onUpdate = null, $onDelete = null)
22 22
     {
23
-    	// Determine the Name of the Foreign Key
24
-    	if(is_null($foreign)) {
25
-    		$foreign = Str::singular($table) . '_id';
26
-    	}
23
+        // Determine the Name of the Foreign Key
24
+        if(is_null($foreign)) {
25
+            $foreign = Str::singular($table) . '_id';
26
+        }
27 27
 
28
-    	// Define the Column
29
-    	$column = $this->belongsToColumn($foreign);
28
+        // Define the Column
29
+        $column = $this->belongsToColumn($foreign);
30 30
 
31
-    	// Define the Relation
32
-    	$this->belongsToForeign($table, $foreign, $local, $name, $onUpdate, $onDelete);
31
+        // Define the Relation
32
+        $this->belongsToForeign($table, $foreign, $local, $name, $onUpdate, $onDelete);
33 33
 
34
-    	// Return the Column
35
-    	return $column;
34
+        // Return the Column
35
+        return $column;
36 36
     }
37 37
 
38 38
     /**
39
-	 * Defines a Belongs To Column and Relationship using a Big Integer.
40
-	 *
39
+     * Defines a Belongs To Column and Relationship using a Big Integer.
40
+     *
41 41
      * @param  string       $table
42 42
      * @param  string|null  $foreign
43 43
      * @param  string|null  $local
@@ -46,22 +46,22 @@  discard block
 block discarded – undo
46 46
      * @param  string|null  $onDelete
47 47
      *
48 48
      * @return \Illuminate\Support\Fluent
49
-	 */
49
+     */
50 50
     public function bigBelongsTo($table, $foreign = null, $local = null, $name = null, $onUpdate = null, $onDelete = null)
51 51
     {
52
-    	// Determine the Name of the Foreign Key
53
-    	if(is_null($foreign)) {
54
-    		$foreign = Str::singular($table) . '_id';
55
-    	}
52
+        // Determine the Name of the Foreign Key
53
+        if(is_null($foreign)) {
54
+            $foreign = Str::singular($table) . '_id';
55
+        }
56 56
 
57
-    	// Define the Column
58
-    	$column = $this->bigBelongsToColumn($foreign);
57
+        // Define the Column
58
+        $column = $this->bigBelongsToColumn($foreign);
59 59
 
60
-    	// Define the Relation
60
+        // Define the Relation
61 61
         $this->belongsToForeign($table, $foreign, $local, $name, $onUpdate, $onDelete);
62 62
 
63
-    	// Return the Column
64
-    	return $column;
63
+        // Return the Column
64
+        return $column;
65 65
     }
66 66
 
67 67
     /**
Please login to merge, or discard this patch.
src/Concerns/Columns.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@
 block discarded – undo
6 6
 
7 7
 trait Columns
8 8
 {
9
-	/**
10
-	 * Creates and returns a new collection of Columns.
11
-	 *
12
-	 * @param  mixed  $columns
13
-	 *
14
-	 * @return \Reed\Blueprints\Columns
15
-	 */
16
-	public function newColumns($columns = [])
17
-	{
18
-		return new ColumnCollection($columns);
19
-	}
9
+    /**
10
+     * Creates and returns a new collection of Columns.
11
+     *
12
+     * @param  mixed  $columns
13
+     *
14
+     * @return \Reed\Blueprints\Columns
15
+     */
16
+    public function newColumns($columns = [])
17
+    {
18
+        return new ColumnCollection($columns);
19
+    }
20 20
 }
21 21
\ No newline at end of file
Please login to merge, or discard this patch.
src/Concerns/SoftDeletesBy.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function softDeletesBy($table = null, $local = null, $name = null, $onUpdate = null, $onDelete = null)
19 19
     {
20
-    	return $this->deletedBy($table, $local, $name, $onUpdate, $onDelete);
20
+        return $this->deletedBy($table, $local, $name, $onUpdate, $onDelete);
21 21
     }
22 22
 
23 23
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         }
80 80
 
81 81
         // Create the Belongs to Relation
82
-    	return $this->belongsTo($table, 'deleted_by_id', $local, $name, $onUpdate, $onDelete)->nullable();
82
+        return $this->belongsTo($table, 'deleted_by_id', $local, $name, $onUpdate, $onDelete)->nullable();
83 83
     }
84 84
 
85 85
     /**
Please login to merge, or discard this patch.
src/Concerns/Indexes.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -16,18 +16,18 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public function foreign($columns, $name = null, $on = null)
18 18
     {
19
-    	// Index the Foreign Key
20
-    	$index = $this->indexCommand('foreign', $columns, $name, $on);
19
+        // Index the Foreign Key
20
+        $index = $this->indexCommand('foreign', $columns, $name, $on);
21 21
 
22
-    	// Automatically Reference ID
23
-    	$index->references('id');
22
+        // Automatically Reference ID
23
+        $index->references('id');
24 24
 
25
-    	// Declare ON if specified
26
-    	if(!is_null($on)) {
27
-    		$index->on($on);
28
-    	}
25
+        // Declare ON if specified
26
+        if(!is_null($on)) {
27
+            $index->on($on);
28
+        }
29 29
 
30
-    	// Return the Index
30
+        // Return the Index
31 31
         return $index;
32 32
     }
33 33
 
@@ -65,59 +65,59 @@  discard block
 block discarded – undo
65 65
      */
66 66
     protected function createIndexName($type, array $columns, $foreign = null)
67 67
     {
68
-    	// Determine the Type Abbreviation
69
-    	$abbreviation = $this->createIndexTypeName($type);
68
+        // Determine the Type Abbreviation
69
+        $abbreviation = $this->createIndexTypeName($type);
70 70
 
71
-    	// Determine the Foreign Key Table Reference
72
-    	if($type == 'foreign' && is_null($foreign)) {
73
-    		$foreign = $this->createForeignIndexName($columns);
74
-    	}
71
+        // Determine the Foreign Key Table Reference
72
+        if($type == 'foreign' && is_null($foreign)) {
73
+            $foreign = $this->createForeignIndexName($columns);
74
+        }
75 75
 
76
-    	// Convert the Columns
77
-    	$columns = implode('_', $columns);
76
+        // Convert the Columns
77
+        $columns = implode('_', $columns);
78 78
 
79
-    	// Determine the Index Name
80
-    	if(isset($foreign)) {
81
-    		$index = $abbreviation . strtolower("_{$this->table}_{$foreign}_{$columns}");
82
-    	} else {
83
-    		$index = $abbreviation . strtolower("_{$this->table}_{$columns}");
84
-    	}
79
+        // Determine the Index Name
80
+        if(isset($foreign)) {
81
+            $index = $abbreviation . strtolower("_{$this->table}_{$foreign}_{$columns}");
82
+        } else {
83
+            $index = $abbreviation . strtolower("_{$this->table}_{$columns}");
84
+        }
85 85
 
86
-    	// Replace Illegal Characters
86
+        // Replace Illegal Characters
87 87
         return str_replace(['-', '.'], '_', $index);
88 88
     }
89 89
 
90 90
     /**
91
-	 * Returns the Index Type Abbreviation for the specified Type.
92
-	 *
93
-	 * @param  string  $type
94
-	 *
95
-	 * @return string
91
+     * Returns the Index Type Abbreviation for the specified Type.
92
+     *
93
+     * @param  string  $type
94
+     *
95
+     * @return string
96 96
      */
97 97
     protected function createIndexTypeName($type)
98 98
     {
99
-    	// Convert Type to Abbreviation
100
-    	switch($type) {
99
+        // Convert Type to Abbreviation
100
+        switch($type) {
101 101
 
102
-    		// Primary Key
103
-    		case 'primary':
104
-    			return 'PK';
102
+            // Primary Key
103
+            case 'primary':
104
+                return 'PK';
105 105
 
106
-    		// Unique Key
107
-    		case 'unique':
108
-    			return 'UX';
106
+            // Unique Key
107
+            case 'unique':
108
+                return 'UX';
109 109
 
110
-    		// Foreign Key
111
-    		case 'foreign':
112
-    			return 'FK';
110
+            // Foreign Key
111
+            case 'foreign':
112
+                return 'FK';
113 113
 
114
-    		// General Index
115
-    		case 'index':
116
-    			return 'IX';
117
-    	}
114
+            // General Index
115
+            case 'index':
116
+                return 'IX';
117
+        }
118 118
 
119
-    	// Unknown Type
120
-    	return $type;
119
+        // Unknown Type
120
+        return $type;
121 121
     }
122 122
 
123 123
     /**
@@ -129,22 +129,22 @@  discard block
 block discarded – undo
129 129
      */
130 130
     protected function createForeignIndexName(array $columns)
131 131
     {
132
-    	// Initialize the List of Tables
133
-    	$tables = [];
132
+        // Initialize the List of Tables
133
+        $tables = [];
134 134
 
135
-		// Determine the Tables being References
136
-    	foreach($columns as $column) {
135
+        // Determine the Tables being References
136
+        foreach($columns as $column) {
137 137
 
138
-    		// Derive the Table Name from the Column
139
-    		$table = $this->getTableNameFromColumn($column);
138
+            // Derive the Table Name from the Column
139
+            $table = $this->getTableNameFromColumn($column);
140 140
 
141
-    		// Use the Table Name, or the Column if one couldn't be found
142
-    		$tables[] = !is_null($table) ? $table : $column;
141
+            // Use the Table Name, or the Column if one couldn't be found
142
+            $tables[] = !is_null($table) ? $table : $column;
143 143
 
144
-    	}
144
+        }
145 145
 
146
-    	// Flatten the Array
147
-    	return implode('_', $tables);
146
+        // Flatten the Array
147
+        return implode('_', $tables);
148 148
     }
149 149
 
150 150
     /**
@@ -156,18 +156,18 @@  discard block
 block discarded – undo
156 156
      */
157 157
     protected function getTableNameFromColumn($column)
158 158
     {
159
-    	// Make sure the Table has an ID Suffix
160
-    	if(!Str::endsWith($column, '_id')) {
161
-    		return null;
162
-    	}
159
+        // Make sure the Table has an ID Suffix
160
+        if(!Str::endsWith($column, '_id')) {
161
+            return null;
162
+        }
163 163
 
164
-    	// Strip the '_id' Suffix
165
-    	$column = substr($column, 0, -3);
164
+        // Strip the '_id' Suffix
165
+        $column = substr($column, 0, -3);
166 166
 
167
-    	// Pluralize the Column Name
168
-    	$column = Str::plural($column);
167
+        // Pluralize the Column Name
168
+        $column = Str::plural($column);
169 169
 
170
-    	// Use the Plural form of the ID-less Column Name as the Table Name
171
-    	return $column;
170
+        // Use the Plural form of the ID-less Column Name as the Table Name
171
+        return $column;
172 172
     }
173 173
 }
174 174
\ No newline at end of file
Please login to merge, or discard this patch.
src/Schema.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public static function connection($name)
20 20
     {
21
-    	// Create the schema builder
21
+        // Create the schema builder
22 22
         $schema = parent::connection($name);
23 23
 
24 24
         // Use the custom blueprint
25 25
         $schema->blueprintResolver(function($table, $callback) {
26
-        	return new Blueprint($table, $callback);
26
+            return new Blueprint($table, $callback);
27 27
         });
28 28
 
29 29
         // Return the schema
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
      */
38 38
     protected static function getFacadeAccessor()
39 39
     {
40
-    	// Create the schema builder
40
+        // Create the schema builder
41 41
         $schema = parent::getFacadeAccessor();
42 42
 
43 43
         // Use the custom blueprint
44 44
         $schema->blueprintResolver(function($table, $callback) {
45
-        	return new Blueprint($table, $callback);
45
+            return new Blueprint($table, $callback);
46 46
         });
47 47
 
48 48
         // Return the schema
Please login to merge, or discard this patch.
src/Columns.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function __construct($columns = [])
25 25
     {
26
-    	// Call Parent Constructor
27
-    	parent::__construct($columns);
26
+        // Call Parent Constructor
27
+        parent::__construct($columns);
28 28
 
29
-    	// Set the Blueprint
30
-    	$this->blueprint = $this->guessBlueprint();
29
+        // Set the Blueprint
30
+        $this->blueprint = $this->guessBlueprint();
31 31
     }
32 32
 
33 33
     /**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function getBlueprint()
39 39
     {
40
-    	return $this->blueprint;
40
+        return $this->blueprint;
41 41
     }
42 42
 
43 43
     /**
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
      */
50 50
     public function setBlueprint(Blueprint $blueprint)
51 51
     {
52
-    	$this->blueprint = $blueprint;
52
+        $this->blueprint = $blueprint;
53 53
 
54
-    	return $this;
54
+        return $this;
55 55
     }
56 56
 
57 57
     /**
@@ -61,21 +61,21 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function guessBlueprint()
63 63
     {
64
-    	// Determine the Caller
65
-    	[$one, $two, $caller] = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
64
+        // Determine the Caller
65
+        [$one, $two, $caller] = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
66 66
 
67
-    	// Check for Blueprint Caller
68
-    	if($caller['object'] instanceof Blueprint) {
67
+        // Check for Blueprint Caller
68
+        if($caller['object'] instanceof Blueprint) {
69 69
             return $caller['object'];
70
-    	}
70
+        }
71 71
 
72
-    	// Check for Columns Caller
73
-    	if($caller['object'] instanceof static) {
72
+        // Check for Columns Caller
73
+        if($caller['object'] instanceof static) {
74 74
             return $caller['object']->getBlueprint();
75
-    	}
75
+        }
76 76
 
77
-    	// Unknown Caller
78
-    	return null;
77
+        // Unknown Caller
78
+        return null;
79 79
     }
80 80
 
81 81
     /**
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function __call($method, $parameters)
103 103
     {
104
-    	// Check for Macro
104
+        // Check for Macro
105 105
         if(static::hasMacro($method)) {
106 106
             return parent::__call($method, $parameters);
107 107
         }
Please login to merge, or discard this patch.