@@ -20,16 +20,16 @@ |
||
| 20 | 20 | |
| 21 | 21 | public static function classDoNotExists(string $class): self |
| 22 | 22 | { |
| 23 | - return new self("Class $class do not exists."); |
|
| 23 | + return new self("class $class do not exists."); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | public static function classHasNoPublicConstant(string $class): self |
| 27 | 27 | { |
| 28 | - return new self("Class $class has no public constant."); |
|
| 28 | + return new self("class $class has no public constant."); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function noConstantMatchingPattern(string $pattern): self |
| 32 | 32 | { |
| 33 | - return new self("Pattern $pattern matches no constant."); |
|
| 33 | + return new self("pattern $pattern matches no constant."); |
|
| 34 | 34 | } |
| 35 | 35 | } |
@@ -29,14 +29,14 @@ discard block |
||
| 29 | 29 | new ConstantExtractor(), |
| 30 | 30 | $pattern, |
| 31 | 31 | $this->translator->reveal(), |
| 32 | - $name.'.%s', |
|
| 32 | + $name . '.%s', |
|
| 33 | 33 | $name |
| 34 | 34 | ); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function testVehicleEnums(): void |
| 38 | 38 | { |
| 39 | - $type = $this->getEnum(Vehicle::class.'::TYPE_*', 'vehicle.type'); |
|
| 39 | + $type = $this->getEnum(Vehicle::class . '::TYPE_*', 'vehicle.type'); |
|
| 40 | 40 | $this->translator->trans('vehicle.type.bike', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Moto'); |
| 41 | 41 | $this->translator->trans('vehicle.type.car', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Voiture'); |
| 42 | 42 | $this->translator->trans('vehicle.type.bus', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Bus'); |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $type->getChoices() |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | - $engine = $this->getEnum(Vehicle::class.'::ENGINE_*', 'vehicle.engine'); |
|
| 49 | + $engine = $this->getEnum(Vehicle::class . '::ENGINE_*', 'vehicle.engine'); |
|
| 50 | 50 | $this->translator->trans('vehicle.engine.electic', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Electrique'); |
| 51 | 51 | $this->translator->trans('vehicle.engine.combustion', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Combustion'); |
| 52 | 52 | self::assertSame('vehicle.engine', $engine->getName()); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $engine->getChoices() |
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | - $brand = $this->getEnum(Vehicle::class.'::BRAND_*', 'vehicle.brand'); |
|
| 58 | + $brand = $this->getEnum(Vehicle::class . '::BRAND_*', 'vehicle.brand'); |
|
| 59 | 59 | $this->translator->trans('vehicle.brand.renault', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Renault'); |
| 60 | 60 | $this->translator->trans('vehicle.brand.volkswagen', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Volkswagen'); |
| 61 | 61 | $this->translator->trans('vehicle.brand.toyota', [], 'messages')->shouldBeCalledTimes(1)->willReturn('Toyota'); |
@@ -18,21 +18,21 @@ |
||
| 18 | 18 | |
| 19 | 19 | public function testVehicleEnums(): void |
| 20 | 20 | { |
| 21 | - $type = $this->getEnum(Vehicle::class.'::TYPE_*', 'vehicle.type'); |
|
| 21 | + $type = $this->getEnum(Vehicle::class . '::TYPE_*', 'vehicle.type'); |
|
| 22 | 22 | self::assertSame('vehicle.type', $type->getName()); |
| 23 | 23 | self::assertSame( |
| 24 | 24 | ['bike' => 'bike', 'car' => 'car', 'bus' => 'bus'], |
| 25 | 25 | $type->getChoices() |
| 26 | 26 | ); |
| 27 | 27 | |
| 28 | - $engine = $this->getEnum(Vehicle::class.'::ENGINE_*', 'vehicle.engine'); |
|
| 28 | + $engine = $this->getEnum(Vehicle::class . '::ENGINE_*', 'vehicle.engine'); |
|
| 29 | 29 | self::assertSame('vehicle.engine', $engine->getName()); |
| 30 | 30 | self::assertSame( |
| 31 | 31 | ['electic' => 'electic', 'combustion' => 'combustion'], |
| 32 | 32 | $engine->getChoices() |
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | - $brand = $this->getEnum(Vehicle::class.'::BRAND_*', 'vehicle.brand'); |
|
| 35 | + $brand = $this->getEnum(Vehicle::class . '::BRAND_*', 'vehicle.brand'); |
|
| 36 | 36 | self::assertSame('vehicle.brand', $brand->getName()); |
| 37 | 37 | self::assertSame( |
| 38 | 38 | ['renault' => 'renault', 'volkswagen' => 'volkswagen', 'toyota' => 'toyota'], |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | public function empty(): Generator |
| 50 | 50 | { |
| 51 | 51 | yield 'class without constant' => [ |
| 52 | - ClassWithoutConstant::class.'::*', |
|
| 52 | + ClassWithoutConstant::class . '::*', |
|
| 53 | 53 | '/Class .+ has no public constant/', |
| 54 | 54 | ]; |
| 55 | 55 | yield 'class without public constant' => [ |
| 56 | - ClassWithNoPublicConstant::class.'::*', |
|
| 56 | + ClassWithNoPublicConstant::class . '::*', |
|
| 57 | 57 | '/Class .+ has no public constant/', |
| 58 | 58 | ]; |
| 59 | 59 | yield 'class with constant but no match' => [ |
| 60 | - ClassWithConstant::class.'::NO_MATCH*', |
|
| 60 | + ClassWithConstant::class . '::NO_MATCH*', |
|
| 61 | 61 | '/Pattern .+ matches no constant/', |
| 62 | 62 | ]; |
| 63 | 63 | } |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | $invalidPatternRegexp, |
| 79 | 79 | ]; |
| 80 | 80 | yield 'missing constant pattern' => [ |
| 81 | - ClassWithConstant::class.'::', |
|
| 81 | + ClassWithConstant::class . '::', |
|
| 82 | 82 | $invalidPatternRegexp, |
| 83 | 83 | ]; |
| 84 | 84 | yield 'two separator' => [ |
| 85 | - ClassWithConstant::class.'::STATUS_*::', |
|
| 85 | + ClassWithConstant::class . '::STATUS_*::', |
|
| 86 | 86 | $invalidPatternRegexp, |
| 87 | 87 | ]; |
| 88 | 88 | yield 'no * in pattern' => [ |
| 89 | - ClassWithConstant::class.'::STATUS_ONLINE', |
|
| 89 | + ClassWithConstant::class . '::STATUS_ONLINE', |
|
| 90 | 90 | $invalidPatternRegexp, |
| 91 | 91 | ]; |
| 92 | 92 | } |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | public function successful(): Generator |
| 95 | 95 | { |
| 96 | 96 | yield 'starting with status' => [ |
| 97 | - ClassWithConstant::class.'::STATUS_*', |
|
| 97 | + ClassWithConstant::class . '::STATUS_*', |
|
| 98 | 98 | [ClassWithConstant::STATUS_ONLINE, ClassWithConstant::STATUS_DRAFT], |
| 99 | 99 | ]; |
| 100 | 100 | yield 'ending with online' => [ |
| 101 | - ClassWithConstant::class.'::*_ONLINE', |
|
| 101 | + ClassWithConstant::class . '::*_ONLINE', |
|
| 102 | 102 | [ClassWithConstant::STATUS_ONLINE], |
| 103 | 103 | ]; |
| 104 | 104 | } |