Skip to content

Commit

Permalink
pint
Browse files Browse the repository at this point in the history
  • Loading branch information
forxer committed Feb 13, 2024
1 parent 9c48aac commit d267e31
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 26 deletions.
15 changes: 14 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector;
use Rector\CodingStyle\Rector\Closure\StaticClosureRector;
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
use Rector\Config\RectorConfig;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Set\ValueObject\SetList;
use RectorLaravel\Rector\FuncCall\RemoveDumpDataDeadCodeRector;
use RectorLaravel\Rector\PropertyFetch\OptionalToNullsafeOperatorRector;
use RectorLaravel\Set\LaravelSetList;

return static function (RectorConfig $rectorConfig): void {
Expand All @@ -16,7 +19,7 @@
]);

$rectorConfig->parallel(
seconds: 360,
processTimeout: 360,
maxNumberOfProcess: 16,
jobSize: 20
);
Expand All @@ -35,6 +38,11 @@
// skip paths and/or rules
//----------------------------------------------------------
$rectorConfig->skip([
// Rector transforme $foo++ en ++$foo et derrière Pint transforme ++$foo en $foo++
// du coup je désactive, laissant pour le moment la priorité à Pint
// @todo : voir qu'est-ce qui est le mieux
PostIncDecToPreIncDecRector::class,

// Transforms false positives, I prefer to disable that (PHP 8.1)
NullToStrictStringFuncCallArgRector::class,

Expand All @@ -43,6 +51,11 @@
StaticArrowFunctionRector::class,
]);

$rectorConfig->rules([
OptionalToNullsafeOperatorRector::class,
RemoveDumpDataDeadCodeRector::class,
]);

// define what sets of rules will be applied
// tip: use "SetList" class to autocomplete sets with your IDE
//----------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Forms/Inputs/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Date extends Input
{
public function __construct(
string $name,
string $value = null,
string $id = null,
string $errorBag = null,
?string $value = null,
?string $id = null,
?string $errorBag = null,
) {
parent::__construct(
name: $name,
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Forms/Inputs/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Email extends Input
{
public function __construct(
string $name,
string $value = null,
string $id = null,
string $errorBag = null,
?string $value = null,
?string $id = null,
?string $errorBag = null,
) {
parent::__construct(
name: $name,
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Forms/Inputs/Hidden.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class Hidden extends Input
{
public function __construct(
string $name,
string $value = null,
string $id = null,
?string $value = null,
?string $id = null,
) {
parent::__construct(
name: $name,
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Forms/Inputs/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class Input extends BladeComponent
public function __construct(
public string $name,
public string $type = 'text',
string $value = null,
string $id = null,
string $errorBag = null
?string $value = null,
?string $id = null,
?string $errorBag = null
) {
$this->value = \old($name, $value ?? '');
$this->id = $id ?? $name;
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Forms/Inputs/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class Password extends Input
{
public function __construct(
string $name,
string $id = null,
string $errorBag = null
?string $id = null,
?string $errorBag = null
) {
parent::__construct(
name: $name,
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Forms/Inputs/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function __construct(
public ?string $placeholder = null,
string $labelAttribute = 'name',
string $valueAttribute = 'id',
string $id = null,
string $errorBag = null
?string $id = null,
?string $errorBag = null
) {
$this->id = $id ?? $name;

Expand Down
6 changes: 3 additions & 3 deletions src/Components/Forms/Inputs/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Text extends Input
{
public function __construct(
string $name,
string $value = null,
string $id = null,
string $errorBag = null,
?string $value = null,
?string $id = null,
?string $errorBag = null,
) {
parent::__construct(
name: $name,
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Forms/Inputs/Textarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class Textarea extends BladeComponent

public function __construct(
public string $name,
string $id = null,
string $errorBag = null
?string $id = null,
?string $errorBag = null
) {
$this->id = $id ?? $name;

Expand Down
6 changes: 3 additions & 3 deletions src/Components/Forms/Inputs/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ class Time extends Input
{
public function __construct(
string $name,
string $value = null,
string $id = null,
string $errorBag = null
?string $value = null,
?string $id = null,
?string $errorBag = null
) {
parent::__construct(
name: $name,
Expand Down
1 change: 1 addition & 0 deletions src/Concerns/BtnVariant.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ trait BtnVariant
private function validBtnVariant(string $variant): string
{
$allowedVariants = self::ALLOWED_BS5_VARIANTS;

if (\app('config')->get('blade-ui-kit-bootstrap.boostrap_version') === 'bootstrap-4') {
$allowedVariants = self::ALLOWED_BS4_VARIANTS;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/CanHaveErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function messages(): array
return $bag->has($this->errorField) ? $bag->get($this->errorField) : [];
}

protected function bootCanHaveErrors(string $errorField, string $errorBag = null): void
protected function bootCanHaveErrors(string $errorField, ?string $errorBag = null): void
{
static $view = null;

Expand All @@ -45,7 +45,7 @@ protected function errorField(string $errorField): void
$this->errorField = $errorField;
}

protected function errorBag(string $errorBag = null): void
protected function errorBag(?string $errorBag = null): void
{
if (is_null($errorBag)) {
return;
Expand Down

0 comments on commit d267e31

Please sign in to comment.