Completed
Pull Request — master (#12)
by
unknown
06:36 queued 03:54
created
src/Database/Schema/macros/indices.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 /*
8 8
  * Create an index if it doesn't exist yet
9 9
  */
10
-Blueprint::macro('createIndexIfNotExists', function ($columns, $name = null, $connection = null) {
10
+Blueprint::macro('createIndexIfNotExists', function($columns, $name = null, $connection = null) {
11 11
     return $this->hasIndex($columns, $connection)
12 12
         ? $this
13 13
         : $this->index($columns, $name ?: $this->createIndexNameByColumns($columns));
@@ -16,21 +16,21 @@  discard block
 block discarded – undo
16 16
 /*
17 17
  * Check if an index exists
18 18
  */
19
-Blueprint::macro('hasIndex', function ($columns) {
19
+Blueprint::macro('hasIndex', function($columns) {
20 20
     return $this->getIndexNameByColumns($columns) !== null;
21 21
 });
22 22
 
23 23
 /*
24 24
  * Get an index name by columns
25 25
  */
26
-Blueprint::macro('getIndexNameByColumns', function ($columns) {
26
+Blueprint::macro('getIndexNameByColumns', function($columns) {
27 27
     if (is_string($columns)) {
28 28
         $columns = [$columns];
29 29
     }
30 30
 
31 31
     $schemaManager = Schema::getConnection()->getDoctrineSchemaManager();
32 32
     $indices = $schemaManager->listTableIndexes($this->getTable());
33
-    $filteredIndices = collect($indices)->filter(function (Index $index) use ($columns) {
33
+    $filteredIndices = collect($indices)->filter(function(Index $index) use ($columns) {
34 34
         return compare_array($index->getColumns(), $columns);
35 35
     });
36 36
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 /*
45 45
  * Create an index name based on columns
46 46
  */
47
-Blueprint::macro('createIndexNameByColumns', function ($columns) {
47
+Blueprint::macro('createIndexNameByColumns', function($columns) {
48 48
     if (is_string($columns)) {
49 49
         $columns = [$columns];
50 50
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 /*
62 62
  * Drop an index if it exists
63 63
  */
64
-Blueprint::macro('dropIndexIfExists', function ($columns) {
64
+Blueprint::macro('dropIndexIfExists', function($columns) {
65 65
     if ($this->hasIndex($columns)) {
66 66
         return $this->dropIndex($this->getIndexNameByColumns($columns));
67 67
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     return $this;
70 70
 });
71 71
 
72
-if (!function_exists('compare_array')) {
72
+if ( ! function_exists('compare_array')) {
73 73
     /**
74 74
      * @param $arrayA
75 75
      * @param $arrayB
Please login to merge, or discard this patch.