Newscoop\Utils\Validation::notNull PHP Method

notNull() public static method

Will throw exception if this is the case.
public static notNull ( mixed $parameter, string $name = 'unknown' )
$parameter mixed The parameter to check for nullity.
$name string The parameter name used for displaying the exception default 'unknown'.
    public static function notNull($parameter, $name = 'unknown')
    {
        if (is_null($parameter)) {
            throw new \Exception("Please provide a value for the parameter '{$name}'.");
        }
    }