Test Failed
Branch develop (17e410)
by Abhishek Kumar
08:42
created
database/migrations/2018_06_25_112242_create_exports_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('exports', function (Blueprint $table) {
16
+        Schema::create('exports', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('file', 255)->nullable();
19 19
             $table->string('type', 10);
Please login to merge, or discard this patch.
database/migrations/2018_06_15_103302_create_imports_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('imports', function (Blueprint $table) {
16
+        Schema::create('imports', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->string('file', 255);
19 19
             $table->integer('file_rows');
Please login to merge, or discard this patch.
database/migrations/2018_06_22_045143_create_import_export_logs_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('import_export_logs', function (Blueprint $table) {
16
+        Schema::create('import_export_logs', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->integer('op_id');
19 19
             $table->longText('data');
Please login to merge, or discard this patch.
tests/ImportExportLogTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
15 15
 
16 16
 	protected $import;
17 17
 
18
-	protected function setUp ()
18
+	protected function setUp()
19 19
 	{
20 20
 	    parent::setUp();
21 21
 
22 22
 		$this->import = Import::create([
23 23
 			'file' => 'imports/import-1530262997.csv',
24 24
 			'file_rows' => 104,
25
-			'db_cols' => [ 'name', 'email', 'password'],
25
+			'db_cols' => ['name', 'email', 'password'],
26 26
 			'model_map' => ['email', 'name', 'password']
27 27
 		]);
28 28
 	}
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
 	{
35 35
 		$import = $this->import;
36 36
 
37
-		$result = ImportExportLog::logImportError( $import, ['data' => 'this is test data'], 'This is not expected' );
37
+		$result = ImportExportLog::logImportError($import, ['data' => 'this is test data'], 'This is not expected');
38 38
 
39
-		$this->assertInstanceOf( ModelImportExportLog::class, $result );
39
+		$this->assertInstanceOf(ModelImportExportLog::class, $result);
40 40
 	}
41 41
 
42 42
 	/**
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 	{
47 47
 		$import = $this->import;
48 48
 
49
-		$log = ImportExportLog::logImportError( $import, ['data' => 'this is test data'], 'This is not expected' );
49
+		$log = ImportExportLog::logImportError($import, ['data' => 'this is test data'], 'This is not expected');
50 50
 
51
-		$log_in_db = ImportExportLog::getLogs( $log->id );
51
+		$log_in_db = ImportExportLog::getLogs($log->id);
52 52
 
53
-		$this->assertInternalType( 'array', $log_in_db );
53
+		$this->assertInternalType('array', $log_in_db);
54 54
 
55
-		$this->assertArrayHasKey( 'data', $log_in_db[0] );
55
+		$this->assertArrayHasKey('data', $log_in_db[0]);
56 56
 
57
-		$this->assertArrayHasKey( 'message', $log_in_db[0] );
57
+		$this->assertArrayHasKey('message', $log_in_db[0]);
58 58
 	}
59 59
 }
Please login to merge, or discard this patch.
src/Models/ImportExportLog.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     */
17 17
     public function import()
18 18
     {
19
-    	return $this->belongsTo( \Ladybirdweb\ImportExport\Models\Import::class );
19
+    	return $this->belongsTo(\Ladybirdweb\ImportExport\Models\Import::class);
20 20
     }
21 21
 
22 22
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     */
30 30
     public function getDataAttribute($value)
31 31
     {
32
-        return unserialize( $value );
32
+        return unserialize($value);
33 33
     }
34 34
 
35 35
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     */
43 43
     public function setDataAttribute($value)
44 44
     {
45
-        $this->attributes['data'] = serialize( $value );
45
+        $this->attributes['data'] = serialize($value);
46 46
     }
47 47
 
48 48
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     */
56 56
     public function getMessageAttribute($value)
57 57
     {
58
-        return unserialize( $value );
58
+        return unserialize($value);
59 59
     }
60 60
 
61 61
 
@@ -68,6 +68,6 @@  discard block
 block discarded – undo
68 68
     */
69 69
     public function setMessageAttribute($value)
70 70
     {
71
-        $this->attributes['message'] = serialize( $value );
71
+        $this->attributes['message'] = serialize($value);
72 72
     }
73 73
 }
Please login to merge, or discard this patch.
src/Models/Export.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 
7 7
 class Export extends Model
8 8
 {
9
-    protected $fillable = [ 'file', 'type', 'query', 'result_rows'];
9
+    protected $fillable = ['file', 'type', 'query', 'result_rows'];
10 10
 
11 11
     /**
12 12
     * Query accessor
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     */
18 18
     public function getQueryAttribute($value)
19 19
     {
20
-        return unserialize( $value );
20
+        return unserialize($value);
21 21
     }
22 22
 
23 23
 
@@ -30,6 +30,6 @@  discard block
 block discarded – undo
30 30
     */
31 31
     public function setQueryAttribute($value)
32 32
     {
33
-        $this->attributes['query'] = serialize( $value );
33
+        $this->attributes['query'] = serialize($value);
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
src/Models/Import.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     */
17 17
     public function importLogs()
18 18
     {
19
-    	return $this->hasMany( \Ladybirdweb\ImportExport\Models\ImportExportLog::class, 'op_id' );
19
+    	return $this->hasMany(\Ladybirdweb\ImportExport\Models\ImportExportLog::class, 'op_id');
20 20
     }
21 21
 
22 22
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     */
30 30
     public function getModelMapAttribute($value)
31 31
     {
32
-        return unserialize( $value );
32
+        return unserialize($value);
33 33
     }
34 34
 
35 35
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     */
43 43
     public function setModelMapAttribute($value)
44 44
     {
45
-        $this->attributes['model_map'] = serialize( $value );
45
+        $this->attributes['model_map'] = serialize($value);
46 46
     }
47 47
 
48 48
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     */
56 56
     public function getDbColsAttribute($value)
57 57
     {
58
-        return unserialize( $value );
58
+        return unserialize($value);
59 59
     }
60 60
 
61 61
 
@@ -68,6 +68,6 @@  discard block
 block discarded – undo
68 68
     */
69 69
     public function setDbColsAttribute($value)
70 70
     {
71
-        $this->attributes['db_cols'] = serialize( $value );
71
+        $this->attributes['db_cols'] = serialize($value);
72 72
     }
73 73
 }
Please login to merge, or discard this patch.
src/ImportExportServiceProvider.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -14,27 +14,27 @@  discard block
 block discarded – undo
14 14
     public function boot()
15 15
     {
16 16
         // Register routes
17
-        $this->loadRoutesFrom( __DIR__ . '/routes.php' );
17
+        $this->loadRoutesFrom(__DIR__.'/routes.php');
18 18
 
19 19
         // Register database migrations
20
-        $this->loadMigrationsFrom( __DIR__ . '/../database/migrations' );
20
+        $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
21 21
 
22 22
         // Load views
23
-        $this->loadViewsFrom( __DIR__ . '/../resources/views', 'importexport' );
23
+        $this->loadViewsFrom(__DIR__.'/../resources/views', 'importexport');
24 24
 
25 25
 
26 26
         // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'ladybirdweb');
27 27
 
28 28
         // Publishing is only necessary when using the CLI.
29
-        if ( $this->app->runningInConsole() ) {
29
+        if ($this->app->runningInConsole()) {
30 30
 
31 31
             // Publishing the configuration file.
32 32
             $this->publishes([
33
-                __DIR__ . '/../config/import.php' => config_path('ladybirdweb/import-export/import.php'),
33
+                __DIR__.'/../config/import.php' => config_path('ladybirdweb/import-export/import.php'),
34 34
             ], 'import-export.config');
35 35
             
36 36
             $this->publishes([
37
-                __DIR__ . '/../config/export.php' => config_path('ladybirdweb/import-export/export.php'),
37
+                __DIR__.'/../config/export.php' => config_path('ladybirdweb/import-export/export.php'),
38 38
             ], 'import-export.config');
39 39
 
40 40
             // Publishing the views.
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
     public function register()
59 59
     {
60 60
         // Merge config
61
-        $this->mergeConfigFrom( __DIR__ . '/../config/import.php', 'import' );
62
-        $this->mergeConfigFrom( __DIR__ . '/../config/export.php', 'export' );
61
+        $this->mergeConfigFrom(__DIR__.'/../config/import.php', 'import');
62
+        $this->mergeConfigFrom(__DIR__.'/../config/export.php', 'export');
63 63
 
64 64
         // Register fecades
65
-        $this->app->singleton( 'import', 'Ladybirdweb\ImportExport\Import' );
66
-        $this->app->singleton( 'importhandler', 'Ladybirdweb\ImportExport\ImportHandler' );
67
-        $this->app->singleton( 'importexportlog', 'Ladybirdweb\ImportExport\ImportExportLog' );
65
+        $this->app->singleton('import', 'Ladybirdweb\ImportExport\Import');
66
+        $this->app->singleton('importhandler', 'Ladybirdweb\ImportExport\ImportHandler');
67
+        $this->app->singleton('importexportlog', 'Ladybirdweb\ImportExport\ImportExportLog');
68 68
 
69
-        $this->app->singleton( 'export', 'Ladybirdweb\ImportExport\Export' );
69
+        $this->app->singleton('export', 'Ladybirdweb\ImportExport\Export');
70 70
 
71 71
         // Register import controller
72
-        $this->app->singleton( 'Ladybirdweb\ImportExport\Import' );
72
+        $this->app->singleton('Ladybirdweb\ImportExport\Import');
73 73
 
74 74
         // Register import handler
75
-        $this->app->singleton( 'Ladybirdweb\ImportExport\ImportHandler' );
75
+        $this->app->singleton('Ladybirdweb\ImportExport\ImportHandler');
76 76
         
77 77
     }
78 78
 
Please login to merge, or discard this patch.
src/ImportExportLog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 	public function getLogs($id)
21 21
 	{
22 22
 		// Get all logs of a import or export process
23
-		return Import::findOrFail( $id )->importLogs()->get( [ 'data', 'message' ] )->toArray();
23
+		return Import::findOrFail($id)->importLogs()->get(['data', 'message'])->toArray();
24 24
 	}
25 25
 
26 26
 }
Please login to merge, or discard this patch.