-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
170 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,40 @@ | ||
UPGRADE 2.x | ||
=========== | ||
|
||
UPGRADE FROM 2.7 to 2.8 | ||
======================= | ||
|
||
### Timezone detector | ||
|
||
``Sonata\IntlBundle\Timezone\TimezoneAwareInterface`` was added in order to provide | ||
timezone detection for any user class. | ||
|
||
Timezone inference based on the ``Sonata\UserBundle\Model\User::getTimezone()`` method | ||
is deprecated and will be dropped in 3.0 version. | ||
You MUST implement ``Sonata\IntlBundle\Timezone\TimezoneAwareInterface`` explicitly | ||
in your user class. | ||
|
||
Before: | ||
```php | ||
class User | ||
{ | ||
// ... | ||
} | ||
``` | ||
|
||
After: | ||
```php | ||
class User implements \Sonata\IntlBundle\Timezone\TimezoneAwareInterface | ||
{ | ||
// ... | ||
} | ||
``` | ||
|
||
UPGRADE FROM 2.3 to 2.4 | ||
======================= | ||
|
||
### Tests | ||
|
||
All files under the ``Tests`` directory are now correctly handled as internal test classes. | ||
You can't extend them anymore, because they are only loaded when running internal tests. | ||
All files under the ``Tests`` directory are now correctly handled as internal test classes. | ||
You can't extend them anymore, because they are only loaded when running internal tests. | ||
More information can be found in the [composer docs](https://getcomposer.org/doc/04-schema.md#autoload-dev). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\IntlBundle\Timezone; | ||
|
||
/** | ||
* @author Javier Spagnoletti <phansys@gmail.com> | ||
*/ | ||
interface TimezoneAwareInterface | ||
{ | ||
public function getTimezone(): ?string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\IntlBundle\Timezone; | ||
|
||
/** | ||
* Basic Implementation of TimezoneAwareInterface. | ||
* | ||
* @author Javier Spagnoletti <phansys@gmail.com> | ||
*/ | ||
trait TimezoneAwareTrait | ||
{ | ||
/** | ||
* @var string|null | ||
*/ | ||
private $timezone; | ||
|
||
final public function getTimezone(): ?string | ||
{ | ||
return $this->timezone; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters