| @@ -66,7 +66,7 @@ | ||
| 66 | 66 | |
| 67 | 67 |          if ($this->data->package ?? false) { | 
| 68 | 68 |              $packageParts = explode('/', $this->data->package); | 
| 69 | - $package = $packageParts[count($packageParts)-1].'::'; | |
| 69 | + $package = $packageParts[ count($packageParts) - 1 ].'::'; | |
| 70 | 70 | } | 
| 71 | 71 | |
| 72 | 72 | return $package; | 
| @@ -27,19 +27,19 @@ | ||
| 27 | 27 | public function run() | 
| 28 | 28 |      { | 
| 29 | 29 | // Get module | 
| 30 | - $module = ucmodule($this->config['module']); | |
| 30 | + $module = ucmodule($this->config[ 'module' ]); | |
| 31 | 31 | |
| 32 | 32 | // Get record | 
| 33 | 33 | $modelClass = $module->model_class; | 
| 34 | - $record = $modelClass::find($this->config['record_id']); | |
| 34 | + $record = $modelClass::find($this->config[ 'record_id' ]); | |
| 35 | 35 | |
| 36 | 36 |          return view('uccello::widgets.summary_fields', [ | 
| 37 | 37 | 'config' => $this->config, | 
| 38 | - 'domain' => ucdomain($this->config['domain']), | |
| 38 | + 'domain' => ucdomain($this->config[ 'domain' ]), | |
| 39 | 39 | 'module' => $module, | 
| 40 | - 'data' => (object) $this->config['data'], | |
| 40 | + 'data' => (object)$this->config[ 'data' ], | |
| 41 | 41 | 'record' => $record, | 
| 42 | - 'label' => $this->config['data']->label ?? $this->config['labelForTranslation'], | |
| 42 | + 'label' => $this->config[ 'data' ]->label ?? $this->config[ 'labelForTranslation' ], | |
| 43 | 43 | ]); | 
| 44 | 44 | } | 
| 45 | 45 | } | 
| @@ -35,8 +35,8 @@ discard block | ||
| 35 | 35 | |
| 36 | 36 | // Get file data from request | 
| 37 | 37 | $fileData = $this->getFileDataFromRequest(); | 
| 38 | - $fileName = $fileData['name']; | |
| 39 | - $filePath = $fileData['path']; | |
| 38 | + $fileName = $fileData[ 'name' ]; | |
| 39 | + $filePath = $fileData[ 'path' ]; | |
| 40 | 40 | |
| 41 | 41 | // Check if file exists | 
| 42 | 42 |          if (!Storage::exists($filePath)) { | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | $fileName = null; | 
| 58 | 58 | $filePath = null; | 
| 59 | 59 | |
| 60 | -        $recordId = (int) request('id'); | |
| 60 | +        $recordId = (int)request('id'); | |
| 61 | 61 |          $fieldColumn = request('field'); | 
| 62 | 62 | |
| 63 | 63 | // Get record | 
| @@ -70,8 +70,8 @@ discard block | ||
| 70 | 70 |              $fileParts = explode(';', $fileData); | 
| 71 | 71 | |
| 72 | 72 |              if (count($fileParts) === 2) { | 
| 73 | - $fileName = $fileParts[0]; | |
| 74 | - $filePath = $fileParts[1]; | |
| 73 | + $fileName = $fileParts[ 0 ]; | |
| 74 | + $filePath = $fileParts[ 1 ]; | |
| 75 | 75 | } | 
| 76 | 76 | } | 
| 77 | 77 | |
| @@ -87,8 +87,8 @@ | ||
| 87 | 87 | */ | 
| 88 | 88 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder | 
| 89 | 89 |      { | 
| 90 | -        $query->where(function ($query) use($field, $value) { | |
| 91 | -            foreach ((array) $value as $_value) { | |
| 90 | +        $query->where(function($query) use($field, $value) { | |
| 91 | +            foreach ((array)$value as $_value) { | |
| 92 | 92 | $formattedValue = $this->getFormattedValueToSearch($_value); | 
| 93 | 93 | $query = $query->orWhere($field->column, 'like', $formattedValue); | 
| 94 | 94 | } | 
| @@ -87,8 +87,8 @@ | ||
| 87 | 87 | */ | 
| 88 | 88 | public function addConditionToSearchQuery(Builder $query, Field $field, $value) : Builder | 
| 89 | 89 |      { | 
| 90 | -        $query->where(function ($query) use($field, $value) { | |
| 91 | -            foreach ((array) $value as $_value) { | |
| 90 | +        $query->where(function($query) use($field, $value) { | |
| 91 | +            foreach ((array)$value as $_value) { | |
| 92 | 92 | $formattedValue = $this->getFormattedValueToSearch($_value); | 
| 93 | 93 | $query = $query->orWhere($field->column, $formattedValue); | 
| 94 | 94 | } | 
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | } | 
| 33 | 33 | |
| 34 | 34 | // If the form is not valid display a notification | 
| 35 | -        if (! $this->isValid()) { | |
| 35 | +        if (!$this->isValid()) { | |
| 36 | 36 |              ucnotify(uctrans('notification.form.not_valid', $module), 'error'); | 
| 37 | 37 | } | 
| 38 | 38 | |
| @@ -27,7 +27,7 @@ discard block | ||
| 27 | 27 | $this->registerTranslations(); | 
| 28 | 28 | $this->registerPublishing(); | 
| 29 | 29 | |
| 30 | - $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'uccello'); | |
| 30 | + $this->loadViewsFrom(__DIR__.'/../../resources/views', 'uccello'); | |
| 31 | 31 | } | 
| 32 | 32 | |
| 33 | 33 | /** | 
| @@ -38,7 +38,7 @@ discard block | ||
| 38 | 38 | private function registerMigrations() | 
| 39 | 39 |      { | 
| 40 | 40 |          if ($this->app->runningInConsole()) { | 
| 41 | - $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); | |
| 41 | + $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); | |
| 42 | 42 | } | 
| 43 | 43 | } | 
| 44 | 44 | |
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | */ | 
| 50 | 50 | private function registerTranslations() | 
| 51 | 51 |      { | 
| 52 | - $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'uccello'); | |
| 52 | + $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'uccello'); | |
| 53 | 53 | } | 
| 54 | 54 | |
| 55 | 55 | /** | 
| @@ -62,18 +62,18 @@ discard block | ||
| 62 | 62 |          if ($this->app->runningInConsole()) { | 
| 63 | 63 | // Publish assets | 
| 64 | 64 | $this->publishes([ | 
| 65 | -                __DIR__ . '/../../public' => public_path('vendor/uccello/uccello'), | |
| 66 | -                __DIR__ . '/../../public/images/vendor' => public_path('images/vendor') | |
| 65 | +                __DIR__.'/../../public' => public_path('vendor/uccello/uccello'), | |
| 66 | +                __DIR__.'/../../public/images/vendor' => public_path('images/vendor') | |
| 67 | 67 | ], 'uccello-assets'); | 
| 68 | 68 | |
| 69 | 69 | // Config | 
| 70 | 70 | $this->publishes([ | 
| 71 | -                __DIR__ . '/../../config/uccello.php' => config_path('uccello.php'), | |
| 71 | +                __DIR__.'/../../config/uccello.php' => config_path('uccello.php'), | |
| 72 | 72 | ], 'uccello-config'); | 
| 73 | 73 | |
| 74 | 74 | // Views | 
| 75 | 75 | $this->publishes([ | 
| 76 | -                __DIR__ . '/../../resources/views' => resource_path('views/vendor/uccello') | |
| 76 | +                __DIR__.'/../../resources/views' => resource_path('views/vendor/uccello') | |
| 77 | 77 | ], 'uccello-views'); | 
| 78 | 78 | } | 
| 79 | 79 | } | 
| @@ -98,12 +98,12 @@ discard block | ||
| 98 | 98 |      { | 
| 99 | 99 | // Config | 
| 100 | 100 | $this->mergeConfigFrom( | 
| 101 | - __DIR__ . '/../../config/uccello.php', | |
| 101 | + __DIR__.'/../../config/uccello.php', | |
| 102 | 102 | 'uccello' | 
| 103 | 103 | ); | 
| 104 | 104 | |
| 105 | 105 | // Helper | 
| 106 | -        App::bind('uccello', function () { | |
| 106 | +        App::bind('uccello', function() { | |
| 107 | 107 | return new \Uccello\Core\Helpers\Uccello; | 
| 108 | 108 | }); | 
| 109 | 109 | |
| @@ -83,7 +83,7 @@ | ||
| 83 | 83 | * @param mixed $message | 
| 84 | 84 | * @return void | 
| 85 | 85 | */ | 
| 86 | - function uclog($message, $type='info') | |
| 86 | + function uclog($message, $type = 'info') | |
| 87 | 87 |      { | 
| 88 | 88 | Log::$type($message); | 
| 89 | 89 | } | 
| @@ -55,13 +55,13 @@ | ||
| 55 | 55 | public function handle() | 
| 56 | 56 |      { | 
| 57 | 57 |          $this->comment('Executing make:auth...'); | 
| 58 | -        $this->callSilent('make:auth', ['--force' => true]); | |
| 58 | +        $this->callSilent('make:auth', [ '--force' => true ]); | |
| 59 | 59 | |
| 60 | 60 |          $this->comment('Publishing Uccello Assets...'); | 
| 61 | -        $this->callSilent('vendor:publish', ['--tag' => 'uccello-assets']); | |
| 61 | +        $this->callSilent('vendor:publish', [ '--tag' => 'uccello-assets' ]); | |
| 62 | 62 | |
| 63 | 63 |          $this->comment('Publishing Uccello Configuration...'); | 
| 64 | -        $this->callSilent('vendor:publish', ['--tag' => 'uccello-config']); | |
| 64 | +        $this->callSilent('vendor:publish', [ '--tag' => 'uccello-config' ]); | |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 |          $this->comment('Copying User Model...'); |