diff --git a/.travis.yml b/.travis.yml index 3f50f06..cb4f332 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: php php: - 5.6 - 7.0 - - hhvm +# - hhvm # - nightly before_script: diff --git a/bob.php b/bob.php index 2d99f81..d1faf65 100644 --- a/bob.php +++ b/bob.php @@ -5,12 +5,21 @@ use BestServedCold\PhalueObjects\Format\Byte\Binary; use BestServedCold\PhalueObjects\Format\Byte\Decimal; -var_dump(Binary::fromString('100 MB')->getValue()); -var_dump(Decimal::fromString('100 MB')->getValue()); -var_dump(Binary::fromFloat(123456)->toString()); -var_dump((string) Binary::fromFloat(1.208925819614629e24)); +//var_dump(Binary::fromString('100 MB')->getValue()); +//var_dump(Decimal::fromString('100 MB')->getValue()); +//var_dump(Binary::fromFloat(123456)->toString()); +//var_dump((string) Binary::fromFloat(1.208925819614629e24)); -use BestServedCold\PhalueObjects\Format\Csv; +use BestServedCold\PhalueObjects\Format\String\Csv; +use BestServedCold\PhalueObjects\Format\String\Yaml; -var_dump(Csv::fromArray([['some', 'text'], ['in', 'a'],['multi-dimensional', 'array']])->getValue()); +var_dump( + Csv::fromArray( + [['some', 'text'], ['in', 'a'], ['multi-dimensional', 'array']] + )->toJson() +); var_dump(Csv::fromArray(['test', 'a', 'thing'])->getValue()); +var_dump(Csv::fromString("this,is,some,CSV\nFor,you,to,see")->toArray()); +var_dump(Csv::fromVOYaml( + Yaml::fromString("[['some','yaml'],['with','multiple'],['aspects','jungle']]") +)->toString()); diff --git a/src/Colour/Hsv.php b/src/Colour/Hsv.php index 62cb558..d98ceff 100644 --- a/src/Colour/Hsv.php +++ b/src/Colour/Hsv.php @@ -2,7 +2,11 @@ use BestServedCold\PhalueObjects\ValueObject; +/** + * Class Hsv + * + * @package BestServedCold\PhalueObjects\Colour + */ class Hsv extends ValueObject { - -} \ No newline at end of file +} diff --git a/src/Colour/Jpg.php b/src/Colour/Jpg.php index 317ec67..b887061 100644 --- a/src/Colour/Jpg.php +++ b/src/Colour/Jpg.php @@ -2,7 +2,11 @@ use BestServedCold\PhalueObjects\ValueObject; +/** + * Class Jpg + * + * @package BestServedCold\PhalueObjects\Colour + */ class Jpg extends ValueObject { - -} \ No newline at end of file +} diff --git a/src/Colour/Rgb.php b/src/Colour/Rgb.php index 1381117..507e43a 100644 --- a/src/Colour/Rgb.php +++ b/src/Colour/Rgb.php @@ -2,7 +2,11 @@ use BestServedCold\PhalueObjects\ValueObject; +/** + * Class Rgb + * + * @package BestServedCold\PhalueObjects\Colour + */ class Rgb extends ValueObject { - -} \ No newline at end of file +} diff --git a/src/Contract/VOFloatable.php b/src/Contract/VOFloatable.php index 864fbec..cf1d441 100644 --- a/src/Contract/VOFloatable.php +++ b/src/Contract/VOFloatable.php @@ -12,7 +12,8 @@ interface VOFloatable extends Floatable { /** - * @return static + * @param VOFloat $voFloat + * @return mixed */ public static function fromVOFloat(VOFloat $voFloat); diff --git a/src/DateTime/Time.php b/src/DateTime/Time.php index 962ab0e..164e93a 100644 --- a/src/DateTime/Time.php +++ b/src/DateTime/Time.php @@ -50,8 +50,7 @@ public function __construct(Hour $hour, Minute $minute, Second $second) $this->second = $second; $this->timestamp = $hour->getSeconds()->add($minute->getSeconds())->add($second); $this->native = self::getNowDateTime() - ->setTime($hour->getValue(), $minute->getValue(), $minute->getValue() - ); + ->setTime($hour->getValue(), $minute->getValue(), $minute->getValue()); parent::__construct($hour, $minute, $second); } diff --git a/src/DateTime/TimeZone.php b/src/DateTime/TimeZone.php index 84d60ca..f420098 100644 --- a/src/DateTime/TimeZone.php +++ b/src/DateTime/TimeZone.php @@ -15,4 +15,6 @@ * @since 0.0.1-alpha * @version 0.0.2-alpha */ -class TimeZone extends ValueObject {} +class TimeZone extends ValueObject +{ +} diff --git a/src/DateTime/Unit/DayTrait.php b/src/DateTime/Unit/DayTrait.php index 62e686f..8b0ddb5 100644 --- a/src/DateTime/Unit/DayTrait.php +++ b/src/DateTime/Unit/DayTrait.php @@ -82,6 +82,7 @@ public function previousDay() } /** + * @param integer $days * @return static */ public function addDay($days) diff --git a/src/DateTime/Unit/Hour.php b/src/DateTime/Unit/Hour.php index ae43bb3..19239ec 100644 --- a/src/DateTime/Unit/Hour.php +++ b/src/DateTime/Unit/Hour.php @@ -90,5 +90,4 @@ public function getMinimum() { return 0; } - } diff --git a/src/DateTime/Unit/Month.php b/src/DateTime/Unit/Month.php index 7e7b380..99be609 100644 --- a/src/DateTime/Unit/Month.php +++ b/src/DateTime/Unit/Month.php @@ -84,5 +84,4 @@ public function getMinimum() { return 1; } - } diff --git a/src/DateTime/Unit/Second.php b/src/DateTime/Unit/Second.php index d96e92b..6baf15f 100644 --- a/src/DateTime/Unit/Second.php +++ b/src/DateTime/Unit/Second.php @@ -29,11 +29,17 @@ public function __construct($value) parent::__construct($value); } + /** + * @return static + */ public static function now() { return new static(self::getNowDateTimeFormat('s')); } + /** + * @return string + */ public function __toString() { return str_pad($this->getValue(), 2, '0', STR_PAD_LEFT); @@ -76,5 +82,4 @@ public function getMinimum() { return 0; } - } diff --git a/src/Exception/InvalidTypeException.php b/src/Exception/InvalidTypeException.php index ae76498..4ea7e3c 100644 --- a/src/Exception/InvalidTypeException.php +++ b/src/Exception/InvalidTypeException.php @@ -2,8 +2,7 @@ namespace BestServedCold\PhalueObjects\Exception; -use BestServedCold\PhalueObjects\Format\Csv; -use BestServedCold\PhalueObjects\Mathematical\Integer; +use BestServedCold\PhalueObjects\Format\String\Csv; /** * Class InvalidTypeException diff --git a/src/File.php b/src/File.php index cb57c76..8931a8b 100644 --- a/src/File.php +++ b/src/File.php @@ -1,8 +1,8 @@ 'Byte' ], [ 'KB' => 'Kilobyte' ], [ 'MB' => 'Megabyte' ], @@ -77,7 +77,7 @@ public function toString() public function getUnit($power = null) { $power = $power ?: $this->getPower(); - $unit = self::UNITS[ (int) floor($this->base()) ]; + $unit = self::$units[ (int) floor($this->base()) ]; return Word::fromString(reset($unit))->getPluralised($power); } @@ -103,6 +103,6 @@ private function base() */ private static function getUnitKeyList() { - return Map::fromVariadic(Value::toArrayWithPlural(true), self::UNITS)->getValue(); + return Map::fromVariadic(Value::toArrayWithPlural(true), self::$units)->getValue(); } } diff --git a/src/Format/Byte/Binary.php b/src/Format/Float/Byte/Binary.php similarity index 58% rename from src/Format/Byte/Binary.php rename to src/Format/Float/Byte/Binary.php index 81459db..7e31740 100644 --- a/src/Format/Byte/Binary.php +++ b/src/Format/Float/Byte/Binary.php @@ -1,8 +1,8 @@ toJson() +); +var_dump(Csv::fromArray(['test', 'a', 'thing'])->getValue()); +var_dump(Csv::fromString("this,is,some,CSV\nFor,you,to,see")->toArray()); +var_dump(Csv::fromVOYaml( + Yaml::fromString("[['some','yaml'],['with','multiple'],['aspects','jungle']]") +)->toString()); +``` + +Outputs: +```shell +string(58) "[["some","text"],["in","a"],["multi-dimensional","array"]]" +string(13) "test,a,thing +" +array(2) { + [0] => + array(4) { + [0] => + string(4) "this" + [1] => + string(2) "is" + [2] => + string(4) "some" + [3] => + string(3) "CSV" + } + [1] => + array(4) { + [0] => + string(3) "For" + [1] => + string(3) "you" + [2] => + string(2) "to" + [3] => + string(3) "see" + } +} +string(39) "some,yaml +with,multiple +aspects,jungle +" +``` ### Json ```php BestServedcold\PhalueObjects\Format\Json diff --git a/src/Format/String/AbstractString.php b/src/Format/String/AbstractString.php new file mode 100644 index 0000000..46f75e8 --- /dev/null +++ b/src/Format/String/AbstractString.php @@ -0,0 +1,135 @@ +toArray()); + } + + /** + * @param $yaml + * @return static + */ + public static function fromYaml($yaml) + { + return static::fromVOYaml(Yaml::fromString($yaml)); + } + + /** + * @return Yaml + */ + public function toVOYaml() + { + return Yaml::fromArray($this->toArray()); + } + + /** + * @return string + */ + public function toYaml() + { + return self::toVOYaml()->getValue(); + } + + /** + * @param Xml $xml + * @return static + */ + public function fromVOXml(Xml $xml) + { + return static::fromArray($xml->toArray()); + } + + /** + * @param $xml + * @return static + */ + public function fromXml($xml) + { + return self::fromVOXml(Xml::fromString($xml)); + } + + /** + * @return Xml + */ + public function toVOXml() + { + return Xml::fromArray($this->toArray()); + } + + /** + * @return string + */ + public function toXml() + { + return $this->toVOXml()->getValue(); + } + + /** + * @param Json $json + * @return static + */ + public static function fromVOJson(Json $json) + { + return static::fromArray($json->toArray()); + } + + /** + * @param string $json + * @return static + */ + public static function fromJson($json) + { + return self::fromVOJson(Json::fromString($json)); + } + + /** + * @return static + */ + public function toVOJson() + { + return Json::fromArray($this->toArray()); + } + + /** + * @return string + */ + public function toJson() + { + return $this->toVOJson()->getValue(); + } +} diff --git a/src/Format/Csv.php b/src/Format/String/Csv.php similarity index 77% rename from src/Format/Csv.php rename to src/Format/String/Csv.php index 600fe17..a5d5ab3 100644 --- a/src/Format/Csv.php +++ b/src/Format/String/Csv.php @@ -1,20 +1,17 @@ getValue(), $delimiter, $enclosure, $escape); + $lines = explode("\n", $this->getValue()); + + return is_array($lines) && count($lines) > 1 + ? array_map($this->iterateCallback($delimiter, $enclosure, $escape), array_filter($lines)) + : str_getcsv($this->getValue(), $delimiter, $enclosure, $escape); + } + + /** + * Move this out into the VOClosure namespace. + * + * @param $delimiter + * @param $enclosure + * @param $escape + * @return \Closure + */ + private function iterateCallback($delimiter, $enclosure, $escape) + { + return function ($row) use ($delimiter, $enclosure, $escape) { + return Csv::fromString($row)->toArray($delimiter, $enclosure, $escape); + }; } /** diff --git a/src/Format/Json.php b/src/Format/String/Json.php similarity index 69% rename from src/Format/Json.php rename to src/Format/String/Json.php index 8f54996..b8611aa 100644 --- a/src/Format/Json.php +++ b/src/Format/String/Json.php @@ -1,34 +1,30 @@ -getValue(), true); - } - - /** - * @param array $array - * @return static - */ - public static function fromArray(array $array) - { - return new static(json_encode($array)); - } - -} +getValue(), true); + } + + /** + * @param array $array + * @return static + */ + public static function fromArray(array $array) + { + return new static(json_encode($array)); + } +} diff --git a/src/Format/Json/Notation.php b/src/Format/String/Json/Notation.php similarity index 91% rename from src/Format/Json/Notation.php rename to src/Format/String/Json/Notation.php index 8c2366b..c15bca1 100644 --- a/src/Format/Json/Notation.php +++ b/src/Format/String/Json/Notation.php @@ -1,6 +1,6 @@ toArray()); + } + + /** + * @param $yaml + * @return static + */ + public static function fromYaml($yaml) + { + return static::fromVOYaml(Yaml::fromString($yaml)); + } + + /** + * @return Yaml + */ + public function toVOYaml() + { + return Yaml::fromArray($this->toArray()); + } + + /** + * @return string + */ + public function toYaml() + { + return self::toVOYaml()->getValue(); + } + + /** + * @param Xml $xml + * @return static + */ + public function fromVOXml(Xml $xml) + { + return static::fromArray($xml->toArray()); + } + + /** + * @param $xml + * @return static + */ + public function fromXml($xml) + { + return self::fromVOXml(Xml::fromString($xml)); + } + + /** + * @return Xml + */ + public function toVOXml() + { + return Xml::fromArray($this->toArray()); + } + + /** + * @return string + */ + public function toXml() + { + return $this->toVOXml()->getValue(); + } + + /** + * @param Json $json + * @return static + */ + public static function fromVOJson(Json $json) + { + return static::fromArray($json->toArray()); + } + + /** + * @param string $json + * @return static + */ + public static function fromJson($json) + { + return self::fromVOJson(Json::fromString($json)); + } + + /** + * @return static + */ + public function toVOJson() + { + return Json::fromArray($this->toArray()); + } + + /** + * @return string + */ + public function toJson() + { + return $this->toVOJson()->getValue(); + } +} diff --git a/src/Format/Xml.php b/src/Format/String/Xml.php similarity index 74% rename from src/Format/Xml.php rename to src/Format/String/Xml.php index b5f1c0c..bdd35ea 100644 --- a/src/Format/Xml.php +++ b/src/Format/String/Xml.php @@ -1,39 +1,36 @@ -parse($this->getValue()); - } - - /** - * @param array $array - * @throws \InvalidArgumentException - * @return string - */ - public static function fromArray(array $array) - { - if (count($array) > 1) { - throw new \InvalidArgumentException('Array must only have one element.'); - } - - return new static((new Service())->write(key($array), reset($array))); - } -} +parse($this->getValue()); + } + + /** + * @param array $array + * @throws \InvalidArgumentException + * @return static + */ + public static function fromArray(array $array) + { + if (count($array) > 1) { + throw new \InvalidArgumentException('Array must only have one element.'); + } + + return new static((new Service())->write(key($array), reset($array))); + } +} diff --git a/src/Format/Yaml.php b/src/Format/String/Yaml.php similarity index 66% rename from src/Format/Yaml.php rename to src/Format/String/Yaml.php index 5de8999..04da161 100644 --- a/src/Format/Yaml.php +++ b/src/Format/String/Yaml.php @@ -1,35 +1,31 @@ -getValue()); - } - - /** - * @param array $array - * @return static - */ - public static function fromArray(array $array) - { - return new static(SymfonyYaml::dump($array)); - } -} +getValue()); + } + + /** + * @param array $array + * @return static + */ + public static function fromArray(array $array) + { + return new static(SymfonyYaml::dump($array)); + } +} diff --git a/src/Format/StringMixin.php b/src/Format/StringMixin.php deleted file mode 100644 index 1be2d91..0000000 --- a/src/Format/StringMixin.php +++ /dev/null @@ -1,49 +0,0 @@ -toArray()); - } - - /** - * @return Yaml - */ - public function toYaml() - { - return Yaml::fromArray($this->toArray()); - } - - /** - * @param Xml $xml - * @return Json - */ - public function fromXml(Xml $xml) - { - return static::fromArray($xml->toArray()); - } - - /** - * @return string - */ - public function toXml() - { - return Xml::fromArray($this->toArray()); - } -} diff --git a/src/Internet/Html.php b/src/Internet/Html.php index 2dfad9a..1352984 100644 --- a/src/Internet/Html.php +++ b/src/Internet/Html.php @@ -2,7 +2,11 @@ namespace BestServedCold\PhalueObjects\Internet; +/** + * Class Html + * + * @package BestServedCold\PhalueObjects\Internet + */ class Html extends ValueObject { - } diff --git a/src/Mathematical/FloatVO.php b/src/Mathematical/FloatVO.php index af08f6d..eda850e 100644 --- a/src/Mathematical/FloatVO.php +++ b/src/Mathematical/FloatVO.php @@ -24,7 +24,10 @@ class FloatVO extends Mathematical protected $round = null; /** - * @param double $value + * FloatVO constructor. + * + * @param float $value + * @param boolean|null $round */ public function __construct($value, $round = null) { diff --git a/src/Mathematical/Percentage.php b/src/Mathematical/Percentage.php index f1eb21a..94fdab4 100644 --- a/src/Mathematical/Percentage.php +++ b/src/Mathematical/Percentage.php @@ -13,4 +13,7 @@ * @since 0.0.1-alpha * @version 0.0.2-alpha */ -class Percentage extends FloatVO {} +class Percentage extends FloatVO +{ + +} diff --git a/src/Mathematical/Range.php b/src/Mathematical/Range.php index 669b3e4..8b7b014 100644 --- a/src/Mathematical/Range.php +++ b/src/Mathematical/Range.php @@ -2,8 +2,7 @@ namespace BestServedCold\PhalueObjects\Mathematical; -use BestServedCold\PhalueObjects\Format\Csv; -use BestServedCold\PhalueObjects\Mathematical; +use BestServedCold\PhalueObjects\Format\String\Csv; use BestServedCold\PhalueObjects\Variadic; /** diff --git a/src/Mathematical/ZeroPaddedInteger.php b/src/Mathematical/ZeroPaddedInteger.php index 1339db9..da66c0e 100644 --- a/src/Mathematical/ZeroPaddedInteger.php +++ b/src/Mathematical/ZeroPaddedInteger.php @@ -28,7 +28,8 @@ public function __construct($value, $leading = 2) $value, strlen((string) $value) + $leading, "0", - STR_PAD_LEFT) + STR_PAD_LEFT + ) ); } } diff --git a/src/Metric/MemoryUsage.php b/src/Metric/MemoryUsage.php index 4685f35..06b72ef 100644 --- a/src/Metric/MemoryUsage.php +++ b/src/Metric/MemoryUsage.php @@ -2,7 +2,7 @@ namespace BestServedCold\PhalueObjects\Metric; -use BestServedCold\PhalueObjects\Format\Byte\Binary; +use BestServedCold\PhalueObjects\Format\Float\Byte\Binary; use BestServedCold\PhalueObjects\Mathematical\Operator\ArithmeticTrait; use BestServedCold\PhalueObjects\VOFloat; diff --git a/src/Metric/MetricInterface.php b/src/Metric/MetricInterface.php index 778ab0e..5715ca9 100644 --- a/src/Metric/MetricInterface.php +++ b/src/Metric/MetricInterface.php @@ -4,7 +4,7 @@ /** * Interface MetricInterface - * + * * @package BestServedCold\PhalueObjects\Metric */ interface MetricInterface diff --git a/src/Metric/PeakMemoryUsage.php b/src/Metric/PeakMemoryUsage.php index 59d2c86..2a13de4 100644 --- a/src/Metric/PeakMemoryUsage.php +++ b/src/Metric/PeakMemoryUsage.php @@ -2,7 +2,7 @@ namespace BestServedCold\PhalueObjects\Metric; -use BestServedCold\PhalueObjects\Format\Byte\Binary; +use BestServedCold\PhalueObjects\Format\Float\Byte\Binary; use BestServedCold\PhalueObjects\Mathematical\Operator\ArithmeticTrait; use BestServedCold\PhalueObjects\VOFloat; diff --git a/src/Pattern/NotConstructable.php b/src/Pattern/NotConstructable.php index e7aae2c..f475845 100644 --- a/src/Pattern/NotConstructable.php +++ b/src/Pattern/NotConstructable.php @@ -16,10 +16,14 @@ abstract class NotConstructable /** * Prevent instance from being cloned. */ - private function __clone() {} + private function __clone() + { + } /** * Prevent instance from being unserialised. */ - private function __wakeup() {} + private function __wakeup() + { + } } diff --git a/src/Pattern/Singleton.php b/src/Pattern/Singleton.php index 1e91824..82ce5e5 100644 --- a/src/Pattern/Singleton.php +++ b/src/Pattern/Singleton.php @@ -23,7 +23,9 @@ class Singleton extends NotConstructable /** * Prevent class from being constructed. */ - private function __construct() {} + private function __construct() + { + } /** * Get instance from $instances array. @@ -32,7 +34,8 @@ private function __construct() {} * Otherwise, create a new copy of the class and store it in the $instances * array. * - * @return mixed + * @param string|null $calledClass + * @return Object */ final public static function getInstance($calledClass = null) { diff --git a/src/Request/Curl.php b/src/Request/Curl.php index 4f404cd..4809410 100644 --- a/src/Request/Curl.php +++ b/src/Request/Curl.php @@ -95,5 +95,6 @@ public function close() public function __destruct() { $this->close(); + parent::__destruct(); } } diff --git a/src/VOArray/Find.php b/src/VOArray/Find.php index 13d4f01..9038a17 100644 --- a/src/VOArray/Find.php +++ b/src/VOArray/Find.php @@ -2,7 +2,7 @@ namespace BestServedCold\PhalueObjects\VOArray; -use BestServedCold\PhalueObjects\Format\Json\Notation; +use BestServedCold\PhalueObjects\Format\String\Json\Notation; use BestServedCold\PhalueObjects\VOArray; /** @@ -39,7 +39,8 @@ public function nativeArray(array $array) */ public function voArray(VOArray $arrayValueObject) { - if ($key = VOArray::fromArray($this->getValue())->getKey($arrayValueObject->current())) { + $key = VOArray::fromArray($this->getValue())->getKey($arrayValueObject->current()); + if ($key) { return $arrayValueObject->isLast() ? $key : static::fromArray($key) ->voArray($arrayValueObject->dropFirst()); @@ -59,5 +60,7 @@ public function keyFromArrayValue($arrayValue) return $key; } } + + return false; } } diff --git a/src/VOArray/Key.php b/src/VOArray/Key.php index 8c7a6fa..f3be862 100644 --- a/src/VOArray/Key.php +++ b/src/VOArray/Key.php @@ -51,5 +51,4 @@ public function keyExists($key) { return array_key_exists($key, $this->getValue()); } - } diff --git a/src/VOArray/Metric.php b/src/VOArray/Metric.php index 0641238..ba0c69c 100644 --- a/src/VOArray/Metric.php +++ b/src/VOArray/Metric.php @@ -2,10 +2,6 @@ namespace BestServedCold\PhalueObjects\VOArray; -use BestServedCold\PhalueObjects\VOArray; -use BestServedCold\PhalueObjects\Exception\InvalidTypeException; -use BestServedCold\PhalueObjects\Contract\ValueObject; - /** * Trait Metric */ @@ -35,11 +31,18 @@ public function isMultiDim() return count($this->getValue()) !== count($this->getValue(), COUNT_RECURSIVE); } + /** + * Get depth + * + * This needs refactoring... + * + * @return float + */ public function getDepth() { $max = 0; $depth = function (&$max) { - return function($line) use (&$max) { + return function ($line) use (&$max) { // every line-indent equals 4 spaces $max = max([$max, (strlen($line) - strlen(ltrim($line))) / 4]); }; @@ -50,6 +53,4 @@ public function getDepth() // [1,2] -> 1, [3,4] -> 2, ..., [N,N+1] -> (N+1)/2 return ceil(($max - 1) / 2) + 1; } - - } diff --git a/src/VOArray/Mixin.php b/src/VOArray/Mixin.php index b666cf3..721d13d 100644 --- a/src/VOArray/Mixin.php +++ b/src/VOArray/Mixin.php @@ -25,6 +25,6 @@ public static function fromVOArray(VOArray $voArray) */ public function toVOArray() { - return VOArray::fromArray(self::toArray()); + return VOArray::fromArray(static::toArray()); } } diff --git a/src/VOClosure/ArrayDepth.php b/src/VOClosure/ArrayDepth.php index 136d89f..199564e 100644 --- a/src/VOClosure/ArrayDepth.php +++ b/src/VOClosure/ArrayDepth.php @@ -11,6 +11,9 @@ */ class ArrayDepth extends VOClosure { + /** + * @return static + */ public static function toDepth() { return new static( diff --git a/src/VOClosure/KeyValue.php b/src/VOClosure/KeyValue.php index f6777f3..f9a66df 100644 --- a/src/VOClosure/KeyValue.php +++ b/src/VOClosure/KeyValue.php @@ -3,7 +3,6 @@ namespace BestServedCold\PhalueObjects\VOClosure; use BestServedCold\PhalueObjects\VOClosure; -use BestServedCold\PhalueObjects\VOString\Word; /** * Class KeyValue @@ -26,5 +25,4 @@ function ($key, $value) use ($prefix, $glue, $suffix) { } ); } - } diff --git a/src/VOString/StringTrait.php b/src/VOString/StringTrait.php index 532cda5..98f46b0 100644 --- a/src/VOString/StringTrait.php +++ b/src/VOString/StringTrait.php @@ -2,8 +2,6 @@ namespace BestServedCold\PhalueObjects\VOString; -use BestServedCold\PhalueObjects\Mathematical\Integer; - /** * Class StringTrait * diff --git a/tests/DateTimeTest.php b/tests/DateTimeTest.php index 86d5fab..e586f68 100644 --- a/tests/DateTimeTest.php +++ b/tests/DateTimeTest.php @@ -10,7 +10,10 @@ class DateTimeTest extends TestCase public function testGetDate() { $dateTime = DateTime::fromString('2013-06-02 09:22:44'); - self::assertInstanceOf('BestServedCold\PhalueObjects\DateTime\Date', $dateTime->getDate()); + self::assertInstanceOf( + 'BestServedCold\PhalueObjects\DateTime\Date', + $dateTime->getDate() + ); self::assertEquals('2013-06-02', $dateTime->getDate()); } diff --git a/tests/FileTest.php b/tests/FileTest.php index 2be7758..de4e65b 100644 --- a/tests/FileTest.php +++ b/tests/FileTest.php @@ -3,9 +3,9 @@ namespace BestServedCold\PhalueObjects; use BestServedCold\PhalueObjects\File\Local; -use BestServedCold\PhalueObjects\Format\Json; -use BestServedCold\PhalueObjects\Format\Xml; -use BestServedCold\PhalueObjects\Format\Yaml; +use BestServedCold\PhalueObjects\Format\String\Json; +use BestServedCold\PhalueObjects\Format\String\Xml; +use BestServedCold\PhalueObjects\Format\String\Yaml; /** * Class FileTest @@ -25,12 +25,6 @@ public function setUp() parent::setUp(); } - public function testGetExtension() - { - - } - - public function testToVOString() { self::assertInstanceOf(VOString::class, $this->file->toVOString()); diff --git a/tests/Format/ByteTest.php b/tests/Format/Float/ByteTest.php similarity index 94% rename from tests/Format/ByteTest.php rename to tests/Format/Float/ByteTest.php index a8ef599..b298da7 100644 --- a/tests/Format/ByteTest.php +++ b/tests/Format/Float/ByteTest.php @@ -1,9 +1,9 @@