Skip to content

Commit

Permalink
Merge pull request Sylius#9540 from pamil/1.1-phpstan-fixes
Browse files Browse the repository at this point in the history
PHPStan 0.10 upgrade & road to level 2 checks
  • Loading branch information
pamil authored Jul 3, 2018
2 parents 69c8941 + f0a8921 commit 7757de9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Form/Type/ThemeChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function configureOptions(OptionsResolver $resolver): void
return $this->themeRepository->findAll();
},
'choice_label' => function (ThemeInterface $theme): string {
return (string) $theme;
return $theme->getTitle() ?: $theme->getName();
},
]);
}
Expand Down
2 changes: 1 addition & 1 deletion Form/Type/ThemeNameChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function configureOptions(OptionsResolver $resolver): void

$choices = [];
foreach ($themes as $theme) {
$choices[(string) $theme] = $theme->getName();
$choices[$theme->getTitle() ?: $theme->getName()] = $theme->getName();
}

return $choices;
Expand Down
3 changes: 1 addition & 2 deletions Tests/Functional/TestBundle/Listener/RequestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
namespace Sylius\Bundle\ThemeBundle\Tests\Functional\TestBundle\Listener;

use Sylius\Bundle\ThemeBundle\Context\SettableThemeContext;
use Sylius\Bundle\ThemeBundle\Context\ThemeContextInterface;
use Sylius\Bundle\ThemeBundle\Repository\ThemeRepositoryInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
Expand All @@ -27,7 +26,7 @@ final class RequestListener
private $themeRepository;

/**
* @var ThemeContextInterface
* @var SettableThemeContext
*/
private $themeContext;

Expand Down
4 changes: 3 additions & 1 deletion Twig/ThemeFilesystemLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ private function findTemplate(string $logicalName): string
}

$template = $this->templateNameParser->parse($logicalName);

/** @var string $file */
$file = $this->templateLocator->locate($template);

return (string) $this->cache[$logicalName] = $file;
return $this->cache[$logicalName] = $file;
}
}

0 comments on commit 7757de9

Please sign in to comment.