@@ -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 | } |
@@ -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 | } |
@@ -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 | /** |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | app('locale')->getOption(['time', 'dateStringFormatShort']) |
36 | 36 | ); |
37 | 37 | if ($value) { |
38 | - $value .= ' ('.$this->getAgeString($model).')'; |
|
38 | + $value .= ' (' . $this->getAgeString($model) . ')'; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getAgeString($model) |
55 | 55 | { |
56 | - return $this->getAge($model).' '.translator()->trans('years'); |
|
56 | + return $this->getAge($model) . ' ' . translator()->trans('years'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -31,7 +31,9 @@ |
||
31 | 31 | |
32 | 32 | public static function forForm($form) |
33 | 33 | { |
34 | - $consumer = GetConsumerForForm::for($form)->handle(); |
|
34 | + $consumer = GetConsumerForForm::for($form) { |
|
35 | + ->handle(); |
|
36 | + } |
|
35 | 37 | |
36 | 38 | return self::forConsumer($consumer); |
37 | 39 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public static function forForm($form) |
33 | 33 | { |
34 | - $consumer = GetConsumerForForm::for($form)->handle(); |
|
34 | + $consumer = GetConsumerForForm::for ($form)->handle(); |
|
35 | 35 | |
36 | 36 | return self::forConsumer($consumer); |
37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $action = new static(); |
42 | 42 | $action->setConsumer($consumer); |
43 | 43 | $action->setConsumerConfig($consumerConfig); |
44 | - $action->setConsumerConfigGenerateCallback(function () use ($consumer) { |
|
44 | + $action->setConsumerConfigGenerateCallback(function() use ($consumer) { |
|
45 | 45 | return GetConsumerConfig::forConsumer($consumer)->handle(); |
46 | 46 | }); |
47 | 47 |
@@ -35,11 +35,11 @@ |
||
35 | 35 | { |
36 | 36 | $action = new static($fieldList); |
37 | 37 | $action->setForm($form); |
38 | - $action->setConsumerGenerateCallback(function () use ($form) { |
|
39 | - return GetConsumerForForm::for($form)->handle(); |
|
38 | + $action->setConsumerGenerateCallback(function() use ($form) { |
|
39 | + return GetConsumerForForm::for ($form)->handle(); |
|
40 | 40 | }); |
41 | 41 | |
42 | - $action->setConsumerConfigGenerateCallback(function () use ($action) { |
|
42 | + $action->setConsumerConfigGenerateCallback(function() use ($action) { |
|
43 | 43 | return GetConsumerConfig::forConsumer($action->getConsumer())->handle(); |
44 | 44 | }); |
45 | 45 |
@@ -36,7 +36,9 @@ |
||
36 | 36 | $action = new static($fieldList); |
37 | 37 | $action->setForm($form); |
38 | 38 | $action->setConsumerGenerateCallback(function () use ($form) { |
39 | - return GetConsumerForForm::for($form)->handle(); |
|
39 | + return GetConsumerForForm::for($form) { |
|
40 | + ->handle(); |
|
41 | + } |
|
40 | 42 | }); |
41 | 43 | |
42 | 44 | $action->setConsumerConfigGenerateCallback(function () use ($action) { |