Skip to content

Commit d739a69

Browse files
committed
PHPStan Level 6.
1 parent c6c3d37 commit d739a69

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- phpstan-baseline.neon
33
parameters:
4-
level: 5
4+
level: 6
55
checkGenericClassInNonGenericObjectType: false
66
checkMissingIterableValueType: false
77
paths:

src/Propel/Runtime/DataFetcher/AbstractDataFetcher.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
abstract class AbstractDataFetcher implements DataFetcherInterface
99
{
1010
/**
11-
* @var mixed
11+
* @var mixed|null
1212
*/
1313
protected $dataObject;
1414

@@ -21,15 +21,17 @@ public function __construct($dataObject)
2121
}
2222

2323
/**
24-
* @inheritDoc
24+
* @param mixed|null $dataObject
25+
*
26+
* @return void
2527
*/
2628
public function setDataObject($dataObject)
2729
{
2830
$this->dataObject = $dataObject;
2931
}
3032

3133
/**
32-
* @return \Propel\Runtime\DataFetcher\PDODataFetcher
34+
* @return mixed
3335
*/
3436
public function getDataObject()
3537
{

src/Propel/Runtime/DataFetcher/PDODataFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function getStyle()
6464
}
6565

6666
/**
67-
* @param null $style
67+
* @param int|null $style
6868
*
6969
* @return array|null
7070
*/

src/Propel/Runtime/Util/PropelDateTime.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,18 @@ protected static function isTimestamp($value)
4949
if (!is_numeric($value)) {
5050
return false;
5151
}
52-
5352
if (strlen((string)$value) === 8) {
5453
return false;
5554
}
5655

57-
$stamp = strtotime($value);
58-
56+
$stamp = strtotime((string)$value);
5957
if ($stamp === false) {
6058
return true;
6159
}
6260

63-
$month = (int)date('m', $value);
64-
$day = (int)date('d', $value);
65-
$year = (int)date('Y', $value);
61+
$month = (int)date('m', (int)$value);
62+
$day = (int)date('d', (int)$value);
63+
$year = (int)date('Y', (int)$value);
6664

6765
return checkdate($month, $day, $year);
6866
}

tests/Propel/Tests/Runtime/Util/PropelDateTimeTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ public function testIsTimestamp()
214214
{
215215
$this->assertEquals(false, TestPropelDateTime::isTimestamp('20110325'));
216216
$this->assertEquals(true, TestPropelDateTime::isTimestamp(1319580000));
217+
$this->assertEquals(true, TestPropelDateTime::isTimestamp('1319580000'));
217218
$this->assertEquals(false, TestPropelDateTime::isTimestamp('2011-07-20 00:00:00'));
218219
}
219220

@@ -246,6 +247,11 @@ public function testCreateHighPrecisioniTz()
246247

247248
class TestPropelDateTime extends PropelDateTime
248249
{
250+
/**
251+
* @param mixed $value
252+
*
253+
* @return bool
254+
*/
249255
public static function isTimestamp($value)
250256
{
251257
return parent::isTimestamp($value);

0 commit comments

Comments
 (0)