61 lines
1.3 KiB
PHP
61 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace alveolata\pod;
|
|
|
|
require_once(DIR_ALVEOLATA . '/pod/functions.php');
|
|
|
|
|
|
/**
|
|
* @template TypeValue
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
class class_pod
|
|
{
|
|
|
|
/**
|
|
* @var struct_pod<TypeValue>
|
|
*/
|
|
private $subject;
|
|
|
|
|
|
/**
|
|
* [constructor]
|
|
*
|
|
* @param struct_pod<TypeValue> $subject
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
private function __construct(struct_pod $subject) {$this->subject = $subject;}
|
|
|
|
|
|
/**
|
|
* @template TypeValue
|
|
* @return struct_pod<TypeValue>
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
public static function toom() : class_pod {return (new class_pod(make_toom()));}
|
|
|
|
|
|
/**
|
|
* @template TypeValue
|
|
* @param TypeValue $value
|
|
* @return struct_pod<TypeValue>
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
public static function full($value) : class_pod {return (new class_pod(make_full($value)));}
|
|
|
|
|
|
/**
|
|
* implementations
|
|
*
|
|
* @author Christian Fraß <frass@greenscale.de>
|
|
*/
|
|
public function has() : bool {return has($this->subject);}
|
|
public function get() {return get($this->subject);}
|
|
public function brook(\Closure $function) : class_pod {return (new class_pod(brook($this->subject, $function)));}
|
|
// public function __isset() : bool {return $this->has();}
|
|
|
|
}
|
|
|
|
class_alias('\alveolata\pod\class_pod', 'pod');
|
|
|
|
?>
|