Skip to content

Commit e0405fc

Browse files
committed
i dont know
1 parent e90cd3e commit e0405fc

File tree

4 files changed

+8
-22
lines changed

4 files changed

+8
-22
lines changed

src/Constraint.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,4 @@ public function importFailed($data, &$entity);
3333
* @return mixed
3434
*/
3535
public function exportFailed($data, &$entity);
36-
37-
38-
/**
39-
* Constraints have priority, `Properties` first, `AdditionalProperties` after, etc...
40-
*/
41-
public static function getPriority();
42-
4336
}

src/Constraint/Properties.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,4 @@ public function exportFailed($data, &$entity)
106106
{
107107
// TODO: Implement exportFailed() method.
108108
}
109-
110-
111-
public static function getPriority()
112-
{
113-
return self::P1;
114-
}
115-
116-
117109
}

src/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@ $structure->import('http://sfsdf.sdfsd/'); // OK
6060
## Solid detection
6161

6262
Use `\stdClass` instead of `array` for `JSON` objects,
63-
cast to `array` on iteration
63+
cast to `array` on iteration
64+
65+
66+
https://github.com/epoberezkin/ajv

src/Schema.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,10 @@ public function __construct($schemaValue = null, Schema $parentSchema = null)
9595
$this->schemaData = $schemaValue;
9696
$this->parentSchema = $parentSchema ? $parentSchema : null;
9797

98-
foreach ($schemaValue as $constraintName => $constraintData) {
99-
$constraint = null;
100-
if (isset(self::$constraintKeys[$constraintName])) {
101-
/** @var Constraint $class */
102-
$class = self::$constraintKeys[$constraintName];
103-
$constraint = new $class($constraintData, $this);
98+
/** @var Constraint $class */
99+
foreach (self::$constraintKeys as $constraintKey => $class) {
100+
if (array_key_exists($constraintKey, $schemaValue)) {
101+
$constraint = new $class($schemaValue[$constraintKey], $this);
104102
$this->setConstraint($constraint);
105103
}
106104
}

0 commit comments

Comments
 (0)