Skip to content

Commit

Permalink
Adding types/access visibility to const/methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pH-7 committed Jun 27, 2022
1 parent 619ac1b commit 2b1bbe6
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions _protected/app/system/modules/map/controllers/CountryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@

class CountryController extends Controller
{
const MAP_ZOOM_LEVEL = 12;
const MAP_WIDTH_SIZE = '100%';
const MAP_HEIGHT_SIZE = '520px';
private const MAP_ZOOM_LEVEL = 12;
private const MAP_WIDTH_SIZE = '100%';
private const MAP_HEIGHT_SIZE = '520px';

const MAX_PROFILES_PER_PAGE = 20;
private const MAX_PROFILES_PER_PAGE = 20;

/**
* @param string|null $sCountry
* @param string|null $sCity
*
* @throws Framework\Http\Exception
*/
public function index($sCountry = null, $sCity = null)
public function index(?string $sCountry = null, ?string $sCity = null): void
{
if ($sCountry !== null) {
$this->registry->country = $this->getCountry($sCountry);
Expand Down Expand Up @@ -70,10 +67,7 @@ public function index($sCountry = null, $sCity = null)
$this->output();
}

/**
* @return string
*/
private function getCountryCode()
private function getCountryCode(): string
{
$sCountryCode = CArray::getKeyByValueIgnoreCase($this->registry->country, $this->registry->lang);

Expand All @@ -90,12 +84,8 @@ private function getCountryCode()

/**
* Assign SEO meta tags to the template.
*
* @param int $iTotalUsers
*
* @return void
*/
private function setMetaTags($iTotalUsers)
private function setMetaTags(int $iTotalUsers): void
{
$this->view->page_title = t('Free online dating in %0% %1%, meet people, find friends. Single men & women in %2% %3%', $this->registry->country, $this->registry->city, $this->registry->country, $this->registry->city);
$this->view->meta_description = t('Free online dating in %0% with single women & men. Personals, meet people & find friends in %1% on internet dating site. Find sweet love or sex dating and flirt in %2%, %3% with %site_name%', $this->registry->country, $this->registry->country, $this->registry->country, $this->registry->city);
Expand All @@ -107,10 +97,8 @@ private function setMetaTags($iTotalUsers)

/**
* Set the map to the view.
*
* @return void
*/
private function setMap()
private function setMap(): void
{
$sFullAddress = $this->registry->country . ' ' . $this->registry->city;
$sMarkerText = t('Meet new people here thanks to <b>%site_name%</b>!');
Expand All @@ -134,12 +122,8 @@ private function setMap()

/**
* Gives the country name limited to 50 chars and removes dashes automatically added from the URL.
*
* @param string $sCountry
*
* @return string
*/
private function getCountry($sCountry)
private function getCountry(string $sCountry): string
{
return str_replace(
'-',
Expand All @@ -150,12 +134,8 @@ private function getCountry($sCountry)

/**
* Gives the city name limited to 50 chars and removes dashes automatically added from the URL.
*
* @param string $sCity
*
* @return string
*/
private function getCity($sCity)
private function getCity(string $sCity): string
{
return str_replace(
'-',
Expand All @@ -166,10 +146,8 @@ private function getCity($sCity)

/**
* Add the stylesheet for the tooltips on the page.
*
* @return void
*/
private function addTooltipCssFile()
private function addTooltipCssFile(): void
{
$this->design->addCss(
PH7_LAYOUT . PH7_TPL . PH7_TPL_NAME . PH7_SH . PH7_CSS,
Expand Down

0 comments on commit 2b1bbe6

Please sign in to comment.