Issues (2)

src/Timezone.php (1 issue)

1
<?php
2
/*
3
 * Copyright (c) 2021. Leandro Passos.
4
 */
5
6
namespace ItsMeLePassos\Timezone;
7
/**
8
 * Class Timezone
9
 * @package ItsMeLePassos\Timezone
10
 */
11
class Timezone
12
{
13
    /**
14
     * setTimezone - define a timezone in the PHP official list
15
     * https://www.php.net/manual/en/timezones.php
16
     *
17
     * @param string|null $timezone
18
     * @return string|null
19
     */
20
    public function timezone(string $timezone = null): string
21
    {
22
        return date_default_timezone_set($timezone);
0 ignored issues
show
Bug Best Practice introduced by
The expression return date_default_timezone_set($timezone) returns the type boolean which is incompatible with the type-hinted return string.
Loading history...
23
    }
24
}
25