rector/rules/Strict/Rector/AbstractFalsyScalarRuleFixerRector.php
Tomas Votruba 5e0eef55a5 Updated Rector to commit c6473c6a0b
c6473c6a0b [Php81] Fix NewInInitializerRector code sample (#1264)
2021-11-18 07:58:51 +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 RectorPrefix20211118\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 array<string, mixed> $configuration
*/
public function configure(array $configuration) : void
{
$treatAsNonEmpty = $configuration[self::TREAT_AS_NON_EMPTY] ?? \false;
\RectorPrefix20211118\Webmozart\Assert\Assert::boolean($treatAsNonEmpty);
$this->treatAsNonEmpty = $treatAsNonEmpty;
}
}