limoncello-php-dist /
flute
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
| 1 | <?php declare (strict_types = 1); |
||
| 2 | |||
| 3 | namespace Limoncello\Flute\Contracts\Validation; |
||
| 4 | |||
| 5 | /** |
||
| 6 | * Copyright 2015-2019 [email protected] |
||
| 7 | * |
||
| 8 | * Licensed under the Apache License, Version 2.0 (the "License"); |
||
| 9 | * you may not use this file except in compliance with the License. |
||
| 10 | * You may obtain a copy of the License at |
||
| 11 | * |
||
| 12 | * http://www.apache.org/licenses/LICENSE-2.0 |
||
| 13 | * |
||
| 14 | * Unless required by applicable law or agreed to in writing, software |
||
| 15 | * distributed under the License is distributed on an "AS IS" BASIS, |
||
| 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||
| 17 | * See the License for the specific language governing permissions and |
||
| 18 | * limitations under the License. |
||
| 19 | */ |
||
| 20 | |||
| 21 | use Limoncello\Validation\Contracts\Rules\RuleInterface; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @package Limoncello\Application |
||
| 25 | */ |
||
| 26 | interface JsonApiDataRulesSerializerInterface |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * Add rules from data rules class. |
||
| 30 | * |
||
| 31 | * @param string $rulesClass |
||
| 32 | * |
||
| 33 | * @return self |
||
|
0 ignored issues
–
show
|
|||
| 34 | */ |
||
| 35 | public function addRulesFromClass(string $rulesClass): self; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Add rules manually. |
||
| 39 | * |
||
| 40 | * @param string $name |
||
| 41 | * @param RuleInterface $idRule |
||
| 42 | * @param RuleInterface $typeRule |
||
| 43 | * @param RuleInterface[] $attributeRules |
||
| 44 | * @param RuleInterface[] $toOneRules |
||
| 45 | * @param RuleInterface[] $toManyRules |
||
| 46 | * |
||
| 47 | * @return self |
||
| 48 | */ |
||
| 49 | public function addDataRules( |
||
| 50 | string $name, |
||
| 51 | RuleInterface $idRule, |
||
| 52 | RuleInterface $typeRule, |
||
| 53 | array $attributeRules, |
||
| 54 | array $toOneRules, |
||
| 55 | array $toManyRules |
||
| 56 | ): JsonApiDataRulesSerializerInterface; |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Get serialized data. |
||
| 60 | * |
||
| 61 | * @return array |
||
| 62 | */ |
||
| 63 | public function getData(): array; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param array $serializedData |
||
| 67 | * |
||
| 68 | * @return array |
||
| 69 | */ |
||
| 70 | public static function readBlocks(array $serializedData): array; |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @param string $name |
||
| 74 | * @param array $serializedData |
||
| 75 | * |
||
| 76 | * @return bool |
||
| 77 | */ |
||
| 78 | public static function hasRules(string $name, array $serializedData): bool; |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @param string $rulesClass |
||
| 82 | * @param array $serializedData |
||
| 83 | * |
||
| 84 | * @return array |
||
| 85 | */ |
||
| 86 | public static function readRules(string $rulesClass, array $serializedData): array; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @param array $serializedRules |
||
| 90 | * |
||
| 91 | * @return array |
||
| 92 | */ |
||
| 93 | public static function readIdRuleIndexes(array $serializedRules): array; |
||
| 94 | |||
| 95 | /** |
||
| 96 | * @param array $serializedRules |
||
| 97 | * |
||
| 98 | * @return array |
||
| 99 | */ |
||
| 100 | public static function readTypeRuleIndexes(array $serializedRules): array; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * @param array $serializedRules |
||
| 104 | * |
||
| 105 | * @return array |
||
| 106 | */ |
||
| 107 | public static function readAttributeRulesIndexes(array $serializedRules): array; |
||
| 108 | |||
| 109 | /** |
||
| 110 | * @param array $serializedRules |
||
| 111 | * |
||
| 112 | * @return array |
||
| 113 | */ |
||
| 114 | public static function readToOneRulesIndexes(array $serializedRules): array; |
||
| 115 | |||
| 116 | /** |
||
| 117 | * @param array $serializedRules |
||
| 118 | * |
||
| 119 | * @return array |
||
| 120 | */ |
||
| 121 | public static function readToManyRulesIndexes(array $serializedRules): array; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * @param array $ruleIndexes |
||
| 125 | * |
||
| 126 | * @return int |
||
| 127 | */ |
||
| 128 | public static function readRuleIndex(array $ruleIndexes): int; |
||
| 129 | |||
| 130 | /** |
||
| 131 | * @param array $ruleIndexes |
||
| 132 | * |
||
| 133 | * @return array |
||
| 134 | */ |
||
| 135 | public static function readRuleStartIndexes(array $ruleIndexes): array; |
||
| 136 | |||
| 137 | /** |
||
| 138 | * @param array $ruleIndexes |
||
| 139 | * |
||
| 140 | * @return array |
||
| 141 | */ |
||
| 142 | public static function readRuleEndIndexes(array $ruleIndexes): array; |
||
| 143 | |||
| 144 | /** |
||
| 145 | * @param array $arrayRuleIndexes |
||
| 146 | * |
||
| 147 | * @return array |
||
| 148 | */ |
||
| 149 | public static function readRulesIndexes(array $arrayRuleIndexes): array; |
||
| 150 | |||
| 151 | /** |
||
| 152 | * @param array $arrayRuleIndexes |
||
| 153 | * |
||
| 154 | * @return array |
||
| 155 | */ |
||
| 156 | public static function readRulesStartIndexes(array $arrayRuleIndexes): array; |
||
| 157 | |||
| 158 | /** |
||
| 159 | * @param array $arrayRuleIndexes |
||
| 160 | * |
||
| 161 | * @return array |
||
| 162 | */ |
||
| 163 | public static function readRulesEndIndexes(array $arrayRuleIndexes): array; |
||
| 164 | |||
| 165 | /** |
||
| 166 | * @param array $arrayRuleIndexes |
||
| 167 | * @param string $name |
||
| 168 | * |
||
| 169 | * @return array |
||
| 170 | */ |
||
| 171 | public static function readSingleRuleIndexes(array $arrayRuleIndexes, string $name): array; |
||
| 172 | |||
| 173 | /** |
||
| 174 | * @param int $index |
||
| 175 | * @param array $blocks |
||
| 176 | * |
||
| 177 | * @return bool |
||
| 178 | */ |
||
| 179 | public static function hasRule(int $index, array $blocks): bool; |
||
| 180 | } |
||
| 181 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.