Skip to content

Commit c185d26

Browse files
committed
fix cs
1 parent 83c02bc commit c185d26

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@
4343
return Factory::create(new CodeIgniter4(), $overrides, $options)->forLibrary(
4444
'CodeIgniter Tasks',
4545
'CodeIgniter Foundation',
46-
46+
4747
);

src/Commands/Publish.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function run(array $params)
4848
'namespace CodeIgniter\\Tasks\\Config' => 'namespace Config',
4949
'use CodeIgniter\\Config\\BaseConfig' => 'use CodeIgniter\\Tasks\\Config\\Tasks as BaseTasks',
5050
'class Tasks extends BaseConfig' => 'class Tasks extends BaseTasks',
51-
]
51+
],
5252
);
5353
}
5454

src/CronExpression.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private function checkTime(string $time, string $format): bool
145145
assert(ctype_digit($currentTime));
146146

147147
// Handle repeating times (i.e. /5 or */5 for every 5 minutes)
148-
if (strpos($time, '/') !== false) {
148+
if (str_contains($time, '/')) {
149149
$period = substr($time, strpos($time, '/') + 1) ?: '';
150150

151151
if ($period === '' || ! ctype_digit($period)) {
@@ -156,7 +156,7 @@ private function checkTime(string $time, string $format): bool
156156
}
157157

158158
// Handle ranges (1-5)
159-
if (strpos($time, '-') !== false) {
159+
if (str_contains($time, '-')) {
160160
$items = [];
161161
[$start, $end] = explode('-', $time);
162162

src/RunResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ public function nextRun(string $expression, Time $next): Time
8282
$satisfied = true;
8383
}
8484
// If the value is a list
85-
elseif (strpos($value, ',') !== false) {
85+
elseif (str_contains($value, ',')) {
8686
if ($this->isInList($nextValue, $value)) {
8787
$satisfied = true;
8888
}
8989
}
9090
// If the value is a range
91-
elseif (strpos($value, '-') !== false) {
91+
elseif (str_contains($value, '-')) {
9292
if ($this->isInRange($nextValue, $value)) {
9393
$satisfied = true;
9494
}
9595
}
9696
// If the value is an increment
97-
elseif (strpos($value, '/') !== false) {
97+
elseif (str_contains($value, '/')) {
9898
if ($this->isInIncrement($nextValue, $value)) {
9999
$satisfied = true;
100100
}

tests/unit/CronExpressionTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use CodeIgniter\Tasks\CronExpression;
1616
use CodeIgniter\Tasks\Exceptions\TasksException;
1717
use CodeIgniter\Test\CIUnitTestCase as TestCase;
18+
use PHPUnit\Framework\Attributes\DataProvider;
1819

1920
/**
2021
* @internal
@@ -140,11 +141,10 @@ public function testHoursAndMins()
140141
}
141142

142143
/**
143-
* @dataProvider provideEveryHour
144-
*
145144
* @param mixed $hourTrue
146145
* @param mixed $hourFalse
147146
*/
147+
#[DataProvider('provideEveryHour')]
148148
public function testEveryHour($hourTrue, $hourFalse)
149149
{
150150
$this->cron->testTime($hourTrue);
@@ -234,9 +234,7 @@ public static function provideNextRun(): iterable
234234
];
235235
}
236236

237-
/**
238-
* @dataProvider provideNextRun
239-
*/
237+
#[DataProvider('provideNextRun')]
240238
public function testNextRun(string $exp, string $expected)
241239
{
242240
$this->cron->testTime('October 5, 2020 8:00 pm');

tests/unit/TaskLogTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use CodeIgniter\Tasks\Task;
1616
use CodeIgniter\Tasks\TaskLog;
1717
use CodeIgniter\Test\CIUnitTestCase as TestCase;
18+
use PHPUnit\Framework\Attributes\DataProvider;
1819

1920
/**
2021
* @internal
@@ -46,12 +47,11 @@ public static function provideDuration(): iterable
4647
}
4748

4849
/**
49-
* @dataProvider provideDuration
50-
*
5150
* @param array|bool|int|string|null $output
5251
*
5352
* @throws Exception
5453
*/
54+
#[DataProvider('provideDuration')]
5555
public function testDuration(string $start, string $end, string $expected, $output)
5656
{
5757
$start = new Time($start);

0 commit comments

Comments
 (0)