@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | private function registerRoutes() |
| 36 | 36 | { |
| 37 | - Route::group($this->routeConfiguration(), function () { |
|
| 37 | + Route::group($this->routeConfiguration(), function() { |
|
| 38 | 38 | $this->loadRoutesFrom(__DIR__.'/Http/routes.php'); |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $this->mergeConfigFrom(__DIR__.'/../config/maileclipse.php', 'maileclipse'); |
| 64 | 64 | |
| 65 | 65 | // Register the service the package provides. |
| 66 | - $this->app->singleton('maileclipse', function ($app) { |
|
| 66 | + $this->app->singleton('maileclipse', function($app) { |
|
| 67 | 67 | return new MailEclipse; |
| 68 | 68 | }); |
| 69 | 69 | } |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | { |
| 60 | 60 | $templateData = MailEclipse::getMailableTemplateData($name); |
| 61 | 61 | |
| 62 | - if (! $templateData) { |
|
| 62 | + if (!$templateData) { |
|
| 63 | 63 | return redirect()->route('viewMailable', ['name' => $name]); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $fqcns = []; |
| 32 | 32 | |
| 33 | - if (! file_exists(config('maileclipse.mailables_dir'))) { |
|
| 33 | + if (!file_exists(config('maileclipse.mailables_dir'))) { |
|
| 34 | 34 | return; |
| 35 | 35 | } else { |
| 36 | 36 | $allFiles = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(config('maileclipse.mailables_dir'))); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $tokens = token_get_all($content); |
| 44 | 44 | $namespace = ''; |
| 45 | 45 | for ($index = 0; isset($tokens[$index]); $index++) { |
| 46 | - if (! isset($tokens[$index][0])) { |
|
| 46 | + if (!isset($tokens[$index][0])) { |
|
| 47 | 47 | continue; |
| 48 | 48 | } |
| 49 | 49 | if (T_NAMESPACE === $tokens[$index][0]) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $mailableClass = $namespace.'\\'.$tokens[$index][1]; |
| 61 | 61 | |
| 62 | - if (! MailEclipse::mailable_exists($mailableClass)) { |
|
| 62 | + if (!MailEclipse::mailable_exists($mailableClass)) { |
|
| 63 | 63 | continue; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $mailable_data = MailEclipse::buildMailable($mailableClass); |
| 73 | 73 | |
| 74 | - if (! is_null(MailEclipse::handleMailableViewDataArgs($mailableClass))) { |
|
| 74 | + if (!is_null(MailEclipse::handleMailableViewDataArgs($mailableClass))) { |
|
| 75 | 75 | $mailable_view_data = MailEclipse::getMailableViewData(MailEclipse::handleMailableViewDataArgs($mailableClass), $mailable_data); |
| 76 | 76 | } else { |
| 77 | 77 | $mailable_view_data = MailEclipse::getMailableViewData(new $mailableClass, $mailable_data); |
@@ -92,16 +92,16 @@ discard block |
||
| 92 | 92 | $fqcns[$i]['view_path'] = null; |
| 93 | 93 | $fqcns[$i]['text_view_path'] = null; |
| 94 | 94 | |
| 95 | - if (! is_null($fqcns[$i]['markdown']) && View::exists($fqcns[$i]['markdown'])) { |
|
| 95 | + if (!is_null($fqcns[$i]['markdown']) && View::exists($fqcns[$i]['markdown'])) { |
|
| 96 | 96 | $fqcns[$i]['view_path'] = View($fqcns[$i]['markdown'])->getPath(); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! is_null($fqcns[$i]['data'])) { |
|
| 100 | - if (! is_null($fqcns[$i]['data']->view) && View::exists($fqcns[$i]['data']->view)) { |
|
| 99 | + if (!is_null($fqcns[$i]['data'])) { |
|
| 100 | + if (!is_null($fqcns[$i]['data']->view) && View::exists($fqcns[$i]['data']->view)) { |
|
| 101 | 101 | $fqcns[$i]['view_path'] = View($fqcns[$i]['data']->view)->getPath(); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if (! is_null($fqcns[$i]['data']->textView) && View::exists($fqcns[$i]['data']->textView)) { |
|
| 104 | + if (!is_null($fqcns[$i]['data']->textView) && View::exists($fqcns[$i]['data']->textView)) { |
|
| 105 | 105 | $fqcns[$i]['text_view_path'] = View($fqcns[$i]['data']->textView)->getPath(); |
| 106 | 106 | $fqcns[$i]['text_view'] = $fqcns[$i]['data']->textView; |
| 107 | 107 | } |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $collection = collect($fqcns)->map(function ($mailable) { |
|
| 117 | + $collection = collect($fqcns)->map(function($mailable) { |
|
| 118 | 118 | return $mailable; |
| 119 | - })->reject(function ($object) { |
|
| 120 | - return ! method_exists($object['namespace'], 'build'); |
|
| 119 | + })->reject(function($object) { |
|
| 120 | + return !method_exists($object['namespace'], 'build'); |
|
| 121 | 121 | }); |
| 122 | 122 | |
| 123 | 123 | return $collection; |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | Route::get('/', 'MailablesController@toMailablesList'); |
| 6 | 6 | |
| 7 | -Route::group(['prefix' => 'templates'], function () { |
|
| 7 | +Route::group(['prefix' => 'templates'], function() { |
|
| 8 | 8 | Route::get('/', 'TemplatesController@index')->name('templateList'); |
| 9 | 9 | Route::get('new', 'TemplatesController@select')->name('selectNewTemplate'); |
| 10 | 10 | Route::get('new/{type}/{name}/{skeleton}', 'TemplatesController@new')->name('newTemplate'); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | Route::post('preview', 'TemplatesController@previewTemplateMarkdownView')->name('previewTemplateMarkdownView'); |
| 16 | 16 | }); |
| 17 | 17 | |
| 18 | -Route::group(['prefix' => 'mailables'], function () { |
|
| 18 | +Route::group(['prefix' => 'mailables'], function() { |
|
| 19 | 19 | Route::get('/', 'MailablesController@index')->name('mailableList'); |
| 20 | 20 | Route::get('view/{name}', 'MailablesController@viewMailable')->name('viewMailable'); |
| 21 | 21 | Route::get('edit/template/{name}', 'MailablesController@editMailable')->name('editMailable'); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | Route::post('new', 'MailablesController@generateMailable')->name('generateMailable'); |
| 26 | 26 | Route::post('delete', 'MailablesController@delete')->name('deleteMailable'); |
| 27 | 27 | |
| 28 | - Route::group(['prefix' => 'preview'], function () { |
|
| 28 | + Route::group(['prefix' => 'preview'], function() { |
|
| 29 | 29 | Route::post('template', 'MailablesPreviewController@markdownView')->name('previewMarkdownView'); |
| 30 | 30 | Route::get('template/previewerror', 'MailablesPreviewController@previewError')->name('templatePreviewError'); |
| 31 | 31 | Route::get('{name}', 'MailablesPreviewController@mailable')->name('previewMailable'); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $instance = new $resource['namespace']; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $view = ! is_null($resource['markdown']) |
|
| 51 | + $view = !is_null($resource['markdown']) |
|
| 52 | 52 | ? $resource['markdown'] |
| 53 | 53 | : $resource['data']->view; |
| 54 | 54 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | $mailableFile = config('maileclipse.mailables_dir').'/'.$request['mailablename'].'.php'; |
| 12 | 12 | |
| 13 | - if (! File::exists($mailableFile)) { |
|
| 13 | + if (!File::exists($mailableFile)) { |
|
| 14 | 14 | return [ |
| 15 | 15 | 'status' => 'error', |
| 16 | 16 | 'message' => 'Mailable '.$request['mailablename'].' does not exist', |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | ]; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - if (! MailEclipse::getMailable('name', $parameters['name'])->isEmpty() && ! isset($parameters['force'])) { |
|
| 28 | + if (!MailEclipse::getMailable('name', $parameters['name'])->isEmpty() && !isset($parameters['force'])) { |
|
| 29 | 29 | return [ |
| 30 | 30 | 'status' => 'error', |
| 31 | 31 | 'message' => 'This mailable name already exists. names should be unique! to override it, enable "force" option.', |
@@ -97,20 +97,20 @@ |
||
| 97 | 97 | { |
| 98 | 98 | $components = config('maileclipse.components'); |
| 99 | 99 | |
| 100 | - $this->bladeMatchPatterns = array_map(function ($component) { |
|
| 100 | + $this->bladeMatchPatterns = array_map(function($component) { |
|
| 101 | 101 | return "/@${component}/i"; |
| 102 | 102 | }, $components); |
| 103 | 103 | |
| 104 | - $this->bladeReplacePatterns = array_map(function ($component) { |
|
| 104 | + $this->bladeReplacePatterns = array_map(function($component) { |
|
| 105 | 105 | return "[${component}]: # "; |
| 106 | 106 | }, $components); |
| 107 | 107 | |
| 108 | 108 | |
| 109 | - $this->editorMatchPatterns = array_map(function ($component) { |
|
| 109 | + $this->editorMatchPatterns = array_map(function($component) { |
|
| 110 | 110 | return "/\[${component}]:\s?#\s?/i"; |
| 111 | 111 | }, $components); |
| 112 | 112 | |
| 113 | - $this->editorReplacePatterns = array_map(function ($component) { |
|
| 113 | + $this->editorReplacePatterns = array_map(function($component) { |
|
| 114 | 114 | return "@${component}"; |
| 115 | 115 | }, $components); |
| 116 | 116 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | ->where('template_slug', $templateSlug)->first(); |
| 76 | 76 | |
| 77 | 77 | if ($template !== null) { |
| 78 | - self::saveTemplates(self::getTemplates()->reject(function ($value) use ($template) { |
|
| 78 | + self::saveTemplates(self::getTemplates()->reject(function($value) use ($template) { |
|
| 79 | 79 | return $value->template_slug === $template->template_slug; |
| 80 | 80 | })); |
| 81 | 81 | |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | public static function getTemplatesFile() |
| 104 | 104 | { |
| 105 | 105 | $file = config('maileclipse.mailables_dir').'templates.json'; |
| 106 | - if (! file_exists($file)) { |
|
| 107 | - if (! file_exists(config('maileclipse.mailables_dir'))) { |
|
| 108 | - if (! mkdir($concurrentDirectory = config('maileclipse.mailables_dir')) && ! is_dir($concurrentDirectory)) { |
|
| 106 | + if (!file_exists($file)) { |
|
| 107 | + if (!file_exists(config('maileclipse.mailables_dir'))) { |
|
| 108 | + if (!mkdir($concurrentDirectory = config('maileclipse.mailables_dir')) && !is_dir($concurrentDirectory)) { |
|
| 109 | 109 | throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | ->where('template_slug', $request->templateslug)->first(); |
| 136 | 136 | |
| 137 | 137 | if ($template !== null) { |
| 138 | - if (! preg_match("/^[a-zA-Z0-9-_\s]+$/", $request->title)) { |
|
| 138 | + if (!preg_match("/^[a-zA-Z0-9-_\s]+$/", $request->title)) { |
|
| 139 | 139 | return response()->json([ |
| 140 | 140 | 'status' => 'failed', |
| 141 | 141 | 'message' => 'Template name not valid', |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // Update |
| 157 | - $oldForm = self::getTemplates()->reject(function ($value) use ($template) { |
|
| 157 | + $oldForm = self::getTemplates()->reject(function($value) use ($template) { |
|
| 158 | 158 | return $value->template_slug === $template->template_slug; |
| 159 | 159 | }); |
| 160 | 160 | $newForm = array_merge($oldForm->toArray(), [array_merge((array) $template, [ |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | public static function createTemplate($request): JsonResponse |
| 239 | 239 | { |
| 240 | - if (! preg_match("/^[a-zA-Z0-9-_\s]+$/", $request->template_name)) { |
|
| 240 | + if (!preg_match("/^[a-zA-Z0-9-_\s]+$/", $request->template_name)) { |
|
| 241 | 241 | return response()->json([ |
| 242 | 242 | 'status' => 'error', |
| 243 | 243 | 'message' => 'Template name not valid', |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $view = self::VIEW_NAMESPACE.'::templates.'.$request->template_name; |
| 249 | 249 | $templateName = Str::camel(preg_replace('/\s+/', '_', $request->template_name)); |
| 250 | 250 | |
| 251 | - if (! view()->exists($view) && ! self::getTemplates()->contains('template_slug', '=', $templateName)) { |
|
| 251 | + if (!view()->exists($view) && !self::getTemplates()->contains('template_slug', '=', $templateName)) { |
|
| 252 | 252 | self::saveTemplates(self::getTemplates() |
| 253 | 253 | ->push([ |
| 254 | 254 | 'template_name' => $request->template_name, |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | |
| 262 | 262 | $dir = resource_path('views/vendor/'.self::VIEW_NAMESPACE.'/templates'); |
| 263 | 263 | |
| 264 | - if (! File::isDirectory($dir)) { |
|
| 264 | + if (!File::isDirectory($dir)) { |
|
| 265 | 265 | File::makeDirectory($dir, 0755, true); |
| 266 | 266 | } |
| 267 | 267 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $replaced = Replacer::toBlade($content); |
| 303 | 303 | |
| 304 | - if (! $save) { |
|
| 304 | + if (!$save) { |
|
| 305 | 305 | return $replaced; |
| 306 | 306 | } |
| 307 | 307 | |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | ]); |
| 399 | 399 | } |
| 400 | 400 | |
| 401 | - if (! $request->has('force') && ! self::getMailable('name', $name)->isEmpty()) { |
|
| 401 | + if (!$request->has('force') && !self::getMailable('name', $name)->isEmpty()) { |
|
| 402 | 402 | return response()->json([ |
| 403 | 403 | 'status' => 'error', |
| 404 | 404 | 'message' => 'This mailable name already exists. names should be unique! to override it, enable "force" option.', |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | { |
| 452 | 452 | $fqcns = []; |
| 453 | 453 | |
| 454 | - if (! file_exists(config('maileclipse.mailables_dir'))) { |
|
| 454 | + if (!file_exists(config('maileclipse.mailables_dir'))) { |
|
| 455 | 455 | return; |
| 456 | 456 | } else { |
| 457 | 457 | $allFiles = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(config('maileclipse.mailables_dir'))); |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | $tokens = token_get_all($content); |
| 465 | 465 | $namespace = ''; |
| 466 | 466 | for ($index = 0; isset($tokens[$index]); $index++) { |
| 467 | - if (! isset($tokens[$index][0])) { |
|
| 467 | + if (!isset($tokens[$index][0])) { |
|
| 468 | 468 | continue; |
| 469 | 469 | } |
| 470 | 470 | if (T_NAMESPACE === $tokens[$index][0]) { |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | |
| 481 | 481 | $mailableClass = $namespace.'\\'.$tokens[$index][1]; |
| 482 | 482 | |
| 483 | - if (! self::mailable_exists($mailableClass)) { |
|
| 483 | + if (!self::mailable_exists($mailableClass)) { |
|
| 484 | 484 | continue; |
| 485 | 485 | } |
| 486 | 486 | |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | |
| 493 | 493 | $mailable_data = self::buildMailable($mailableClass); |
| 494 | 494 | |
| 495 | - if (! is_null(self::handleMailableViewDataArgs($mailableClass))) { |
|
| 495 | + if (!is_null(self::handleMailableViewDataArgs($mailableClass))) { |
|
| 496 | 496 | $mailable_view_data = self::getMailableViewData(self::handleMailableViewDataArgs($mailableClass), $mailable_data); |
| 497 | 497 | } else { |
| 498 | 498 | $mailable_view_data = self::getMailableViewData(new $mailableClass, $mailable_data); |
@@ -513,16 +513,16 @@ discard block |
||
| 513 | 513 | $fqcns[$i]['view_path'] = null; |
| 514 | 514 | $fqcns[$i]['text_view_path'] = null; |
| 515 | 515 | |
| 516 | - if (! is_null($fqcns[$i]['markdown']) && View::exists($fqcns[$i]['markdown'])) { |
|
| 516 | + if (!is_null($fqcns[$i]['markdown']) && View::exists($fqcns[$i]['markdown'])) { |
|
| 517 | 517 | $fqcns[$i]['view_path'] = View($fqcns[$i]['markdown'])->getPath(); |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | - if (! is_null($fqcns[$i]['data'])) { |
|
| 521 | - if (! is_null($fqcns[$i]['data']->view) && View::exists($fqcns[$i]['data']->view)) { |
|
| 520 | + if (!is_null($fqcns[$i]['data'])) { |
|
| 521 | + if (!is_null($fqcns[$i]['data']->view) && View::exists($fqcns[$i]['data']->view)) { |
|
| 522 | 522 | $fqcns[$i]['view_path'] = View($fqcns[$i]['data']->view)->getPath(); |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | - if (! is_null($fqcns[$i]['data']->textView) && View::exists($fqcns[$i]['data']->textView)) { |
|
| 525 | + if (!is_null($fqcns[$i]['data']->textView) && View::exists($fqcns[$i]['data']->textView)) { |
|
| 526 | 526 | $fqcns[$i]['text_view_path'] = View($fqcns[$i]['data']->textView)->getPath(); |
| 527 | 527 | $fqcns[$i]['text_view'] = $fqcns[$i]['data']->textView; |
| 528 | 528 | } |
@@ -535,10 +535,10 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | - $collection = collect($fqcns)->map(function ($mailable) { |
|
| 538 | + $collection = collect($fqcns)->map(function($mailable) { |
|
| 539 | 539 | return $mailable; |
| 540 | - })->reject(function ($object) { |
|
| 541 | - return ! method_exists($object['namespace'], 'build'); |
|
| 540 | + })->reject(function($object) { |
|
| 541 | + return !method_exists($object['namespace'], 'build'); |
|
| 542 | 542 | }); |
| 543 | 543 | |
| 544 | 544 | return $collection; |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | |
| 563 | 563 | $eloquentFactory = app(EloquentFactory::class); |
| 564 | 564 | |
| 565 | - $args = collect($params)->map(function ($param) { |
|
| 565 | + $args = collect($params)->map(function($param) { |
|
| 566 | 566 | if ($param->getType() !== null) { |
| 567 | 567 | if (class_exists($param->getType()->getName())) { |
| 568 | 568 | $parameters = [ |
@@ -642,17 +642,17 @@ discard block |
||
| 642 | 642 | $reflection = collect($params)->where('name', $arg)->first()->getType(); |
| 643 | 643 | |
| 644 | 644 | if (version_compare(phpversion(), '7.1', '>=')) { |
| 645 | - $type = ! is_null($reflection) |
|
| 645 | + $type = !is_null($reflection) |
|
| 646 | 646 | ? self::TYPES[$reflection->getName()] |
| 647 | 647 | : null; |
| 648 | 648 | } else { |
| 649 | - $type = ! is_null($reflection) |
|
| 649 | + $type = !is_null($reflection) |
|
| 650 | 650 | ? self::TYPES[/** @scrutinizer ignore-deprecated */ $reflection->__toString()] |
| 651 | 651 | : null; |
| 652 | 652 | } |
| 653 | 653 | |
| 654 | 654 | try { |
| 655 | - return ! is_null($type) |
|
| 655 | + return !is_null($type) |
|
| 656 | 656 | ? $type |
| 657 | 657 | : new Mocked($arg, \ReeceM\Mocker\Utils\VarStore::singleton()); |
| 658 | 658 | } catch (\Exception $e) { |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | |
| 684 | 684 | foreach ($properties as $prop) { |
| 685 | 685 | if ($prop->class == $data->getName() || $prop->class == get_parent_class($data->getName()) && |
| 686 | - get_parent_class($data->getName()) != 'Illuminate\Mail\Mailable' && ! $prop->isStatic()) { |
|
| 686 | + get_parent_class($data->getName()) != 'Illuminate\Mail\Mailable' && !$prop->isStatic()) { |
|
| 687 | 687 | $allProps[] = $prop->name; |
| 688 | 688 | } |
| 689 | 689 | } |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | |
| 703 | 703 | $mailableData = collect($classProps)->merge($withFuncData); |
| 704 | 704 | |
| 705 | - $data = $mailableData->map(function ($parameter) use ($mailable_data) { |
|
| 705 | + $data = $mailableData->map(function($parameter) use ($mailable_data) { |
|
| 706 | 706 | return [ |
| 707 | 707 | 'key' => $parameter, |
| 708 | 708 | 'value' => property_exists($mailable_data, $parameter) ? $mailable_data->$parameter : null, |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | */ |
| 750 | 750 | protected static function mailable_exists($mailable): bool |
| 751 | 751 | { |
| 752 | - if (! class_exists($mailable)) { |
|
| 752 | + if (!class_exists($mailable)) { |
|
| 753 | 753 | return false; |
| 754 | 754 | } |
| 755 | 755 | |
@@ -807,17 +807,17 @@ discard block |
||
| 807 | 807 | */ |
| 808 | 808 | public static function renderPreview($simpleview, $view, $template = false, $instance = null) |
| 809 | 809 | { |
| 810 | - if (! View::exists($view)) { |
|
| 810 | + if (!View::exists($view)) { |
|
| 811 | 811 | return; |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - if (! $template) { |
|
| 814 | + if (!$template) { |
|
| 815 | 815 | $obj = self::buildMailable($instance); |
| 816 | 816 | $viewData = $obj->viewData; |
| 817 | 817 | $_data = array_merge($instance->buildViewData(), $viewData); |
| 818 | 818 | |
| 819 | 819 | foreach ($_data as $key => $value) { |
| 820 | - if (! is_object($value)) { |
|
| 820 | + if (!is_object($value)) { |
|
| 821 | 821 | $_data[$key] = '<span class="maileclipse-key" title="Variable">'.$key.'</span>'; |
| 822 | 822 | } |
| 823 | 823 | } |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | /** |
| 884 | 884 | * Removal of reserved keywords. |
| 885 | 885 | */ |
| 886 | - if (! preg_match('/^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*$/', $name) || |
|
| 886 | + if (!preg_match('/^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff]*$/', $name) || |
|
| 887 | 887 | substr_compare($name, $suffix, -strlen($suffix), strlen($suffix), true) !== 0 |
| 888 | 888 | ) { |
| 889 | 889 | return false; |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | */ |
| 903 | 903 | private static function resolveFactory($eloquentFactory, $model): ?object |
| 904 | 904 | { |
| 905 | - if (! config('maileclipse.factory')) { |
|
| 905 | + if (!config('maileclipse.factory')) { |
|
| 906 | 906 | return app($model); |
| 907 | 907 | } |
| 908 | 908 | |
@@ -950,9 +950,9 @@ discard block |
||
| 950 | 950 | collect((new ReflectionClass($factoryModel))->getMethods()) |
| 951 | 951 | ->pluck('name') |
| 952 | 952 | ->diff(collect($model->getMethods())->pluck('name')) |
| 953 | - ->filter(function ($method) use ($factoryModel) { |
|
| 953 | + ->filter(function($method) use ($factoryModel) { |
|
| 954 | 954 | return rescue( |
| 955 | - function () use ($factoryModel, $method) { |
|
| 955 | + function() use ($factoryModel, $method) { |
|
| 956 | 956 | $parents = class_parents($factoryModel->$method()); |
| 957 | 957 | |
| 958 | 958 | return isset($parents["Illuminate\Database\Eloquent\Relations\Relation"]); |
@@ -961,7 +961,7 @@ discard block |
||
| 961 | 961 | false |
| 962 | 962 | ); |
| 963 | 963 | }) |
| 964 | - ->each(function ($relationName) use (&$factoryModel, $eloquentFactory) { |
|
| 964 | + ->each(function($relationName) use (&$factoryModel, $eloquentFactory) { |
|
| 965 | 965 | $factoryModel = self::loadRelations($relationName, $factoryModel, $eloquentFactory); |
| 966 | 966 | }); |
| 967 | 967 | |