PHP Simple OOP Class I am still learning OOP and I need a little help, I don't really know how to properly make this not look so terrible.

Any thoughts?

&lt;?php

class Noti {

    public static $app;
    public static $user;
    public static $url;
    public static $result;
    public static $data;
    public static $title;
    public static $text;

    public static function status($title = null, $text = null) {

        // Error check
        if(empty($title)) return false;
        if(empty($text)) return false;

        // Set
        self::$title = $title;
        self::$text = $text;

        // Get the NOTI config
        self::$app  = Config::get('noti.app_id');
        self::$user = Config::get('noti.user_token');
        self::$url  = Config::get('noti.url');

        // Format
        self::$data = self::format();

        // Url
        $ch = curl_init(self::$url.'add'); // Append add to url for status update
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, self::$data);

        self::$result = curl_exec($ch);

        // Close
        curl_close($ch);

        return self::$result;
    }

    private static function format() {
        $data = array(
            'app' =&gt; self::$app,
            'user' =&gt; self::$user,
            'notification[title]' =&gt; self::$title,
            'notification[text]' =&gt; self::$text
        );

        return http_build_query($data);
    }

}
This is not OOP.

Just using class does not make your code object oriented.  Writing OO code is about encapsulating the state and behavior into objects.

See this answer which explains why public properties and static are bad.

Static is Already Hurting You

Your code relies on Config::get.  Anyone who wants to reuse this class will need to have a class named Config with a method named get.  This is what your class depends on.  If you try to unit test this class you will find it difficult to test it as a unit.  It is already hard-coded to rely on the Config class.

Dependency Injection / Inversion Of Control

To remove the tight coupling to your Config object you should pass in the dependencies to the constructor of the object:

class Noti
{
    protected $app;
    protected $config;

    public function __construct(Config $config)
    {
        $this-&gt;config = $config;
    }

    public function getStatus()
    {
        $this-&gt;app = $this-&gt;config-&gt;get('noti.app_id');
        // etc.
    }
}


Note: I would use docblock comments above to explain all of the methods and properties.

The tight coupling to the Config class's get method has been modified.  From above we see that any Config object or derived class (We type-hinted for Config in the constructor) can be passed into the Noti class.  This could be further decoupled by Type-Hinting for an interface that specifies the contract for the Config object implementation.

The testing is now simple as a mock object can be passed into the constructor and there are no hard-coded dependencies left in the code.

Method Names

Method names should be descriptive.  Consider using verb+noun to describe your methods:

getStatus // instead of status
getQuery  // instead of format


Now we know that we are returning the status, and formatting a URL.  Note: As mseancole points out you are doing too much in your status method.