public static function create($name, array $properties = [], $serialize = true) {

        try {

            $class = get_called_class();

            $cookie = new $class($name);

            CookieTools::setCookieProperties($cookie, $properties, $serialize);

        } catch (CookieException $ce) {

            throw $ce;

        }

        return $cookie;

    }
public static function create($name, array $properties = [], $serialize = true) {

        try {

            $class = get_called_class();

            $cookie = new $class($name);

            CookieTools::setCookieProperties($cookie, $properties, $serialize);

        } catch (CookieException $ce) {

            throw $ce;

        }

        return $cookie;

    }
public static function create ( $ name , array $ properties = [ ] , $ serialize = true ) { try { $ class = get_called_class ( ) ; $ cookie = new $ class ( $ name ) ; CookieTools :: setCookieProperties ( $ cookie , $ properties , $ serialize ) ; } catch ( CookieException $ ce ) { throw $ ce ; } return $ cookie ; }
Static method to quickly create a cookie

@param string $name
The cookie name

@param array $properties
Array of properties cookie should have

@return self
@throws CookieException
Static method to quickly create a cookie