Skip to content

Commit

Permalink
Factory varchar produces fake()->paragraph() which is too long #68 (#69)
Browse files Browse the repository at this point in the history
* Factory varchar produces fake()->paragraph() which is too long #68

* Linting
  • Loading branch information
cable8mm authored Jun 30, 2024
1 parent b605176 commit 969f51b
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 35 deletions.
3 changes: 1 addition & 2 deletions src/ForeignKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public function __construct(
public string $column,
public string $referenced_table,
public string $referenced_column,
) {
}
) {}

/**
* Get column information array.
Expand Down
4 changes: 1 addition & 3 deletions src/Resolvers/BooleanResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
*
* Equal to BOOL
*/
final class BooleanResolver extends BoolResolver
{
}
final class BooleanResolver extends BoolResolver {}
4 changes: 1 addition & 3 deletions src/Resolvers/DecResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
/**
* Equal to DECIMAL(size,d)
*/
class DecResolver extends DecimalResolver
{
}
class DecResolver extends DecimalResolver {}
4 changes: 1 addition & 3 deletions src/Resolvers/IntegerResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
*
* Equal to INT(size)
*/
final class IntegerResolver extends IntResolver
{
}
final class IntegerResolver extends IntResolver {}
4 changes: 1 addition & 3 deletions src/Resolvers/MultilinestringResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
/**
* MULTILINESTRING
*/
class MultilinestringResolver extends VarcharResolver
{
}
class MultilinestringResolver extends VarcharResolver {}
4 changes: 1 addition & 3 deletions src/Resolvers/NumericResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
/**
* NUMERIC
*/
class NumericResolver extends DecimalResolver
{
}
class NumericResolver extends DecimalResolver {}
4 changes: 1 addition & 3 deletions src/Resolvers/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ abstract class Resolver implements ResolverInterface
*/
public function __construct(
protected Column $column
) {

}
) {}

/**
* {@inheritDoc}
Expand Down
4 changes: 1 addition & 3 deletions src/Resolvers/StringResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@
* A VARIABLE length string (can contain letters, numbers, and special characters).
* The size parameter specifies the maximum column length in characters - can be from 0 to 65535
*/
final class StringResolver extends VarcharResolver
{
}
final class StringResolver extends VarcharResolver {}
2 changes: 1 addition & 1 deletion src/Resolvers/VarcharResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class VarcharResolver extends Resolver
{
public function fake(): string
{
return '\''.$this->column->field.'\' => fake()->paragraph(),';
return '\''.$this->column->field.'\' => fake()->text(),';
}

public function migration(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Support/Picker.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ private function __construct(
private ?string $driver = null,
private ?string $field = null,
private ?string $type = null,
) {

}
) {}

/**
* Set a field value.
Expand Down
8 changes: 2 additions & 6 deletions src/Xeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ final class Xeed implements ArrayAccess
* is not allowed to call from outside to prevent from creating multiple instances,
* to use the singleton, you have to obtain the instance from Xeed::getInstance() instead
*/
private function __construct()
{
}
private function __construct() {}

/**
* Establish connection
Expand Down Expand Up @@ -144,9 +142,7 @@ public static function getInstance(): static
/**
* prevent the instance from being cloned (which would create a second instance of it)
*/
private function __clone()
{
}
private function __clone() {}

/**
* prevent from being unserialized (which would create a second instance of it)
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Resolvers/StringResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function test_fake_method_can_working_well(): void
{
$resolver = new StringResolver($this->column);

$this->assertEquals('\''.$resolver->field.'\' => fake()->paragraph(),', $resolver->fake());
$this->assertEquals('\''.$resolver->field.'\' => fake()->text(),', $resolver->fake());
}

public function test_migration_method_can_working_well(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Resolvers/VarcharResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function test_fake_method_can_working_well(): void
{
$resolver = new VarcharResolver($this->column);

$this->assertEquals('\'string\' => fake()->paragraph(),', $resolver->fake());
$this->assertEquals('\'string\' => fake()->text(),', $resolver->fake());
}

public function test_migration_method_can_working_well(): void
Expand Down

0 comments on commit 969f51b

Please sign in to comment.