diff --git a/src/FFMpeg/FFProbe/DataMapping/AbstractData.php b/src/FFMpeg/FFProbe/DataMapping/AbstractData.php index 6fee9e2..adfbd67 100644 --- a/src/FFMpeg/FFProbe/DataMapping/AbstractData.php +++ b/src/FFMpeg/FFProbe/DataMapping/AbstractData.php @@ -37,13 +37,17 @@ abstract class AbstractData implements \Countable * Returns the property value given its name. * * @param string $property + * @param mixed $default [optional] * @return mixed * * @throws InvalidArgumentException In case the data does not have the property */ - public function get($property) + public function get($property, $default = null) { if (!isset($this->properties[$property])) { + if(!is_null($default)){ + return $default; + } throw new InvalidArgumentException(sprintf('Invalid property `%s`.', $property)); }