for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the PostmanGeneratorBundle package.
*
* (c) Vincent Chalamon <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PostmanGeneratorBundle\RequestParser;
use PostmanGeneratorBundle\Model\Request;
class UriRequestParser implements RequestParserInterface
{
const PATTERN = '/\/({id})$/';
/**
* {@inheritdoc}
public function parse(Request $request)
$request->setUrl(preg_replace(self::PATTERN, '/1', $request->getUrl()));
}
public function supports(Request $request)
return 1 === preg_match(self::PATTERN, $request->getUrl());