Skip to content

Commit

Permalink
Fix redundant type casts
Browse files Browse the repository at this point in the history
  • Loading branch information
fancyweb committed Nov 25, 2021
1 parent be6cf3b commit e724d5a
Show file tree
Hide file tree
Showing 23 changed files with 84 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function setUp(): void

protected function renderForm(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form', $vars);
return $this->renderer->renderBlock($view, 'form', $vars);
}

protected function renderLabel(FormView $view, $label = null, array $vars = [])
Expand All @@ -66,42 +66,42 @@ protected function renderLabel(FormView $view, $label = null, array $vars = [])
$vars += ['label' => $label];
}

return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars);
return $this->renderer->searchAndRenderBlock($view, 'label', $vars);
}

protected function renderHelp(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'help');
return $this->renderer->searchAndRenderBlock($view, 'help');
}

protected function renderErrors(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'errors');
return $this->renderer->searchAndRenderBlock($view, 'errors');
}

protected function renderWidget(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
return $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
}

protected function renderRow(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars);
return $this->renderer->searchAndRenderBlock($view, 'row', $vars);
}

protected function renderRest(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
return $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
}

protected function renderStart(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_start', $vars);
return $this->renderer->renderBlock($view, 'form_start', $vars);
}

protected function renderEnd(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_end', $vars);
return $this->renderer->renderBlock($view, 'form_end', $vars);
}

protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testMoneyWidgetInIso()

protected function renderForm(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form', $vars);
return $this->renderer->renderBlock($view, 'form', $vars);
}

protected function renderLabel(FormView $view, $label = null, array $vars = [])
Expand All @@ -116,42 +116,42 @@ protected function renderLabel(FormView $view, $label = null, array $vars = [])
$vars += ['label' => $label];
}

return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars);
return $this->renderer->searchAndRenderBlock($view, 'label', $vars);
}

protected function renderHelp(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'help');
return $this->renderer->searchAndRenderBlock($view, 'help');
}

protected function renderErrors(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'errors');
return $this->renderer->searchAndRenderBlock($view, 'errors');
}

protected function renderWidget(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
return $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
}

protected function renderRow(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars);
return $this->renderer->searchAndRenderBlock($view, 'row', $vars);
}

protected function renderRest(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
return $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
}

protected function renderStart(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_start', $vars);
return $this->renderer->renderBlock($view, 'form_start', $vars);
}

protected function renderEnd(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_end', $vars);
return $this->renderer->renderBlock($view, 'form_end', $vars);
}

protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function setUp(): void

protected function renderForm(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form', $vars);
return $this->renderer->renderBlock($view, 'form', $vars);
}

protected function renderLabel(FormView $view, $label = null, array $vars = [])
Expand All @@ -68,42 +68,42 @@ protected function renderLabel(FormView $view, $label = null, array $vars = [])
$vars += ['label' => $label];
}

return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars);
return $this->renderer->searchAndRenderBlock($view, 'label', $vars);
}

protected function renderHelp(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'help');
return $this->renderer->searchAndRenderBlock($view, 'help');
}

protected function renderErrors(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'errors');
return $this->renderer->searchAndRenderBlock($view, 'errors');
}

protected function renderWidget(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
return $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
}

protected function renderRow(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars);
return $this->renderer->searchAndRenderBlock($view, 'row', $vars);
}

protected function renderRest(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
return $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
}

protected function renderStart(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_start', $vars);
return $this->renderer->renderBlock($view, 'form_start', $vars);
}

protected function renderEnd(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_end', $vars);
return $this->renderer->renderBlock($view, 'form_end', $vars);
}

protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function testMoneyWidgetInIso()

protected function renderForm(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form', $vars);
return $this->renderer->renderBlock($view, 'form', $vars);
}

protected function renderLabel(FormView $view, $label = null, array $vars = [])
Expand All @@ -120,42 +120,42 @@ protected function renderLabel(FormView $view, $label = null, array $vars = [])
$vars += ['label' => $label];
}

return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars);
return $this->renderer->searchAndRenderBlock($view, 'label', $vars);
}

protected function renderHelp(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'help');
return $this->renderer->searchAndRenderBlock($view, 'help');
}

protected function renderErrors(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'errors');
return $this->renderer->searchAndRenderBlock($view, 'errors');
}

protected function renderWidget(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
return $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
}

protected function renderRow(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars);
return $this->renderer->searchAndRenderBlock($view, 'row', $vars);
}

