Submit
Path:
~
/
home
/
getwphos
/
www
/
almajd14
/
wp-content
/
plugins
/
woocommerce
/
vendor
/
opis
/
json-schema
/
src
/
Keywords
/
File Content:
ConstDataKeyword.php
<?php /* ============================================================================ * Copyright 2020 Zindex Software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================ */ namespace Opis\JsonSchema\Keywords; use Opis\JsonSchema\{ValidationContext, Schema, JsonPointer}; use Opis\JsonSchema\Errors\ValidationError; class ConstDataKeyword extends ConstKeyword { protected JsonPointer $value; /** * @param JsonPointer $value */ public function __construct(JsonPointer $value) { $this->value = $value; parent::__construct(null); } /** * @inheritDoc */ public function validate(ValidationContext $context, Schema $schema): ?ValidationError { $value = $this->value->data($context->rootData(), $context->currentDataPath(), $this); if ($value === $this) { return $this->error($schema, $context, 'const', 'Invalid $data', [ 'pointer' => (string)$this->value, ]); } $this->const = $value; $ret = parent::validate($context, $schema); $this->const = null; return $ret; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
AbstractRefKeyword.php
3807 bytes
0644
AdditionalItemsKeyword.php
2770 bytes
0644
AdditionalPropertiesKeyword.php
2495 bytes
0644
AllOfKeyword.php
2431 bytes
0644
AnyOfKeyword.php
2628 bytes
0644
ConstDataKeyword.php
1724 bytes
0644
ConstKeyword.php
1526 bytes
0644
ContainsKeyword.php
4389 bytes
0644
ContentEncodingKeyword.php
2505 bytes
0644
ContentMediaTypeKeyword.php
2470 bytes
0644
ContentSchemaKeyword.php
2081 bytes
0644
DefaultKeyword.php
1584 bytes
0644
DependenciesKeyword.php
3228 bytes
0644
DependentRequiredKeyword.php
1950 bytes
0644
DependentSchemasKeyword.php
2528 bytes
0644
EnumDataKeyword.php
1774 bytes
0644
EnumKeyword.php
2114 bytes
0644
ErrorTrait.php
1859 bytes
0644
ExclusiveMaximumDataKeyword.php
1790 bytes
0644
ExclusiveMaximumKeyword.php
1522 bytes
0644
ExclusiveMinimumDataKeyword.php
1790 bytes
0644
ExclusiveMinimumKeyword.php
1524 bytes
0644
FiltersKeyword.php
2893 bytes
0644
FormatKeyword.php
2320 bytes
0644
IfThenElseKeyword.php
3124 bytes
0644
ItemsKeyword.php
4997 bytes
0644
IterableDataValidationTrait.php
3342 bytes
0644
MaxItemsDataKeyword.php
1745 bytes
0644
MaxItemsKeyword.php
1617 bytes
0644
MaxLengthDataKeyword.php
1755 bytes
0644
MaxLengthKeyword.php
1621 bytes
0644
MaxPropertiesDataKeyword.php
1748 bytes
0644
MaxPropertiesKeywords.php
1640 bytes
0644
MaximumDataKeyword.php
1763 bytes
0644
MaximumKeyword.php
1531 bytes
0644
MinItemsDataKeyword.php
1745 bytes
0644
MinItemsKeyword.php
1618 bytes
0644
MinLengthDataKeyword.php
1782 bytes
0644
MinLengthKeyword.php
1668 bytes
0644
MinPropertiesDataKeyword.php
1760 bytes
0644
MinPropertiesKeyword.php
1640 bytes
0644
MinimumDataKeyword.php
1751 bytes
0644
MinimumKeyword.php
1533 bytes
0644
MultipleOfDataKeyword.php
1788 bytes
0644
MultipleOfKeyword.php
1568 bytes
0644
NotKeyword.php
1901 bytes
0644
OfTrait.php
1534 bytes
0644
OneOfKeyword.php
3064 bytes
0644
PatternDataKeyword.php
1879 bytes
0644
PatternKeyword.php
1635 bytes
0644
PatternPropertiesKeyword.php
3899 bytes
0644
PointerRefKeyword.php
1984 bytes
0644
PropertiesKeyword.php
3175 bytes
0644
PropertyNamesKeyword.php
2160 bytes
0644
RecursiveRefKeyword.php
4084 bytes
0644
RequiredDataKeyword.php
2465 bytes
0644
RequiredKeyword.php
1871 bytes
0644
SlotsKeyword.php
4280 bytes
0644
TemplateRefKeyword.php
3941 bytes
0644
TypeKeyword.php
1652 bytes
0644
URIRefKeyword.php
1903 bytes
0644
UnevaluatedItemsKeyword.php
2381 bytes
0644
UnevaluatedPropertiesKeyword.php
2467 bytes
0644
UniqueItemsDataKeyword.php
1662 bytes
0644
UniqueItemsKeyword.php
1714 bytes
0644
N4ST4R_ID | Naxtarrr