Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check if method getLocale exists before to use it (#298)
- Loading branch information
1 parent
330dee8
commit 961657b
Showing
4 changed files
with
54 additions
and
22 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?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\TranslationBundle\Tests\EventSubscriber; | ||
|
||
use Symfony\Component\Security\Core\User\UserInterface; | ||
|
||
/** | ||
* @author Jonathan Vautrin <jvautrin@pro-info.be> | ||
*/ | ||
class LocalizedUser extends User implements UserInterface | ||
{ | ||
private $locale; | ||
|
||
public function __construct(string $locale) | ||
{ | ||
$this->locale = $locale; | ||
} | ||
|
||
public function getLocale() | ||
{ | ||
return $this->locale; | ||
} | ||
|
||
public function setLocale($locale) | ||
{ | ||
$this->locale = $locale; | ||
} | ||
} |
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