2021-02-26 16:16:17 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Trait TestOptionsTrait
|
|
|
|
*
|
|
|
|
* @created 28.08.2018
|
|
|
|
* @author smiley <smiley@chillerlan.net>
|
|
|
|
* @copyright 2018 smiley
|
|
|
|
* @license MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace chillerlan\SettingsTest;
|
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
use function sha1;
|
|
|
|
|
2021-02-26 16:16:17 +00:00
|
|
|
trait TestOptionsTrait{
|
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected string $test1 = 'foo';
|
2021-02-26 16:16:17 +00:00
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected ?bool $test2 = null;
|
2021-02-26 16:16:17 +00:00
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected string $testConstruct;
|
2021-02-26 16:16:17 +00:00
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected ?string $test4 = null;
|
2021-02-26 16:16:17 +00:00
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected ?string $test5 = null;
|
2021-02-26 16:16:17 +00:00
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected ?string $test6 = null;
|
2021-02-26 16:16:17 +00:00
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected function TestOptionsTrait():void{
|
2021-02-26 16:16:17 +00:00
|
|
|
$this->testConstruct = 'success';
|
|
|
|
}
|
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected function set_test5($value):void{
|
2021-02-26 16:16:17 +00:00
|
|
|
$this->test5 = $value.'_test5';
|
|
|
|
}
|
|
|
|
|
2022-07-02 14:01:51 +00:00
|
|
|
protected function get_test6():string{
|
2021-02-26 16:16:17 +00:00
|
|
|
return $this->test6 === null
|
|
|
|
? 'null'
|
|
|
|
: sha1($this->test6);
|
|
|
|
}
|
|
|
|
}
|