Skip to content

Commit 20d3232

Browse files
committed
Fix PHPStan errors
1 parent de5ae68 commit 20d3232

5 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/Fixture/Factory/BrandExampleFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ protected function createImages(BrandInterface $brand, array $options): void
8383
$imagePath = $image['path'];
8484
$imageType = $image['type'] ?? null;
8585

86+
/** @var string $locatedPath */
8687
$locatedPath = $this->fileLocator->locate($imagePath, first: true);
87-
Assert::string($locatedPath);
8888

8989
$uploadedImage = new UploadedFile($locatedPath, basename($locatedPath));
9090

src/Fixture/Factory/BrandsAwareExampleFactoryTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function configureBrandsOptions(OptionsResolver $resolver, int $amount
3535
}
3636

3737
/** @param array{brands: list<BrandInterface>} $resolvedOptions */
38-
protected function setBrandField(BrandAwareInterface $brandAware, array $resolvedOptions = []): void
38+
protected function setBrandField(BrandAwareInterface $brandAware, array $resolvedOptions): void
3939
{
4040
$brand = $this->faker->randomElement($resolvedOptions['brands']);
4141
Assert::isInstanceOf($brand, BrandInterface::class);

tests/DependencyInjection/LoevgaardSyliusBrandExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ protected function getContainerExtensions(): array
3232
];
3333
}
3434

35+
/** @return array<string, mixed> */
3536
protected function getMinimalConfiguration(): array
3637
{
3738
return [

tests/Fixture/Factory/BrandAwareExampleFactoryTraitTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public function exposedConfigureBrandOptions(OptionsResolver $resolver, int $cha
8787
$this->configureBrandOptions($resolver, $chanceOfRandomBrand);
8888
}
8989

90+
/** @param array{brand?: BrandInterface|null} $resolvedOptions */
9091
public function exposedSetBrandField(BrandAwareInterface $brandAware, array $resolvedOptions = []): void
9192
{
9293
$this->setBrandField($brandAware, $resolvedOptions);

tests/Fixture/Factory/BrandsAwareExampleFactoryTraitTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public function exposedConfigureBrandsOptions(OptionsResolver $resolver, int $am
8888
$this->configureBrandsOptions($resolver, $amount);
8989
}
9090

91-
public function exposedSetBrandField(BrandAwareInterface $brandAware, array $resolvedOptions = []): void
91+
/** @param array{brands: list<BrandInterface>} $resolvedOptions */
92+
public function exposedSetBrandField(BrandAwareInterface $brandAware, array $resolvedOptions): void
9293
{
9394
$this->setBrandField($brandAware, $resolvedOptions);
9495
}

0 commit comments

Comments
 (0)