phpstan fixes
This commit is contained in:
@ -21,8 +21,8 @@ class PropertyBag
|
||||
/**
|
||||
* Add a property value, fails if the property exists
|
||||
*
|
||||
* @param string Property name
|
||||
* @param mixed Value
|
||||
* @param string $prop Property name
|
||||
* @param mixed $value Value
|
||||
* @throws PropertyException if the property already exists
|
||||
*/
|
||||
public function add(string $prop, $value)
|
||||
@ -37,14 +37,19 @@ class PropertyBag
|
||||
* Set a property value, create the property if it doesn't
|
||||
* exist.
|
||||
*
|
||||
* @param string Property name
|
||||
* @param mixed Value
|
||||
* @param string $prop Property name
|
||||
* @param mixed $value Value
|
||||
*/
|
||||
public function set(string $prop, $value)
|
||||
{
|
||||
$this->props[$prop] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply properties without removing anything.
|
||||
*
|
||||
* @param array $props The properties to apply
|
||||
*/
|
||||
public function setAll(array $props)
|
||||
{
|
||||
$this->props = array_merge(
|
||||
@ -57,7 +62,7 @@ class PropertyBag
|
||||
* Get the value of a property, fails if the property does not exist.
|
||||
* Use the value() method to get with a default value
|
||||
*
|
||||
* @param string Property name
|
||||
* @param string $prop Property name
|
||||
* @return mixed
|
||||
* @throws PropertyException if the property does not exist
|
||||
*/
|
||||
@ -92,8 +97,8 @@ class PropertyBag
|
||||
/**
|
||||
* Get the value of the property, or use the provided default value.
|
||||
*
|
||||
* @param string Property name
|
||||
* @param mixed Default value
|
||||
* @param string $prop Property name
|
||||
* @param mixed|null $default Default value
|
||||
* @return mixed
|
||||
*/
|
||||
public function valueOf(string $prop, $default=null)
|
||||
@ -105,6 +110,8 @@ class PropertyBag
|
||||
|
||||
/**
|
||||
* Remove a property
|
||||
*
|
||||
* @param string $prop Property name
|
||||
*/
|
||||
public function delete(string $prop)
|
||||
{
|
||||
@ -113,6 +120,8 @@ class PropertyBag
|
||||
|
||||
/**
|
||||
* Check if a property is present
|
||||
*
|
||||
* @param string $prop Property name
|
||||
*/
|
||||
public function has(string $prop): bool
|
||||
{
|
||||
@ -121,6 +130,8 @@ class PropertyBag
|
||||
|
||||
/**
|
||||
* Check if all the provided properties are present
|
||||
*
|
||||
* @param array $props Property names
|
||||
*/
|
||||
public function hasAll(array $props)
|
||||
{
|
||||
|
Reference in New Issue
Block a user