protected function renderRest(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
return $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
}

protected function renderStart(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_start', $vars);
return $this->renderer->renderBlock($view, 'form_start', $vars);
}

protected function renderEnd(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_end', $vars);
return $this->renderer->renderBlock($view, 'form_end', $vars);
}

protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public function testHelpHtmlIsTrue()

protected function renderForm(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form', $vars);
return $this->renderer->renderBlock($view, 'form', $vars);
}

protected function renderLabel(FormView $view, $label = null, array $vars = [])
Expand All @@ -307,42 +307,42 @@ protected function renderLabel(FormView $view, $label = null, array $vars = [])
$vars += ['label' => $label];
}

return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars);
return $this->renderer->searchAndRenderBlock($view, 'label', $vars);
}

protected function renderHelp(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'help');
return $this->renderer->searchAndRenderBlock($view, 'help');
}

protected function renderErrors(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'errors');
return $this->renderer->searchAndRenderBlock($view, 'errors');
}

protected function renderWidget(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
return $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
}

protected function renderRow(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars);
return $this->renderer->searchAndRenderBlock($view, 'row', $vars);
}

protected function renderRest(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
return $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
}

protected function renderStart(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_start', $vars);
return $this->renderer->renderBlock($view, 'form_start', $vars);
}

protected function renderEnd(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_end', $vars);
return $this->renderer->renderBlock($view, 'form_end', $vars);
}

protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function testHelpHtmlIsTrue()

protected function renderForm(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form', $vars);
return $this->renderer->renderBlock($view, 'form', $vars);
}

protected function renderLabel(FormView $view, $label = null, array $vars = [])
Expand All @@ -193,42 +193,42 @@ protected function renderLabel(FormView $view, $label = null, array $vars = [])
$vars += ['label' => $label];
}

return (string) $this->renderer->searchAndRenderBlock($view, 'label', $vars);
return $this->renderer->searchAndRenderBlock($view, 'label', $vars);
}

protected function renderHelp(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'help');
return $this->renderer->searchAndRenderBlock($view, 'help');
}

protected function renderErrors(FormView $view)
{
return (string) $this->renderer->searchAndRenderBlock($view, 'errors');
return $this->renderer->searchAndRenderBlock($view, 'errors');
}

protected function renderWidget(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
return $this->renderer->searchAndRenderBlock($view, 'widget', $vars);
}

protected function renderRow(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'row', $vars);
return $this->renderer->searchAndRenderBlock($view, 'row', $vars);
}

protected function renderRest(FormView $view, array $vars = [])
{
return (string) $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
return $this->renderer->searchAndRenderBlock($view, 'rest', $vars);
}

protected function renderStart(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_start', $vars);
return $this->renderer->renderBlock($view, 'form_start', $vars);
}

protected function renderEnd(FormView $view, array $vars = [])
{
return (string) $this->renderer->renderBlock($view, 'form_end', $vars);
return $this->renderer->renderBlock($view, 'form_end', $vars);
}

protected function setTheme(FormView $view, array $themes, $useDefaultThemes = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testThatRenderLogsTime()
$container = $this->createMock(Container::class);
$templateNameParser = $this->getTemplateNameParser();
$globalVariables = $this->getGlobalVariables();
$loader = $this->getLoader($this->getStorage());
$loader = $this->getLoader(new StringStorage('foo'));

$stopwatch = new Stopwatch();

Expand Down Expand Up @@ -60,17 +60,7 @@ private function getGlobalVariables(): GlobalVariables
return $this->createMock(GlobalVariables::class);
}

private function getStorage(): StringStorage
{
return $this->getMockBuilder(StringStorage::class)
->disableOriginalConstructor()
->getMockForAbstractClass();
}

/**
* @param StringStorage $storage
*/
private function getLoader($storage): Loader
private function getLoader(StringStorage $storage): Loader
{
$loader = $this->getMockForAbstractClass(Loader::class);
$loader->expects($this->once())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ private function createExpression(ContainerBuilder $container, string $expressio
private function createRequestMatcher(ContainerBuilder $container, string $path = null, string $host = null, int $port = null, array $methods = [], array $ips = null, array $attributes = []): Reference
{
if ($methods) {
$methods = array_map('strtoupper', (array) $methods);
$methods = array_map('strtoupper', $methods);
}

if (null !== $ips) {
Expand Down
Loading

0 comments on commit e724d5a

Please sign in to comment.