parseAndDuplicateRequest() public static method

Gets a fixed request.
public static parseAndDuplicateRequest ( Request $request ) : Request
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Request
Exemplo n.º 1
0
 public function testParseAndDupplicateRequest()
 {
     $request = new Request(['toto=tata'], [], [], [], [], [], '{"gerard":"toto"}');
     $value = RequestParser::parseAndDuplicateRequest($request);
     $this->assertNotNull($value);
 }
Exemplo n.º 2
0
 /**
  * Extracts properties to filter from the request.
  *
  * @param Request $request
  *
  * @return array
  */
 protected function extractProperties(Request $request) : array
 {
     $needsFixing = false;
     if (null !== $this->properties) {
         foreach ($this->properties as $property => $value) {
             if ($this->isPropertyNested($property) && $request->query->has(str_replace('.', '_', $property))) {
                 $needsFixing = true;
             }
         }
     }
     if ($needsFixing) {
         $request = RequestParser::parseAndDuplicateRequest($request);
     }
     return $request->query->all();
 }