You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
565 B
26 lines
565 B
<?php
|
|
|
|
declare(strict_types = 1);
|
|
|
|
/**
|
|
* @author Robert Strutts
|
|
* @copyright (c) 2025, Robert Strutts
|
|
* @license MIT
|
|
*/
|
|
namespace IOcornerstone\Framework;
|
|
|
|
/**
|
|
* Description of ParameterBag, easy access to has and get methods
|
|
* Used by: Http/Request
|
|
*/
|
|
class ParameterBag {
|
|
public function __construct(readonly private array $parameters = []) { }
|
|
|
|
public function get($key, $default = null) {
|
|
return $this->parameters[$key] ?? $default;
|
|
}
|
|
|
|
public function has($key) {
|
|
return array_key_exists($key, $this->parameters);
|
|
}
|
|
}
|
|
|