Completed
Branch master (0bf65c)
by Dmitry
02:31
created
src/Integration/Laravel/MapperServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
         switch ($config['connection']) {
33 33
             case 'pure':
34
-                $this->app->singleton(Connection::class, function ($app) {
34
+                $this->app->singleton(Connection::class, function($app) {
35 35
                     return new SocketConnection(config('tarantool.host'), config('tarantool.port'));
36 36
                 });
37 37
                 break;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $this->app->singleton(Manager::class);
51 51
 
52 52
         if (is_dir($convention->migrationPath())) {
53
-            $this->app->resolving(Migrator::class, function (Migrator $migrator) use ($convention) {
53
+            $this->app->resolving(Migrator::class, function(Migrator $migrator) use ($convention) {
54 54
 
55 55
                 $migrations = [];
56 56
                 foreach (with(new Finder())->files()->in($convention->migrationPath()) as $file) {
Please login to merge, or discard this patch.
resources/views/migration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php echo '<?php' , PHP_EOL; ?>
1
+<?php echo '<?php', PHP_EOL; ?>
2 2
 
3 3
 use Tarantool\Mapper\Contracts\Manager;
4 4
 use Tarantool\Mapper\Contracts\Migration;
Please login to merge, or discard this patch.
src/Schema/Type.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $properties = (array) $properties;
51 51
         foreach ($properties as $property) {
52 52
             if (!$this->hasProperty($property)) {
53
-                throw new LogicException("Unknown property $property for " . $this->name);
53
+                throw new LogicException("Unknown property $property for ".$this->name);
54 54
             }
55 55
         }
56 56
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         if ($schema->hasIndex($this->getName(), $indexName)) {
63 63
             throw new LogicException("Index $indexName already exists!");
64 64
         }
65
-        if(!$arguments) {
65
+        if (!$arguments) {
66 66
             $arguments = [];
67 67
         }
68 68
 
Please login to merge, or discard this patch.
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -45,6 +45,9 @@  discard block
 block discarded – undo
45 45
         return $this->properties;
46 46
     }
47 47
 
48
+    /**
49
+     * @param string $properties
50
+     */
48 51
     public function addIndex($properties, array $arguments = null)
49 52
     {
50 53
         $properties = (array) $properties;
@@ -81,6 +84,7 @@  discard block
 block discarded – undo
81 84
 
82 85
     /**
83 86
      * @param $property name
87
+     * @param string $first
84 88
      * @return Type
85 89
      */
86 90
     public function addProperty($first)
Please login to merge, or discard this patch.
src/Repository.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
     }
92 92
 
93 93
     /**
94
-     * @return Entity
94
+     * @return boolean
95 95
      */
96 96
     public function knows(Contracts\Entity $entity)
97 97
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
     public function find($params = [], $oneItem = false)
45 45
     {
46
-        if(is_int($params)) {
46
+        if (is_int($params)) {
47 47
             $params = [
48 48
                 'id' => $params
49 49
             ];
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
         $values = [];
55 55
 
56 56
         sort($fields);
57
-        foreach($fields as $field) {
57
+        foreach ($fields as $field) {
58 58
             $values[] = $params[$field];
59 59
         }
60 60
 
61 61
         $index = implode('_', $fields);
62 62
 
63
-        if(!$index) {
63
+        if (!$index) {
64 64
             $index = 'id';
65 65
         }
66 66
 
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
             $tuple = $this->type->encode($entity->toArray());
110 110
 
111 111
             // normalize tuple
112
-            if(array_values($tuple) != $tuple) {
112
+            if (array_values($tuple) != $tuple) {
113 113
                 // index was skipped
114 114
                 $max = max(array_keys($tuple));
115
-                foreach(range(0, $max) as $index) {
116
-                    if(!array_key_exists($index, $tuple)) {
115
+                foreach (range(0, $max) as $index) {
116
+                    if (!array_key_exists($index, $tuple)) {
117 117
                         $tuple[$index] = null;
118 118
                     }
119 119
                 }
Please login to merge, or discard this patch.