for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Cortex\Foundation\Overrides\Illuminate\Routing;
use Illuminate\Routing\RouteUrlGenerator as BaseRouteUrlGenerator;
class RouteUrlGenerator extends BaseRouteUrlGenerator
{
/**
* Add a query string to the URI.
*
* @param string $uri
* @param array $parameters
* @return mixed|string
string
This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.
array
*/
protected function addQueryString($uri, array $parameters)
// If the URI has a fragment we will move it to the end of this URI since it will
// need to come after any query string that may be added to the URL else it is
// not going to be available. We will remove it then append it back on here.
if (! is_null($fragment = parse_url($uri, PHP_URL_FRAGMENT))) {
$uri = preg_replace('/#.*/', '', $uri);
}
$uri .= '/'.$this->getRouteQueryString($parameters);
return is_null($fragment) ? $uri : $uri."#{$fragment}";
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.