Skip to content

Commit

Permalink
Merge pull request #3382 from acrobat/return-types
Browse files Browse the repository at this point in the history
[AllBundles] Convert extra phpdoc return types
  • Loading branch information
acrobat authored Apr 1, 2024
2 parents 54f3ccc + 75b7c27 commit 1e8c0d4
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 40 deletions.
10 changes: 2 additions & 8 deletions src/Kunstmaan/AdminBundle/Form/MediaTokenTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

class MediaTokenTransformer implements DataTransformerInterface
{
/**
* @return string
*/
public function transform($content)
public function transform($content): string
{
if ($content === null || !$content || !trim($content)) {
return '';
Expand Down Expand Up @@ -38,10 +35,7 @@ function (Crawler $node) {
}
}

/**
* @return string
*/
public function reverseTransform($content)
public function reverseTransform($content): string
{
if ($content === null || !trim($content)) {
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRet
$this->permissionsEnabled = $permissionsEnabled;
}

/**
* @return int
*/
public function vote(TokenInterface $token, $object, array $attributes)
public function vote(TokenInterface $token, $object, array $attributes): int
{
$attributeIsSupported = false;
foreach ($attributes as $attribute) {
Expand Down
5 changes: 1 addition & 4 deletions src/Kunstmaan/ArticleBundle/Router/TagCategoryRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@

class TagCategoryRouter extends SlugRouter
{
/**
* @return \Symfony\Component\Routing\RouteCollection
*/
public function getRouteCollection()
public function getRouteCollection(): RouteCollection
{
if (!\is_null($this->routeCollection)) {
return $this->routeCollection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,8 @@ private function getReverseLocaleMap(): array
* Getter for routeCollection
*
* Override slug router
*
* @return \Symfony\Component\Routing\RouteCollection
*/
public function getRouteCollection()
public function getRouteCollection(): RouteCollection
{
if (($this->otherSite && $this->isMultiLanguage($this->otherSite['host'])) || (!$this->otherSite && $this->isMultiLanguage())) {
if (!$this->routeCollectionMultiLanguage) {
Expand Down
12 changes: 2 additions & 10 deletions src/Kunstmaan/NodeBundle/Router/SlugRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ public function getContext(): RequestContext
return $this->context;
}

/**
* @return void
*/
public function setContext(RequestContext $context)
public function setContext(RequestContext $context): void
{
$this->context = $context;
}
Expand All @@ -131,12 +128,7 @@ public function generate($name, $parameters = [], $referenceType = UrlGenerator:
return $this->urlGenerator->generate($name, $parameters, $referenceType);
}

/**
* Getter for routeCollection
*
* @return \Symfony\Component\Routing\RouteCollection
*/
public function getRouteCollection()
public function getRouteCollection(): RouteCollection
{
if (\is_null($this->routeCollection)) {
$this->routeCollection = new RouteCollection();
Expand Down
9 changes: 2 additions & 7 deletions src/Kunstmaan/RedirectBundle/Router/RedirectRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ public function match($pathinfo): array

/**
* Gets the RouteCollection instance associated with this Router.
*
* @return \Symfony\Component\Routing\RouteCollection A RouteCollection instance
*/
public function getRouteCollection()
public function getRouteCollection(): RouteCollection
{
// The route collection will always be populated with matched redirects based on the current request. If this
// method is called before the url matching has been executed, the collection will be empty.
Expand All @@ -103,10 +101,7 @@ public function getContext(): RequestContext
return $this->context;
}

/**
* @return void
*/
public function setContext(RequestContext $context)
public function setContext(RequestContext $context): void
{
$this->context = $context;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ public function addResources($resources)
}
}

/**
* @return void
*/
protected function loadCatalogue($locale)
protected function loadCatalogue($locale): void
{
if ($this->options['debug'] === true) {
$this->options['cache_dir'] = null; // disable caching for debug
Expand Down

0 comments on commit 1e8c0d4

Please sign in to comment.