rector/rules/Strict/Rector/AbstractFalsyScalarRuleFixerRector.php
Tomas Votruba 53fdb25a5e Updated Rector to commit 888f483102
888f483102 [Renaming] Apply rename fully qualified namespace docblock on RenameNamespaceRector (#1917)
2022-03-10 10:09:54 +00:00

32 lines
1.0 KiB
PHP

<?php
declare (strict_types=1);
namespace Rector\Strict\Rector;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
use Rector\Core\Rector\AbstractRector;
use RectorPrefix20220310\Webmozart\Assert\Assert;
/**
* @see \Rector\Tests\Strict\Rector\BooleanNot\BooleanInBooleanNotRuleFixerRector\BooleanInBooleanNotRuleFixerRectorTest
*/
abstract class AbstractFalsyScalarRuleFixerRector extends \Rector\Core\Rector\AbstractRector implements \Rector\Core\Contract\Rector\ConfigurableRectorInterface
{
/**
* @var string
*/
public const TREAT_AS_NON_EMPTY = 'treat_as_non_empty';
/**
* @var bool
*/
protected $treatAsNonEmpty = \false;
/**
* @param mixed[] $configuration
*/
public function configure(array $configuration) : void
{
$treatAsNonEmpty = $configuration[self::TREAT_AS_NON_EMPTY] ?? (bool) \current($configuration);
\RectorPrefix20220310\Webmozart\Assert\Assert::boolean($treatAsNonEmpty);
$this->treatAsNonEmpty = $treatAsNonEmpty;
}
}