for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Loevgaard\SyliusBarcodePlugin\Fixture\Factory;
use Loevgaard\SyliusBarcodePlugin\Model\BarcodeAwareInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* It can be used on some custom ProductVariantExampleFactory
* (which Sylius don't have)
*/
trait BarcodeAwareExampleFactoryTrait
{
protected function configureBarcodeOptions(OptionsResolver $resolver, int $chanceOfRandomBarcode = 90): void
$chanceOfRandomBarcode
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
protected function configureBarcodeOptions(OptionsResolver $resolver, /** @scrutinizer ignore-unused */ int $chanceOfRandomBarcode = 90): void
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$resolver
->setDefault('barcode', static function (): string {
static $faker;
if (null === $faker) {
$faker = \Faker\Factory::create();
}
return $faker->ean13;
})
->setAllowedTypes('barcode', ['null', 'string'])
;
protected function setBarcodeField(BarcodeAwareInterface $barcodeAware, array $resolvedOptions = []): void
$barcodeAware->setBarcode($resolvedOptions['barcode']);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.