@@ -65,22 +65,22 @@ discard block |
||
| 65 | 65 | ->setAllowedTypes('channels', 'array') |
| 66 | 66 | ->setNormalizer('channels', LazyOption::findBy($this->channelRepository, 'code')) |
| 67 | 67 | |
| 68 | - ->setDefault('image', function (Options $options): string { |
|
| 68 | + ->setDefault('image', function(Options $options): string { |
|
| 69 | 69 | return __DIR__.'/../../Resources/fixtures/banner/images/0'.rand(1, 4).'.png'; |
| 70 | 70 | }) |
| 71 | - ->setAllowedTypes('image', ['string']) |
|
| 71 | + ->setAllowedTypes('image', [ 'string' ]) |
|
| 72 | 72 | |
| 73 | - ->setDefault('mobile_image', function (Options $options): string { |
|
| 73 | + ->setDefault('mobile_image', function(Options $options): string { |
|
| 74 | 74 | return __DIR__.'/../../Resources/fixtures/banner/mobile-images/0'.rand(1, 4).'.png'; |
| 75 | 75 | }) |
| 76 | - ->setAllowedTypes('mobile_image', ['string']) |
|
| 76 | + ->setAllowedTypes('mobile_image', [ 'string' ]) |
|
| 77 | 77 | ; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * {@inheritdoc} |
| 82 | 82 | */ |
| 83 | - public function create(array $options = []): BannerInterface |
|
| 83 | + public function create(array $options = [ ]): BannerInterface |
|
| 84 | 84 | { |
| 85 | 85 | $options = $this->optionsResolver->resolve($options); |
| 86 | 86 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $banner = $this->bannerFactory->createNew(); |
| 89 | 89 | $banner->setCode($this->faker->slug); |
| 90 | 90 | |
| 91 | - foreach ($options['channels'] as $channel) { |
|
| 91 | + foreach ($options[ 'channels' ] as $channel) { |
|
| 92 | 92 | $banner->addChannel($channel); |
| 93 | 93 | } |
| 94 | 94 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $banner->setMainText($this->faker->sentence(4)); |
| 102 | 102 | $banner->setSecondaryText($this->faker->sentence(9)); |
| 103 | 103 | |
| 104 | - $banner->setImageFile($this->createImage($options['image'])); |
|
| 105 | - $banner->setMobileImageFile($this->createImage($options['mobile_image'])); |
|
| 104 | + $banner->setImageFile($this->createImage($options[ 'image' ])); |
|
| 105 | + $banner->setMobileImageFile($this->createImage($options[ 'mobile_image' ])); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return $banner; |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | private function createImage(string $imagePath): UploadedFile |
| 116 | 116 | { |
| 117 | 117 | $imagePath = $this->fileLocator === null ? $imagePath : $this->fileLocator->locate($imagePath); |
| 118 | - if(is_array($imagePath) && count($imagePath) > 0) |
|
| 119 | - $imagePath = $imagePath[0]; |
|
| 118 | + if (is_array($imagePath) && count($imagePath) > 0) |
|
| 119 | + $imagePath = $imagePath[ 0 ]; |
|
| 120 | 120 | |
| 121 | 121 | return new UploadedFile($imagePath, basename($imagePath)); |
| 122 | 122 | } |