Skip to content

Commit

Permalink
Fixed code style
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Feb 26, 2024
1 parent 9c15c15 commit cd5d13a
Show file tree
Hide file tree
Showing 49 changed files with 115 additions and 211 deletions.
4 changes: 2 additions & 2 deletions src/Assigner/ProductsAssigner.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
final class ProductsAssigner implements ProductsAssignerInterface
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function assign(BrandInterface $brand, array $products): void
{
foreach ($products as $product) {
if (!$product instanceof ProductInterface) {
throw new \RuntimeException(sprintf(
"Some product was not found to assign to brand '%s'",
$brand->getCode()
$brand->getCode(),
));
}

Expand Down
1 change: 0 additions & 1 deletion src/Assigner/ProductsAssignerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
interface ProductsAssignerInterface
{
/**
* @param BrandInterface $brand
* @param ProductInterface[]|array $products
*/
public function assign(BrandInterface $brand, array $products): void;
Expand Down
5 changes: 1 addition & 4 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
final class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function getConfigTreeBuilder(): TreeBuilder
{
Expand All @@ -47,9 +47,6 @@ public function getConfigTreeBuilder(): TreeBuilder
return $treeBuilder;
}

/**
* @param ArrayNodeDefinition $node
*/
private function addResourcesSection(ArrayNodeDefinition $node): void
{
$node
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/LoevgaardSyliusBrandExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
final class LoevgaardSyliusBrandExtension extends AbstractResourceExtension
{
/**
* {@inheritdoc}
* @inheritdoc
*
* @throws \Exception
*/
Expand Down
6 changes: 3 additions & 3 deletions src/Doctrine/ORM/BrandImageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
class BrandImageRepository extends EntityRepository implements BrandImageRepositoryInterface
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function createListQueryBuilder(string $brandCode): QueryBuilder
{
return $this->createQueryBuilder('o')
->addSelect('brand')
->innerJoin('o.owner', 'brand', 'WITH', 'brand.code = :brandCode')
->setParameter('brandCode', $brandCode)
;
;
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createPaginatorForBrandAndType(BrandInterface $brand, string $type): iterable
{
Expand Down
11 changes: 0 additions & 11 deletions src/Doctrine/ORM/BrandImageRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,7 @@

interface BrandImageRepositoryInterface extends RepositoryInterface
{
/**
* @param string $brandCode
*
* @return QueryBuilder
*/
public function createListQueryBuilder(string $brandCode): QueryBuilder;

/**
* @param BrandInterface $brand
* @param string $type
*
* @return iterable
*/
public function createPaginatorForBrandAndType(BrandInterface $brand, string $type): iterable;
}
4 changes: 2 additions & 2 deletions src/Doctrine/ORM/BrandRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class BrandRepository extends EntityRepository implements BrandRepositoryInterface
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function findByPhrase(string $phrase): array
{
Expand All @@ -18,6 +18,6 @@ public function findByPhrase(string $phrase): array
->setParameter('phrase', '%' . $phrase . '%')
->getQuery()
->getResult()
;
;
}
}
2 changes: 0 additions & 2 deletions src/Doctrine/ORM/BrandRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
interface BrandRepositoryInterface extends RepositoryInterface
{
/**
* @param string $phrase
*
* @return array|BrandInterface[]
*/
public function findByPhrase(string $phrase): array;
Expand Down
5 changes: 0 additions & 5 deletions src/Doctrine/ORM/ProductRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,5 @@

interface ProductRepositoryInterface extends BaseProductRepositoryInterface
{
/**
* @param BrandInterface $brand
*
* @return iterable
*/
public function createPaginatorForBrand(BrandInterface $brand): iterable;
}
4 changes: 2 additions & 2 deletions src/Doctrine/ORM/ProductRepositoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ trait ProductRepositoryTrait
abstract public function createQueryBuilder($alias, $indexBy = null);

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createPaginatorForBrand(BrandInterface $brand): iterable
{
Expand All @@ -27,6 +27,6 @@ public function createPaginatorForBrand(BrandInterface $brand): iterable
->setParameter('brand', $brand)
->getQuery()
->getResult()
;
;
}
}
4 changes: 1 addition & 3 deletions src/EventListener/BrandDeletionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ final class BrandDeletionListener
{
/**
* Prevent brand deletion if it used in product
*
* @param ResourceControllerEvent $event
*/
public function onBrandPreDelete(ResourceControllerEvent $event): void
{
Expand All @@ -22,7 +20,7 @@ public function onBrandPreDelete(ResourceControllerEvent $event): void
if (!$brand instanceof BrandInterface) {
throw new UnexpectedTypeException(
$brand,
BrandInterface::class
BrandInterface::class,
);
}

Expand Down
4 changes: 1 addition & 3 deletions src/EventListener/ImageUploadListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

final class ImageUploadListener
{
/**
* @var ImageUploaderInterface
*/
/** @var ImageUploaderInterface */
private $uploader;

public function __construct(ImageUploaderInterface $uploader)
Expand Down
8 changes: 3 additions & 5 deletions src/Factory/BrandImageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

class BrandImageFactory implements BrandImageFactoryInterface
{
/**
* @var FactoryInterface
*/
/** @var FactoryInterface */
private $factory;

public function __construct(FactoryInterface $factory)
Expand All @@ -21,7 +19,7 @@ public function __construct(FactoryInterface $factory)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createNew(): BrandImageInterface
{
Expand All @@ -32,7 +30,7 @@ public function createNew(): BrandImageInterface
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createForBrand(BrandInterface $brand): BrandImageInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Fixture/Factory/BrandExampleFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
FactoryInterface $brandFactory,
FactoryInterface $productImageFactory,
ImageUploaderInterface $imageUploader,
FileLocatorInterface $fileLocator
FileLocatorInterface $fileLocator,
) {
$this->productRepository = $productRepository;
$this->productAssigner = $productAssigner;
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Extension/Api/ProductTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class ProductTypeExtension extends AbstractTypeExtension
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -24,7 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getExtendedTypes(): iterable
{
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Extension/ProductTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class ProductTypeExtension extends AbstractTypeExtension
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -24,7 +24,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public static function getExtendedTypes(): iterable
{
Expand Down
8 changes: 4 additions & 4 deletions src/Form/Type/BrandAutocompleteChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
final class BrandAutocompleteChoiceType extends AbstractType
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function configureOptions(OptionsResolver $resolver): void
{
Expand All @@ -25,7 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function buildView(FormView $view, FormInterface $form, array $options): void
{
Expand All @@ -34,15 +34,15 @@ public function buildView(FormView $view, FormInterface $form, array $options):
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getBlockPrefix(): string
{
return 'loevgaard_sylius_brand_autocomplete_choice';
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getParent(): string
{
Expand Down
15 changes: 5 additions & 10 deletions src/Form/Type/BrandChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,16 @@

final class BrandChoiceType extends AbstractType
{
/**
* @var RepositoryInterface
*/
/** @var RepositoryInterface */
private $brandRepository;

/**
* @param RepositoryInterface $brandRepository
*/
public function __construct(RepositoryInterface $brandRepository)
{
$this->brandRepository = $brandRepository;
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -38,7 +33,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function configureOptions(OptionsResolver $resolver): void
{
Expand All @@ -53,15 +48,15 @@ public function configureOptions(OptionsResolver $resolver): void
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getParent(): string
{
return ChoiceType::class;
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getBlockPrefix(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Type/BrandImageType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class BrandImageType extends ImageType
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function getBlockPrefix(): string
{
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Type/BrandType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
final class BrandType extends AbstractResourceType
{
/**
* {@inheritdoc}
* @inheritdoc
*/
public function buildForm(FormBuilderInterface $builder, array $options): void
{
Expand All @@ -34,7 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getBlockPrefix(): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/LoevgaardSyliusBrandPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class LoevgaardSyliusBrandPlugin extends AbstractResourceBundle
use SyliusPluginTrait;

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getSupportedDrivers(): array
{
Expand Down
3 changes: 0 additions & 3 deletions src/Menu/AdminMenuListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

final class AdminMenuListener
{
/**
* @param MenuBuilderEvent $event
*/
public function addAdminMenuItems(MenuBuilderEvent $event): void
{
$menu = $event->getMenu();
Expand Down
3 changes: 0 additions & 3 deletions src/Menu/AdminProductFormMenuListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

final class AdminProductFormMenuListener
{
/**
* @param ProductMenuBuilderEvent $event
*/
public function addItems(ProductMenuBuilderEvent $event): void
{
$menu = $event->getMenu();
Expand Down
Loading

0 comments on commit cd5d13a

Please sign in to comment.