1<?php
2
3namespace geoPHP\Exception;
4
5/**
6 * Should be thrown if a method is not implemented yet
7 */
8class UnsupportedMethodException extends \Exception
9{
10
11    /**
12     * Public constructor.
13     *
14     * @param string $method Name of the unsupported method
15     * @param int $code
16     * @param string|null $message Additional message
17     */
18    public function __construct($method, $code = 0, $message = null)
19    {
20        $message = 'The method ' . $method . '() is not supported yet.' . ($message ? ' ' . $message : '');
21        parent::__construct($message, $code);
22    }
23
24    /**
25     * Method is supported only with GEOS installed
26     *
27     * @param string $methodName Name of the unsupported method
28     * @return UnsupportedMethodException
29     */
30    public static function geos($methodName)
31    {
32        return new self($methodName, 0, 'Please install GEOS extension.');
33    }
34}
35