Ver Fonte

stan and lint

Vincent há 3 meses atrás
pai
commit
4b7e1b0e62

+ 0 - 1
src/Service/Export/LicenceCmfExporter.php

@@ -118,5 +118,4 @@ class LicenceCmfExporter extends BaseExporter implements ExporterInterface
 
         return self::LICENCE_CMF_COLOR[($year - self::LICENCE_CMF_COLOR_START_YEAR) % count(self::LICENCE_CMF_COLOR)];
     }
-
 }

+ 2 - 1
src/Service/Utils/StringsUtils.php

@@ -56,6 +56,7 @@ class StringsUtils
         if ($length <= 5) {
             throw new \InvalidArgumentException('Length must be greater than 5');
         }
-        return mb_strlen($str) > $length ? mb_substr($str, 0, $length - 3) . '...' : $str;
+
+        return mb_strlen($str) > $length ? mb_substr($str, 0, $length - 3).'...' : $str;
     }
 }

+ 5 - 5
src/State/Processor/Freemium/FreemiumEventProcessor.php

@@ -54,12 +54,12 @@ class FreemiumEventProcessor extends EntityProcessor
     }
 
     /**
-     * Retourne soit un nouvel Event en POST soit l'Event de base en PUT ou DELETE
-     * @param Operation $operation
-     * @param array $uriVariables
-     * @return Event
+     * Retourne soit un nouvel Event en POST soit l'Event de base en PUT ou DELETE.
+     *
+     * @param array<mixed> $uriVariables
      */
-    public function getEvent(Operation $operation, array $uriVariables = []): Event{
+    public function getEvent(Operation $operation, array $uriVariables = []): Event
+    {
         if ($operation instanceof Post) {
             return new Event();
         } else {

+ 1 - 1
tests/Unit/Service/Utils/StringsUtilsTest.php

@@ -83,6 +83,6 @@ class StringsUtilsTest extends TestCase
 
         $this->assertEquals(50, mb_strlen($result)); // 47 + 3 dots
         $this->assertTrue(str_ends_with($result, '...'));
-        $this->assertEquals(str_repeat('A', 47) . '...', $result);
+        $this->assertEquals(str_repeat('A', 47).'...', $result);
     }
 }

+ 3 - 3
tests/Unit/State/Processor/Freemium/FreemiumEventProcessorTest.php

@@ -50,7 +50,7 @@ class FreemiumEventProcessorTest extends TestCase
     }
 
     /**
-     * Test process method for POST operation
+     * Test process method for POST operation.
      */
     public function testProcessWithPostMethod(): void
     {
@@ -84,7 +84,7 @@ class FreemiumEventProcessorTest extends TestCase
     }
 
     /**
-     * Test process method for PUT operation
+     * Test process method for PUT operation.
      */
     public function testProcessWithPutMethod(): void
     {
@@ -118,7 +118,7 @@ class FreemiumEventProcessorTest extends TestCase
     }
 
     /**
-     * Test process method for DELETE operation
+     * Test process method for DELETE operation.
      */
     public function testProcessWithDeleteMethod(): void
     {

+ 9 - 9
tests/Unit/State/Provider/FreemiumEventProviderTest.php

@@ -56,7 +56,7 @@ class FreemiumEventProviderTest extends TestCase
     }
 
     /**
-     * Test provide method for GetCollection operation
+     * Test provide method for GetCollection operation.
      */
     public function testProvideGetCollectionMethod(): void
     {
@@ -74,12 +74,12 @@ class FreemiumEventProviderTest extends TestCase
     }
 
     /**
-     * Test provide method for Get operation
+     * Test provide method for Get operation.
      */
     public function testProvideGetMethod(): void
     {
         $freemiumEventProvide = $this->getFreemiumEventProviderMockFor('provide');
-        $freemiumEvent= $this->getMockBuilder(FreemiumEvent::class)->getMock();
+        $freemiumEvent = $this->getMockBuilder(FreemiumEvent::class)->getMock();
 
         $operation = new Get();
 
@@ -93,12 +93,12 @@ class FreemiumEventProviderTest extends TestCase
     }
 
     /**
-     * Test provideCollection method
+     * Test provideCollection method.
      */
     public function testProvideCollectionMethod(): void
     {
         $freemiumEventProvide = $this->getFreemiumEventProviderMockFor('provideCollection');
-        $freemiumEvent= $this->getMockBuilder(FreemiumEvent::class)->getMock();
+        $freemiumEvent = $this->getMockBuilder(FreemiumEvent::class)->getMock();
 
         $operation = new GetCollection();
 
@@ -128,15 +128,15 @@ class FreemiumEventProviderTest extends TestCase
     }
 
     /**
-     * Test provideItem method
+     * Test provideItem method.
      */
     public function testProvideItemMethod(): void
     {
         $uriVariables = ['id' => 1];
         $freemiumEventProvide = $this->getFreemiumEventProviderMockFor('provideItem');
 
-        $event= $this->getMockBuilder(Event::class)->getMock();
-        $category= $this->getMockBuilder(Categories::class)->getMock();
+        $event = $this->getMockBuilder(Event::class)->getMock();
+        $category = $this->getMockBuilder(Categories::class)->getMock();
         $categories = new ArrayCollection([$category, $category]);
         $event->method('getCategories')->willReturn($categories);
 
@@ -152,7 +152,7 @@ class FreemiumEventProviderTest extends TestCase
         $this->filtersConfigurationService->expects(self::once())
             ->method('restoreTimeConstraintFilters');
 
-        $freemiumEvent= new FreemiumEvent();
+        $freemiumEvent = new FreemiumEvent();
         $this->objectMapper->expects(self::once())
             ->method('map')
             ->willReturn($freemiumEvent);