Passed
Pull Request — master (#40)
by Alex
03:15
created
ValidationRules/ITypeAnnotation/TypeAnnotationAssertMatchesTermType.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
         {
54 54
             foreach ($annotation->getPropertyValueBindings() as $property)
55 55
             {
56
-                if (!$foundProperties.contains($property->getBoundProperty()) && !$context->checkIsBad($property))
56
+                if (!$foundProperties . contains($property->getBoundProperty()) && !$context->checkIsBad($property))
57 57
                 {
58 58
                     $context->AddError(
59 59
                         $property->Location(),
Please login to merge, or discard this patch.
Braces   +6 added lines, -13 removed lines patch added patch discarded remove patch
@@ -28,11 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
         $foundProperties = new HashSetInternal();
30 30
 
31
-        foreach ($type->Properties() as  $typeProperty)
32
-        {
31
+        foreach ($type->Properties() as  $typeProperty) {
33 32
             $annotationProperty = $annotation->FindPropertyBinding($typeProperty);
34
-            if ($annotationProperty == null)
35
-            {
33
+            if ($annotationProperty == null) {
36 34
                 $context->AddRawError(
37 35
                     new EdmError(
38 36
                         $annotation->Location(),
@@ -42,19 +40,14 @@  discard block
 block discarded – undo
42 40
                         )
43 41
                     )
44 42
                 );
45
-            }
46
-            else
47
-            {
43
+            } else {
48 44
                 $foundProperties->add($typeProperty);
49 45
             }
50 46
         }
51 47
 
52
-        if (!$type->isOpen())
53
-        {
54
-            foreach ($annotation->getPropertyValueBindings() as $property)
55
-            {
56
-                if (!$foundProperties.contains($property->getBoundProperty()) && !$context->checkIsBad($property))
57
-                {
48
+        if (!$type->isOpen()) {
49
+            foreach ($annotation->getPropertyValueBindings() as $property) {
50
+                if (!$foundProperties.contains($property->getBoundProperty()) && !$context->checkIsBad($property)) {
58 51
                     $context->AddError(
59 52
                         $property->Location(),
60 53
                         EdmErrorCode::TypeAnnotationHasExtraProperties(),
Please login to merge, or discard this patch.
ValidationRules/ITypeAnnotation/TypeAnnotationInaccessibleTerm.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
         $term = $annotation->getTerm();
27 27
         if (
28 28
             !($term instanceof IUnresolvedElement) &&
29
-            $context->getModel()->FindType($term->FullName()) instanceof IStructuredType)
30
-        {
29
+            $context->getModel()->FindType($term->FullName()) instanceof IStructuredType) {
31 30
             $context->AddError(
32 31
                 $annotation->Location(),
33 32
                 EdmErrorCode::BadUnresolvedTerm(),
Please login to merge, or discard this patch.
src/Edm/Validation/ValidationRules/ITypeReference/TypeReferenceRule.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,6 +11,6 @@
 block discarded – undo
11 11
 {
12 12
     public function getValidatedType(): string
13 13
     {
14
-         return ITypeReference::class;
14
+            return ITypeReference::class;
15 15
     }
16 16
 }
17 17
\ No newline at end of file
Please login to merge, or discard this patch.
ValidationRules/ITypeReference/TypeReferenceInaccessibleSchemaType.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         assert($typeReference instanceof ITypeReference);
24 24
         $schemaType = $typeReference->getDefinition();
25
-        if ($schemaType !== null && $schemaType instanceof ISchemaType && !$context->checkIsBad($schemaType))
26
-        {
25
+        if ($schemaType !== null && $schemaType instanceof ISchemaType && !$context->checkIsBad($schemaType)) {
27 26
             Helpers::CheckForUnreachableTypeError($context, $schemaType, $typeReference->Location());
28 27
         }
29 28
     }
Please login to merge, or discard this patch.
IBinaryTypeReference/BinaryTypeReferenceBinaryMaxLengthNegative.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
     public function __invoke(ValidationContext $context, ?IEdmElement $type)
22 22
     {
23 23
         assert($type instanceof IBinaryTypeReference);
24
-        if ($type->getMaxLength() < 0)
25
-        {
24
+        if ($type->getMaxLength() < 0) {
26 25
             $context->AddError(
27 26
                 $type->Location(),
28 27
                 EdmErrorCode::MaxLengthOutOfRange(),
Please login to merge, or discard this patch.
BinaryTypeReferenceBinaryUnboundedNotValidForMaxLength.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
     public function __invoke(ValidationContext $context, ?IEdmElement $type)
22 22
     {
23 23
         assert($type instanceof IBinaryTypeReference);
24
-        if ($type->getMaxLength() != null && $type->isUnBounded())
25
-        {
24
+        if ($type->getMaxLength() != null && $type->isUnBounded()) {
26 25
             $context->AddError(
27 26
                 $type->Location(),
28 27
                 EdmErrorCode::IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull(),
Please login to merge, or discard this patch.
IFunctionBase/FunctionBaseParameterNameAlreadyDefinedDuplicate.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,8 @@
 block discarded – undo
23 23
     {
24 24
         assert($edmFunction instanceof IFunctionBase);
25 25
         $parameterList = new HashSetInternal();
26
-        if ($edmFunction->getParameters() != null)
27
-        {
28
-            foreach ($edmFunction->getParameters() as  $parameter)
29
-            {
26
+        if ($edmFunction->getParameters() != null) {
27
+            foreach ($edmFunction->getParameters() as  $parameter) {
30 28
                 ValidationHelper::AddMemberNameToHashSet(
31 29
                     $parameter,
32 30
                     $parameterList,
Please login to merge, or discard this patch.
StringTypeReferenceStringUnboundedNotValidForMaxLength.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
20 20
     public function __invoke(ValidationContext $context, ?IEdmElement $type)
21 21
     {
22 22
         assert($type instanceof IStringTypeReference);
23
-        if ($type->getMaxLength() != null && $type->isUnbounded())
24
-        {
23
+        if ($type->getMaxLength() != null && $type->isUnbounded()) {
25 24
             $context->AddError(
26 25
                 $type->Location(),
27 26
                 EdmErrorCode::IsUnboundedCannotBeTrueWhileMaxLengthIsNotNull(),
Please login to merge, or discard this patch.
IStringTypeReference/StringTypeReferenceStringMaxLengthNegative.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
     public function __invoke(ValidationContext $context, ?IEdmElement $type)
22 22
     {
23 23
         assert($type instanceof IStringTypeReference);
24
-        if ($type->getMaxLength() < 0)
25
-        {
24
+        if ($type->getMaxLength() < 0) {
26 25
             $context->AddError(
27 26
                 $type->Location(),
28 27
                 EdmErrorCode::MaxLengthOutOfRange(),
Please login to merge, or discard this patch.