for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Nexendrie\Translation\Resolvers;
use Nexendrie\Translation\ISettableLocaleResolver;
/**
* EnvironmentResolver
* Reads current language from an environment variable
*
* @author Jakub Konečný
* @property string|null $lang
*/
final class EnvironmentLocaleResolver implements ISettableLocaleResolver {
use \Nette\SmartObject;
public string $varName = "TRANSLATOR_LANGUAGE";
* @deprecated Access the property directly
public function getLang(): ?string {
$lang = getenv($this->varName);
if(is_string($lang)) {
return $lang;
}
return null;
public function setLang(?string $lang): void {
if($lang === null) {
putenv($this->varName);
} else {
putenv($this->varName . "=$lang");
public function getVarName(): string {
return $this->varName;
public function setVarName(string $varName): void {
$this->varName = $varName;
public function resolve(): ?string {
return $this->getLang();
Nexendrie\Translation\Re...caleResolver::getLang()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
return /** @scrutinizer ignore-deprecated */ $this->getLang();
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
?>
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.