SQL Query Builder in PHP I have made a Query Builder, (not the full version of it yet) but I wanna ask if there is someone out there, there can improve this code even more. Will be nice to know so I can code the rest in the better way :)

&lt;?php
class DB {

    private static $instance = NULL;

    public static function sql(){
        self::$instance = new self();
        return self::$instance;
    }

    // These methods set the query clauses
    // Use * as default
    public function select(string $select_options = "*") {

        $query_part = "SELECT ".$select_options;
        $this-&gt;select = $query_part;
        return $this;
    }

    // From table in DB
    public function from(string $from_options) {

        $query_part = "FROM ".$from_options;

        $this-&gt;from = $query_part;
        return $this;
    }

    // These methods set the query clauses
    public function where(string $where_options) {

        $query_part = "WHERE ".$where_options;
        $this-&gt;where = $query_part;
        return $this;
    }

    // GroupBy
    public function groupBy(string $group_options) {

        $query_part = "groupBy ".$group_options;
        $this-&gt;groupBy = $query_part;
        return $this;
    }



    public function get() {
        $array = (array)$this;
        $string = implode(" ", $array);

        return $string;
    }

}




And this I how it to call the query builder

// Use class DB
$query = DB::sql()
    -&gt;select()
    -&gt;from("CustomerInfo")
    -&gt;where("customer_id &gt; 300")
    -&gt;get();

// Echo result
echo $query;
Layout for code:
Look at PSR spec: http://www.php-fig.org/psr/psr-2/

for comments:
https://www.phpdoc.org/docs/latest/getting-started/your-first-set-of-documentation.html#writing-a-docblock

Finally is your code testable and possibility to extend without modifying it?

Also "(static) $instance" doesn't feel right to me for some reason, try different name?