1
0
mirror of https://github.com/danog/PHPStruct.git synced 2024-11-26 19:54:38 +01:00

Apply fixes from StyleCI

This commit is contained in:
Daniil Gentili 2017-02-25 12:41:26 +00:00 committed by StyleCI Bot
parent f050e9bedf
commit 660ca356da

View File

@ -23,13 +23,14 @@ class Struct
* Istantiates the PHPStruct class in a static variable
*
* @param $format Format string
*
*/
public static function constructor() {
public static function constructor()
{
if (self::$struct == null) {
self::$struct = new \danog\PHP\StructTools();
}
}
/**
* pack.
*
@ -43,6 +44,7 @@ class Struct
public static function pack($format, ...$data)
{
self::constructor();
return self::$struct->pack($format, ...$data);
}
@ -59,6 +61,7 @@ class Struct
public static function unpack($format, $data)
{
self::constructor();
return self::$struct->unpack($format, $data);
}