Skip to content

Commit

Permalink
fix parameter type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
m-vo committed Jul 9, 2020
1 parent 013cbab commit 40272d1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core-bundle/src/Resources/contao/library/Contao/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ public static function get($strKey)
/**
* Temporarily set a configuration value
*
* @param string $strKey The short key
* @param string $varValue The configuration value
* @param string $strKey The short key
* @param mixed|null $varValue The configuration value
*/
public static function set($strKey, $varValue)
{
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/src/Resources/contao/library/Contao/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function getImportantPart()
/**
* Set the target height
*
* @param integer $targetHeight The target height
* @param integer|float $targetHeight The target height
*
* @return $this The image object
*/
Expand All @@ -251,7 +251,7 @@ public function getTargetHeight()
/**
* Set the target width
*
* @param integer $targetWidth The target width
* @param integer|float $targetWidth The target width
*
* @return $this The image object
*/
Expand Down
4 changes: 2 additions & 2 deletions core-bundle/src/Resources/contao/library/Contao/Picture.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Picture
/**
* The image size items collection
*
* @var ImageSizeItemModel[]|Collection
* @var array<ImageSizeItemModel|object>|Collection
*/
protected $imageSizeItems = array();

Expand Down Expand Up @@ -194,7 +194,7 @@ public function setImageSize($imageSize)
/**
* Set the image size items collection
*
* @param ImageSizeItemModel[]|Collection $imageSizeItems The image size items collection
* @param array<ImageSizeItemModel|object>|Collection $imageSizeItems The image size items collection
*
* @return $this The picture object
*/
Expand Down
6 changes: 3 additions & 3 deletions core-bundle/src/Resources/contao/library/Contao/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ public static function getReferer($blnEncodeAmpersands=false, $strTable=null)
/**
* Load a set of language files
*
* @param string $strName The table name
* @param boolean $strLanguage An optional language code
* @param boolean $blnNoCache If true, the cache will be bypassed
* @param string $strName The table name
* @param string|null $strLanguage An optional language code
* @param boolean $blnNoCache If true, the cache will be bypassed
*/
public static function loadLanguageFile($strName, $strLanguage=null, $blnNoCache=false)
{
Expand Down
8 changes: 5 additions & 3 deletions core-bundle/src/Routing/RouteProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\CoreBundle\Exception\NoRootPageFoundException;
use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\Model;
use Contao\Model\Collection;
use Contao\PageModel;
use Contao\System;
Expand Down Expand Up @@ -458,7 +457,7 @@ static function (Route $a, Route $b) use ($languages, $routes) {
}

/**
* @return array<Model>
* @return array<PageModel>
*/
private function findPages(array $candidates): array
{
Expand Down Expand Up @@ -491,11 +490,12 @@ private function findPages(array $candidates): array
return [];
}

/** @var array<PageModel> */
return $pages->getModels();
}

/**
* @return array<Model>
* @return array<PageModel>
*/
private function findRootPages(string $httpHost): array
{
Expand Down Expand Up @@ -523,12 +523,14 @@ private function findRootPages(string $httpHost): array
$pages = $pageModel->findBy(["(tl_page.type='root' AND (tl_page.dns=? OR tl_page.dns=''))"], $httpHost);

if ($pages instanceof Collection) {
/** @var array<PageModel> $rootPages */
$rootPages = $pages->getModels();
}

$pages = $pageModel->findBy(["tl_page.alias='index' OR tl_page.alias='/'"], null);

if ($pages instanceof Collection) {
/** @var array<PageModel> $indexPages */
$indexPages = $pages->getModels();
}

Expand Down

0 comments on commit 40272d1

Please sign in to comment.