@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $this->formRepository = $formRepository ?? FormsBuilderModels::forms(); |
26 | 26 | } |
27 | 27 | |
28 | - public static function for(Consumer $consumer) |
|
28 | + public static function for (Consumer $consumer) |
|
29 | 29 | { |
30 | 30 | $action = static::make(); |
31 | 31 | $action->setConsumer($consumer); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | protected function createForm($consumerType) |
60 | 60 | { |
61 | 61 | $form = $this->formRepository->getNew(); |
62 | - $form->name = 'Form '.$this->consumer->getName(); |
|
62 | + $form->name = 'Form ' . $this->consumer->getName(); |
|
63 | 63 | $form->tenant_id = $this->consumer->getTenantId(); |
64 | 64 | $form->tenant = $this->consumer->getTenant(); |
65 | 65 | $form->setConsumerClass($consumerType); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | protected $form; |
14 | 14 | |
15 | - public static function for($form) |
|
15 | + public static function for ($form) |
|
16 | 16 | { |
17 | 17 | $action = static::make(); |
18 | 18 | $action->setForm($form); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | public function bootFormTrait() |
42 | 42 | { |
43 | - $this->addCast('metadata', AsMetadataObject::class.':json'); |
|
43 | + $this->addCast('metadata', AsMetadataObject::class . ':json'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function setConsumerClass($consumerClass) |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | public function migrations(): string |
20 | 20 | { |
21 | - return dirname(__DIR__).'/migrations/'; |
|
21 | + return dirname(__DIR__) . '/migrations/'; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | protected function registerResources() |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | return; |
28 | 28 | } |
29 | 29 | $translator = $this->getContainer()->get('translator'); |
30 | - $folder = dirname(__DIR__).'/resources/lang/'; |
|
30 | + $folder = dirname(__DIR__) . '/resources/lang/'; |
|
31 | 31 | $languages = $this->getContainer()->get('translation.languages'); |
32 | 32 | |
33 | 33 | |
34 | 34 | foreach ($languages as $language) { |
35 | - $path = $folder.$language; |
|
35 | + $path = $folder . $language; |
|
36 | 36 | if (is_dir($path)) { |
37 | 37 | $translator->addResource('php', $path, $language); |
38 | 38 | } |
@@ -24,13 +24,13 @@ |
||
24 | 24 | <?php foreach ($roles as $role) { ?> |
25 | 25 | <?php |
26 | 26 | $fields = $designer->getAvailable($role)->all(); |
27 | - $id = 'fields-available-'.$role; |
|
27 | + $id = 'fields-available-' . $role; |
|
28 | 28 | ?> |
29 | 29 | <div class="accordion-item"> |
30 | 30 | <h2 class="accordion-header"> |
31 | 31 | <button class="accordion-button" type="button" data-bs-toggle="collapse" |
32 | 32 | data-bs-target="#<?= $id; ?>" aria-expanded="true" aria-controls="<?= $id; ?>"> |
33 | - <?= $this->consumer->getManager()->getLabel('forms.role.'.$role) ?> |
|
33 | + <?= $this->consumer->getManager()->getLabel('forms.role.' . $role) ?> |
|
34 | 34 | </button> |
35 | 35 | </h2> |
36 | 36 | <div id="<?= $id; ?>" class="accordion-collapse collapse show" |
@@ -27,14 +27,14 @@ |
||
27 | 27 | * @param Consumer|Record $consumer |
28 | 28 | * @return int|string|null |
29 | 29 | */ |
30 | - public static function fromRecord(Consumer $consumer): int|string|null |
|
30 | + public static function fromRecord(Consumer $consumer): int | string | null |
|
31 | 31 | { |
32 | 32 | $action = static::make(); |
33 | 33 | |
34 | 34 | return $action->handle($consumer->getManagerName()); |
35 | 35 | } |
36 | 36 | |
37 | - public function handle($consumerClassRepository = null): int|string|null |
|
37 | + public function handle($consumerClassRepository = null): int | string | null |
|
38 | 38 | { |
39 | 39 | return $this->consumerClasses->forRepository($consumerClassRepository)?->getName(); |
40 | 40 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public static function forForm(Form $form, $fieldsCollection = null): static |
37 | 37 | { |
38 | 38 | $action = new static($form, $fieldsCollection); |
39 | - $action->setConsumer(GetConsumerForForm::for($form)->handle()); |
|
39 | + $action->setConsumer(GetConsumerForForm::for ($form)->handle()); |
|
40 | 40 | |
41 | 41 | return $action; |
42 | 42 | } |
@@ -36,7 +36,9 @@ |
||
36 | 36 | public static function forForm(Form $form, $fieldsCollection = null): static |
37 | 37 | { |
38 | 38 | $action = new static($form, $fieldsCollection); |
39 | - $action->setConsumer(GetConsumerForForm::for($form)->handle()); |
|
39 | + $action->setConsumer(GetConsumerForForm::for($form) { |
|
40 | + ->handle()); |
|
41 | + } |
|
40 | 42 | |
41 | 43 | return $action; |
42 | 44 | } |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -define('PROJECT_BASE_PATH', __DIR__.'/..'); |
|
3 | +define('PROJECT_BASE_PATH', __DIR__ . '/..'); |
|
4 | 4 | define('TEST_BASE_PATH', __DIR__); |
5 | 5 | define('CURRENT_URL', ''); |
6 | -define('TEST_FIXTURE_PATH', __DIR__.DIRECTORY_SEPARATOR.'fixtures'); |
|
6 | +define('TEST_FIXTURE_PATH', __DIR__ . DIRECTORY_SEPARATOR . 'fixtures'); |
|
7 | 7 | |
8 | 8 | use Nip\Application\Application; |
9 | 9 | use Nip\Cache\Stores\Repository; |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | app()->share('app', new Application()); |
18 | 18 | app()->share('translator', new Translator('en')); |
19 | 19 | |
20 | -$cachePath = TEST_FIXTURE_PATH.'/storage/cache'; |
|
21 | -array_map(function ($path) { |
|
20 | +$cachePath = TEST_FIXTURE_PATH . '/storage/cache'; |
|
21 | +array_map(function($path) { |
|
22 | 22 | if (is_file($path)) { |
23 | 23 | unlink($path); |
24 | 24 | } |
25 | -}, glob($cachePath.'/@/*')); |
|
25 | +}, glob($cachePath . '/@/*')); |
|
26 | 26 | |
27 | 27 | $adapter = new FilesystemAdapter('', 600, $cachePath); |
28 | 28 | $store = new Repository($adapter); |
29 | 29 | $store->clear(); |
30 | 30 | Container::getInstance()->set('cache.store', $store); |
31 | 31 | |
32 | -require dirname(__DIR__).'/vendor/autoload.php'; |
|
32 | +require dirname(__DIR__) . '/vendor/autoload.php'; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | return $consumer->getTable(); |
60 | 60 | } |
61 | 61 | |
62 | - return (string)$consumer; |
|
62 | + return (string) $consumer; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |