Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions system/I18n/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* @property-read string $quarter
* @property-read string $second
* @property-read int $timestamp
* @property-read string $timezoneName
* @property-read bool $utc
* @property-read string $weekOfMonth
* @property-read string $weekOfYear
Expand Down
33 changes: 17 additions & 16 deletions system/I18n/TimeLegacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,23 @@
* This is not immutable! Some methods are immutable,
* but some methods can alter the state.
*
* @property int $age read-only
* @property string $day read-only
* @property string $dayOfWeek read-only
* @property string $dayOfYear read-only
* @property bool $dst read-only
* @property string $hour read-only
* @property bool $local read-only
* @property string $minute read-only
* @property string $month read-only
* @property string $quarter read-only
* @property string $second read-only
* @property int $timestamp read-only
* @property bool $utc read-only
* @property string $weekOfMonth read-only
* @property string $weekOfYear read-only
* @property string $year read-only
* @property int $age read-only
* @property string $day read-only
* @property string $dayOfWeek read-only
* @property string $dayOfYear read-only
* @property bool $dst read-only
* @property string $hour read-only
* @property bool $local read-only
* @property string $minute read-only
* @property string $month read-only
* @property string $quarter read-only
* @property string $second read-only
* @property int $timestamp read-only
* @property string $timezoneName read-only
* @property bool $utc read-only
* @property string $weekOfMonth read-only
* @property string $weekOfYear read-only
* @property string $year read-only
*
* @phpstan-consistent-constructor
*
Expand Down
7 changes: 5 additions & 2 deletions tests/system/I18n/TimeLegacyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function testMagicIssetFalse(): void
{
$time = TimeLegacy::parse('January 1, 2016');

$this->assertFalse(isset($time->foobar));
$this->assertFalse(isset($time->foobar)); // @phpstan-ignore property.notFound
}

public function testGetYear(): void
Expand Down Expand Up @@ -1128,7 +1128,7 @@ public function testGetter(): void
{
$time = TimeLegacy::parse('August 12, 2016 4:15:23pm');

$this->assertNull($time->weekOfWeek);
$this->assertNull($time->weekOfWeek); // @phpstan-ignore property.notFound
}

public function testUnserializeTimeObject(): void
Expand Down Expand Up @@ -1163,6 +1163,9 @@ public function testToStringDoesNotDependOnLocale(string $locale): void
$this->assertSame('2017-03-10 12:00:00', (string) $time);
}

/**
* @return iterable<int, array{0: string}>
*/
public static function provideToStringDoesNotDependOnLocale(): iterable
{
yield from [
Expand Down
7 changes: 5 additions & 2 deletions tests/system/I18n/TimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public function testMagicIssetFalse(): void
{
$time = Time::parse('January 1, 2016');

$this->assertFalse(isset($time->foobar));
$this->assertFalse(isset($time->foobar)); // @phpstan-ignore property.notFound
}

public function testGetYear(): void
Expand Down Expand Up @@ -1280,7 +1280,7 @@ public function testGetter(): void
{
$time = Time::parse('August 12, 2016 4:15:23pm');

$this->assertNull($time->weekOfWeek);
$this->assertNull($time->weekOfWeek); // @phpstan-ignore property.notFound
}

public function testUnserializeTimeObject(): void
Expand Down Expand Up @@ -1324,6 +1324,9 @@ public function testToStringDoesNotDependOnLocale(string $locale): void
$this->assertSame('2017-03-10 12:00:00', (string) $time);
}

/**
* @return iterable<int, array{0: string}>
*/
public static function provideToStringDoesNotDependOnLocale(): iterable
{
yield from [
Expand Down
3 changes: 1 addition & 2 deletions utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 132 errors
# total 124 errors

includes:
- argument.type.neon
Expand All @@ -12,5 +12,4 @@ includes:
- missingType.iterableValue.neon
- missingType.parameter.neon
- property.defaultValue.neon
- property.notFound.neon
- property.phpDocType.neon
12 changes: 1 addition & 11 deletions utils/phpstan-baseline/missingType.iterableValue.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 82 errors
# total 80 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -357,16 +357,6 @@ parameters:
count: 1
path: ../../tests/system/DataConverter/DataConverterTest.php

-
message: '#^Method CodeIgniter\\I18n\\TimeLegacyTest\:\:provideToStringDoesNotDependOnLocale\(\) return type has no value type specified in iterable type iterable\.$#'
count: 1
path: ../../tests/system/I18n/TimeLegacyTest.php

-
message: '#^Method CodeIgniter\\I18n\\TimeTest\:\:provideToStringDoesNotDependOnLocale\(\) return type has no value type specified in iterable type iterable\.$#'
count: 1
path: ../../tests/system/I18n/TimeTest.php

-
message: '#^Method CodeIgniter\\Models\\FindModelTest\:\:provideAggregateAndGroupBy\(\) return type has no value type specified in iterable type iterable\.$#'
count: 1
Expand Down
33 changes: 0 additions & 33 deletions utils/phpstan-baseline/property.notFound.neon

This file was deleted.

Loading