Skip to content

Commit 4446383

Browse files
github-actionsgithub-actions[bot]
authored andcommitted
style(php-cs-fixer): lint php files and fix coding standards
1 parent 07382b6 commit 4446383

File tree

22 files changed

+51
-39
lines changed

22 files changed

+51
-39
lines changed

src/Bridge/Laravel/Console/Commands/Database/ListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function handle(DatabaseConfig $config, DatabaseProviderInterface $dbal):
4848
$databaseArgumentValue = $this->argument('db');
4949

5050
/** @var array<string> $databases */
51-
$databases = (null !== $databaseArgumentValue)
51+
$databases = ($databaseArgumentValue !== null)
5252
? [$databaseArgumentValue]
5353
: array_keys($config->getDatabases());
5454

src/Bridge/Laravel/Console/Commands/Database/TableCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private function describeType(AbstractColumn $column): string
226226
$type .= " ({$column->getSize()})";
227227
}
228228

229-
if ('decimal' === $abstractType) {
229+
if ($abstractType === 'decimal') {
230230
$type .= " ({$column->getPrecision()}, {$column->getScale()})";
231231
}
232232

src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function handle(): int
3232
$found = false;
3333
$count = $this->option('one') ? 1 : PHP_INT_MAX;
3434

35-
while (0 < $count && null !== ($migration = $this->migrator->run())) {
35+
while ($count > 0 && null !== ($migration = $this->migrator->run())) {
3636
$found = true;
3737
--$count;
3838

src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function handle(): int
3333
$found = false;
3434
$count = ! $this->option('all') ? 1 : PHP_INT_MAX;
3535
try {
36-
while (0 < $count && null !== ($migration = $this->migrator->rollback())) {
36+
while ($count > 0 && null !== ($migration = $this->migrator->rollback())) {
3737
$found = true;
3838
--$count;
3939
$this->line(

src/Bridge/Laravel/Console/Commands/Migrations/StatusCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
final class StatusCommand extends AbstractCommand
1717
{
1818
private const DATE_TIME_FORMAT = 'Y-m-d H:i:s';
19+
1920
private const PENDING = '<fg=red>not executed yet</fg=red>';
2021

2122
protected $signature = 'cycle:migrate:status';

src/Bridge/Laravel/Providers/CycleServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function boot(): void
3838
$config = $this->app->get(IlluminateConfig::class);
3939
$warmup = $config->get('cycle.warmup');
4040

41-
if (true === $warmup) {
41+
if ($warmup === true) {
4242
/** @var CycleORM $orm */
4343
$orm = $this->app->get(ORMInterface::class);
4444
$orm->prepareServices();

src/Bridge/Laravel/Providers/Registrator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@
77
interface Registrator
88
{
99
public const CFG_KEY = 'cycle';
10+
1011
public const CFG_KEY_DATABASE = 'cycle.database';
12+
1113
public const CFG_KEY_TOKENIZER = 'cycle.tokenizer';
14+
1215
public const CFG_KEY_ATTRIBUTES = 'cycle.attributes';
16+
1317
public const CFG_KEY_MIGRATIONS = 'cycle.migrations';
18+
1419
public const CFG_KEY_SCHEMA = 'cycle.schema';
20+
1521
public const CFG_KEY_WARMUP = 'cycle.warmup';
22+
1623
public const CFG_KEY_RELATIONS = 'cycle.customRelations';
1724
}

src/Bridge/Laravel/Rules/Exists.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
3131

3232
$count = $table->where([$this->column => $value])->count();
3333

34-
if (0 === $count) {
34+
if ($count === 0) {
3535
$fail($this->message());
3636
}
3737
}

src/Bridge/Laravel/Rules/Unique.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function validate(string $attribute, mixed $value, Closure $fail): void
3131

3232
$count = $table->where([$this->column => $value])->count();
3333

34-
if (0 < $count) {
34+
if ($count > 0) {
3535
$fail($this->message());
3636
}
3737
}

src/Bridge/Telescope/Events/Database/QueryExecuted.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ final class QueryExecuted
1313
public function __construct(public string $sql, public array $bindings, public ?float $time, public ?string $driver = null)
1414
{
1515
$this->time = $time * 1000;
16-
$this->driver = null !== $driver ? 'CycleORM/' . $driver : 'CycleORM';
16+
$this->driver = $driver !== null ? 'CycleORM/' . $driver : 'CycleORM';
1717
}
1818
}

0 commit comments

Comments
 (0)