@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | ], |
109 | 109 | ]); |
110 | 110 | |
111 | - $this->assertEquals( [ |
|
111 | + $this->assertEquals([ |
|
112 | 112 | 'foo', |
113 | 113 | 'bar', |
114 | 114 | ], |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | ], |
142 | 142 | ]); |
143 | 143 | |
144 | - $this->assertEquals( [ |
|
144 | + $this->assertEquals([ |
|
145 | 145 | 'foo' => [ |
146 | 146 | 'set' => [ |
147 | 147 | 'equals_to' => 'bar', |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function testInvalidTypeIsNotAllowed() |
48 | 48 | { |
49 | 49 | $rule = Rule::fromArray([ |
50 | - 'foo' => [ ] |
|
50 | + 'foo' => [] |
|
51 | 51 | ]); |
52 | 52 | |
53 | 53 | $rule->ensureRuleNameIsValid(); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function testCheckFunctionReturnRuleValidityAsBoolean() |
57 | 57 | { |
58 | 58 | $rule = Rule::fromArray([ |
59 | - 'foo' => [ ] |
|
59 | + 'foo' => [] |
|
60 | 60 | ]); |
61 | 61 | |
62 | 62 | $this->assertSame( |
@@ -65,7 +65,7 @@ |
||
65 | 65 | foreach ($properties as $k => $v) { |
66 | 66 | if ('object' === gettype($v) && !isset($this->rules()[$k])) { |
67 | 67 | throw new \Sensorario\Resources\Exceptions\PropertyWithoutRuleException( |
68 | - 'When property `' . $k . '` is an object class, must be defined in Resources::rules()'. |
|
68 | + 'When property `' . $k . '` is an object class, must be defined in Resources::rules()' . |
|
69 | 69 | ' but rules here are equals to ' . var_export($this->rules(), true) |
70 | 70 | . ' And properties are ' . var_export($this->properties, true) |
71 | 71 | ); |
@@ -36,7 +36,7 @@ |
||
36 | 36 | if (!$isAllowed) { |
37 | 37 | throw new \Sensorario\Resources\Exceptions\NotAllowedKeyException( |
38 | 38 | "Key `" . get_class($resource) |
39 | - . "::\$$key` with value `" . $value |
|
39 | + . "::\$$key` with value `" . $value |
|
40 | 40 | . "` is not allowed" |
41 | 41 | ); |
42 | 42 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if ($this->typeMismatch()) { |
74 | 74 | if ($this->resource->isFieldNumericButString($this->fieldName)) { |
75 | 75 | throw new \Sensorario\Resources\Exceptions\WrongPropertyValueException( |
76 | - 'Property `'.$this->fieldName.'` must be an integer!' |
|
76 | + 'Property `' . $this->fieldName . '` must be an integer!' |
|
77 | 77 | ); |
78 | 78 | } |
79 | 79 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | if ($this->rule->isNotMail()) { |
107 | 107 | throw new \Sensorario\Resources\Exceptions\InvalidCustomValidatorException( |
108 | - 'Oops! `'. $this->rule->getRuleType() .'` custom validator is not available. Only email is.' |
|
108 | + 'Oops! `' . $this->rule->getRuleType() . '` custom validator is not available. Only email is.' |
|
109 | 109 | ); |
110 | 110 | } |
111 | 111 | } |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | public function testPropertiesAccessor() |
294 | 294 | { |
295 | - $aSpecificRule = [ 'custom-validator' => 'email' ]; |
|
295 | + $aSpecificRule = ['custom-validator' => 'email']; |
|
296 | 296 | |
297 | 297 | $configurator = new Configurator( |
298 | 298 | 'email-resource', |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | 'resources' => [ |
392 | 392 | 'bar' => [ |
393 | 393 | 'constraints' => [ |
394 | - 'allowed' => [ 'allowed_property_name' ], |
|
394 | + 'allowed' => ['allowed_property_name'], |
|
395 | 395 | ] |
396 | 396 | ], |
397 | 397 | ], |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | ); |
401 | 401 | |
402 | 402 | $this->assertEquals( |
403 | - [ 'allowed_property_name' ], |
|
403 | + ['allowed_property_name'], |
|
404 | 404 | $resource->allowed('bar') |
405 | 405 | ); |
406 | 406 | } |
@@ -442,19 +442,19 @@ discard block |
||
442 | 442 | 'resources' => [ |
443 | 443 | 'foo' => [ |
444 | 444 | 'constraints' => [ |
445 | - 'allowed' => [ 'allowed_property_name' ], |
|
445 | + 'allowed' => ['allowed_property_name'], |
|
446 | 446 | ] |
447 | 447 | ], |
448 | 448 | 'unused_resource' => [ |
449 | 449 | 'constraints' => [ |
450 | - 'allowed' => [ 'bar' ], |
|
450 | + 'allowed' => ['bar'], |
|
451 | 451 | ] |
452 | 452 | ], |
453 | 453 | ], |
454 | 454 | ]); |
455 | 455 | |
456 | 456 | $this->assertEquals( |
457 | - [ 'allowed_property_name' ], |
|
457 | + ['allowed_property_name'], |
|
458 | 458 | $container->allowed('foo') |
459 | 459 | ); |
460 | 460 | } |
@@ -506,14 +506,14 @@ discard block |
||
506 | 506 | 'resources' => [ |
507 | 507 | 'foo' => [ |
508 | 508 | 'constraints' => [ |
509 | - 'mandatory' => [ 'mandatory_property' ], |
|
509 | + 'mandatory' => ['mandatory_property'], |
|
510 | 510 | ] |
511 | 511 | ], |
512 | 512 | ], |
513 | 513 | ]); |
514 | 514 | |
515 | 515 | $this->assertEquals( |
516 | - [ 'mandatory_property' ], |
|
516 | + ['mandatory_property'], |
|
517 | 517 | $container->allowed('foo') |
518 | 518 | ); |
519 | 519 | } |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | 'resources' => [ |
531 | 531 | 'foo' => [ |
532 | 532 | 'constraints' => [ |
533 | - 'allowed' => [ 'user_type' ], |
|
533 | + 'allowed' => ['user_type'], |
|
534 | 534 | 'allowedValues' => [ |
535 | 535 | 'user_type' => [ |
536 | 536 | 4, |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | ]) |
544 | 544 | ); |
545 | 545 | |
546 | - $properties = [ 'user_type' => 3 ]; |
|
546 | + $properties = ['user_type' => 3]; |
|
547 | 547 | |
548 | 548 | Resource::box( |
549 | 549 | $properties, |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | ); |
633 | 633 | |
634 | 634 | Resource::box( |
635 | - [ 'age' => 2 ], |
|
635 | + ['age' => 2], |
|
636 | 636 | $configurator |
637 | 637 | ); |
638 | 638 | } |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | 'first-email', |
733 | 733 | ], |
734 | 734 | 'rules' => [ |
735 | - 'first-email' => [ 'custom-validator' => 'email' ], |
|
735 | + 'first-email' => ['custom-validator' => 'email'], |
|
736 | 736 | ], |
737 | 737 | ] |
738 | 738 | ], |
@@ -759,8 +759,8 @@ discard block |
||
759 | 759 | 'resources' => [ |
760 | 760 | 'type-with-number' => [ |
761 | 761 | 'constraints' => [ |
762 | - 'mandatory' => [ 'a-magic-number' ], |
|
763 | - 'rules' => [ 'a-magic-number' => [ 'scalar' => 'integer' ] ], |
|
762 | + 'mandatory' => ['a-magic-number'], |
|
763 | + 'rules' => ['a-magic-number' => ['scalar' => 'integer']], |
|
764 | 764 | ] |
765 | 765 | ], |
766 | 766 | ], |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | 'first-email', |
787 | 787 | ], |
788 | 788 | 'rules' => [ |
789 | - 'first-email' => [ 'custom-validator' => 'email' ], |
|
789 | + 'first-email' => ['custom-validator' => 'email'], |
|
790 | 790 | ], |
791 | 791 | ] |
792 | 792 | ], |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | 'first-email', |
820 | 820 | ], |
821 | 821 | 'rules' => [ |
822 | - 'first-email' => [ 'custom-validator' => 'email' ], |
|
822 | + 'first-email' => ['custom-validator' => 'email'], |
|
823 | 823 | ], |
824 | 824 | ] |
825 | 825 | ], |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | |
850 | 850 | public function testProvideRule() |
851 | 851 | { |
852 | - $aSpecificRule = [ 'custom-validator' => 'email' ]; |
|
852 | + $aSpecificRule = ['custom-validator' => 'email']; |
|
853 | 853 | |
854 | 854 | $configurator = new Configurator( |
855 | 855 | 'email-resource', |