Skip to content

Commit d995a7a

Browse files
wouterjnicolas-grekas
authored andcommitted
Add missing PHPdoc return types
1 parent 001024d commit d995a7a

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

ClassExistsMock.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,39 @@ public static function withMockedEnums(array $enums)
4141
self::$classes += $enums;
4242
}
4343

44+
/**
45+
* @return bool
46+
*/
4447
public static function class_exists($name, $autoload = true)
4548
{
4649
$name = ltrim($name, '\\');
4750

4851
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \class_exists($name, $autoload);
4952
}
5053

54+
/**
55+
* @return bool
56+
*/
5157
public static function interface_exists($name, $autoload = true)
5258
{
5359
$name = ltrim($name, '\\');
5460

5561
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \interface_exists($name, $autoload);
5662
}
5763

64+
/**
65+
* @return bool
66+
*/
5867
public static function trait_exists($name, $autoload = true)
5968
{
6069
$name = ltrim($name, '\\');
6170

6271
return isset(self::$classes[$name]) ? (bool) self::$classes[$name] : \trait_exists($name, $autoload);
6372
}
6473

74+
/**
75+
* @return bool
76+
*/
6577
public static function enum_exists($name, $autoload = true)
6678
{
6779
$name = ltrim($name, '\\');

ClockMock.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class ClockMock
1919
{
2020
private static $now;
2121

22+
/**
23+
* @return bool|null
24+
*/
2225
public static function withClockMock($enable = null)
2326
{
2427
if (null === $enable) {
@@ -30,6 +33,9 @@ public static function withClockMock($enable = null)
3033
return null;
3134
}
3235

36+
/**
37+
* @return int
38+
*/
3339
public static function time()
3440
{
3541
if (null === self::$now) {
@@ -39,6 +45,9 @@ public static function time()
3945
return (int) self::$now;
4046
}
4147

48+
/**
49+
* @return int
50+
*/
4251
public static function sleep($s)
4352
{
4453
if (null === self::$now) {
@@ -72,6 +81,9 @@ public static function microtime($asFloat = false)
7281
return sprintf('%0.6f00 %d', self::$now - (int) self::$now, (int) self::$now);
7382
}
7483

84+
/**
85+
* @return string
86+
*/
7587
public static function date($format, $timestamp = null)
7688
{
7789
if (null === $timestamp) {
@@ -81,6 +93,9 @@ public static function date($format, $timestamp = null)
8193
return \date($format, $timestamp);
8294
}
8395

96+
/**
97+
* @return string
98+
*/
8499
public static function gmdate($format, $timestamp = null)
85100
{
86101
if (null === $timestamp) {
@@ -90,6 +105,9 @@ public static function gmdate($format, $timestamp = null)
90105
return \gmdate($format, $timestamp);
91106
}
92107

108+
/**
109+
* @return array|int|float
110+
*/
93111
public static function hrtime($asNumber = false)
94112
{
95113
$ns = (self::$now - (int) self::$now) * 1000000000;

DnsMock.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public static function withMockedHosts(array $hosts)
4242
self::$hosts = $hosts;
4343
}
4444

45+
/**
46+
* @return bool
47+
*/
4548
public static function checkdnsrr($hostname, $type = 'MX')
4649
{
4750
if (!self::$hosts) {
@@ -63,6 +66,9 @@ public static function checkdnsrr($hostname, $type = 'MX')
6366
return false;
6467
}
6568

69+
/**
70+
* @return bool
71+
*/
6672
public static function getmxrr($hostname, &$mxhosts, &$weight = null)
6773
{
6874
if (!self::$hosts) {

0 commit comments

Comments
 (0)