@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | define('PROJECT_ROOT', __DIR__."/../"); |
| 3 | 3 | |
| 4 | -require_once PROJECT_ROOT . 'vendor/autoload.php'; |
|
| 4 | +require_once PROJECT_ROOT.'vendor/autoload.php'; |
|
| 5 | 5 | |
| 6 | 6 | use Dallgoot\Yaml; |
| 7 | 7 | // use Dallgoot\Yaml\{Loader, Dumper}; |
@@ -14,10 +14,10 @@ discard block |
||
| 14 | 14 | // $yaml = (new Loader('./dummy.yml', null, 0))->parse(); |
| 15 | 15 | // var_dump($yaml); |
| 16 | 16 | $testName = 'yamlObject_properties'; |
| 17 | -$yamlObject = (include PROJECT_ROOT . "tests/cases/dumping/$testName.php"); |
|
| 17 | +$yamlObject = (include PROJECT_ROOT."tests/cases/dumping/$testName.php"); |
|
| 18 | 18 | $text = Yaml::dump($yamlObject, 0); |
| 19 | 19 | |
| 20 | -$nameResultPair = get_object_vars(Yaml::parseFile(PROJECT_ROOT . 'tests/definitions/dumping_tests.yml')); |
|
| 20 | +$nameResultPair = get_object_vars(Yaml::parseFile(PROJECT_ROOT.'tests/definitions/dumping_tests.yml')); |
|
| 21 | 21 | |
| 22 | 22 | // var_dump($nameResultPair); |
| 23 | 23 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | if (count(self::$schemas) === 0) { |
| 107 | 107 | self::createCoreSchema(); |
| 108 | 108 | } |
| 109 | - if (!($value instanceof NodeGeneric) && !($value instanceof NodeList) ) { |
|
| 109 | + if (!($value instanceof NodeGeneric) && !($value instanceof NodeList)) { |
|
| 110 | 110 | throw new \Exception(sprintf(self::WRONG_VALUE, $identifier, gettype($value))); |
| 111 | 111 | } else { |
| 112 | 112 | try { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | } catch (\UnexpectedValueException $e) { |
| 121 | 121 | return new Tagged($identifier, is_null($value) ? null : $value->build($parent)); |
| 122 | 122 | } catch (\Throwable $e) { |
| 123 | - throw new \Exception("Tagged value could not be transformed for tag '$identifier'", 1, $e);; |
|
| 123 | + throw new \Exception("Tagged value could not be transformed for tag '$identifier'", 1, $e); ; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $dumpHandler = new DumperHandlers($options); |
| 50 | 50 | if (is_scalar($dataType)) { |
| 51 | 51 | // TODO: what to woth comments ??? |
| 52 | - return "--- ".$dumpHandler->dumpScalar($dataType). self::LINEFEED ; |
|
| 52 | + return "--- ".$dumpHandler->dumpScalar($dataType).self::LINEFEED; |
|
| 53 | 53 | } |
| 54 | 54 | return $dumpHandler->dump($dataType, 0); |
| 55 | 55 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | throw new \Exception(__METHOD__." expects a YamlObject as parent", 1); |
| 40 | 40 | } |
| 41 | 41 | if (!is_null($this->value)) { |
| 42 | - if ($this->value instanceof Tag){ |
|
| 42 | + if ($this->value instanceof Tag) { |
|
| 43 | 43 | if (!preg_match(Regex::TAG_PARTS, $this->value->raw, $matches)) { |
| 44 | 44 | throw new \UnexpectedValueException("Tag '".$this->value->raw."' is invalid", 1); |
| 45 | 45 | } |