Merge branch 'patch-2' of github.com:sujayjaju/PHP-FFMpeg into sujayjaju-patch-2

* 'patch-2' of github.com:sujayjaju/PHP-FFMpeg:
  Update AbstractData.php
This commit is contained in:
Romain Neutron 2015-01-30 19:54:33 +01:00
commit 92121bb804

View file

@ -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));
}