summaryrefslogtreecommitdiff
path: root/app/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'app/frontend')
-rw-r--r--app/frontend/components/FileUploadSecureOption.php2
-rw-r--r--app/frontend/controls/AddToFilter.php4
-rw-r--r--app/frontend/controls/CalendarGrid.php4
-rw-r--r--app/frontend/controls/EventList.php6
-rw-r--r--app/frontend/controls/EventRepeater.php2
-rw-r--r--app/frontend/controls/TimezoneSelect.php2
-rw-r--r--app/frontend/db/ActiveRecord.php4
-rw-r--r--app/frontend/dto/CalendarGridDTO.php2
-rw-r--r--app/frontend/dto/CalendarGroupDTO.php4
-rw-r--r--app/frontend/dto/EventDTO.php2
-rw-r--r--app/frontend/events/EventModule.php4
-rw-r--r--app/frontend/facades/CalendarFacade.php10
-rw-r--r--app/frontend/facades/EventFacade.php6
-rw-r--r--app/frontend/facades/Facade.php10
-rw-r--r--app/frontend/i18n/DbGlobalization.php2
-rw-r--r--app/frontend/i18n/Globalization.php4
-rw-r--r--app/frontend/mail/MailModule.php12
-rw-r--r--app/frontend/mail/Mailer.php2
-rw-r--r--app/frontend/model/Calendar.php6
-rw-r--r--app/frontend/url/UrlManager.php12
-rw-r--r--app/frontend/user/DbUser.php2
-rw-r--r--app/frontend/web/ClientScriptManager.php32
-rw-r--r--app/frontend/web/TemplateControl.php10
23 files changed, 75 insertions, 69 deletions
diff --git a/app/frontend/components/FileUploadSecureOption.php b/app/frontend/components/FileUploadSecureOption.php
index 3550e21..ae79720 100644
--- a/app/frontend/components/FileUploadSecureOption.php
+++ b/app/frontend/components/FileUploadSecureOption.php
@@ -9,7 +9,7 @@ trait FileUploadSecureOption {
}
public function setIsSecure($bool) {
- $this->_isSecure = $bool;
+ $this->_isSecure = TPropertyValue::ensureBoolean($bool);
}
}
diff --git a/app/frontend/controls/AddToFilter.php b/app/frontend/controls/AddToFilter.php
index 9146f3b..0cc56fc 100644
--- a/app/frontend/controls/AddToFilter.php
+++ b/app/frontend/controls/AddToFilter.php
@@ -2,6 +2,8 @@
Prado::using('System.Web.UI.ActiveControls.TActiveCheckBox');
+Prado::using('Application.user.DbUser');
+
class AddToFilter extends UrlBasedCalendarControl {
public function setDescription($val) {
@@ -28,7 +30,7 @@ class AddToFilter extends UrlBasedCalendarControl {
return $this->getControlState('user');
}
- public function setUserToManage($user) {
+ public function setUserToManage(DbUser $user) {
$this->setControlState('user', $user);
}
diff --git a/app/frontend/controls/CalendarGrid.php b/app/frontend/controls/CalendarGrid.php
index b168379..ddd17f2 100644
--- a/app/frontend/controls/CalendarGrid.php
+++ b/app/frontend/controls/CalendarGrid.php
@@ -7,7 +7,7 @@ Prado::using('Application.user.DbUser');
class CalendarGrid extends FacadeTemplateControl {
public function setMonth($month) {
- $this->setControlState('Month', $month);
+ $this->setControlState('Month', TPropertyValue::ensureInteger($month));
}
public function getMonth() {
@@ -15,7 +15,7 @@ class CalendarGrid extends FacadeTemplateControl {
}
public function setYear($year) {
- $this->setControlState('Year', $year);
+ $this->setControlState('Year', TPropertyValue::ensureInteger($year));
}
public function getYear() {
diff --git a/app/frontend/controls/EventList.php b/app/frontend/controls/EventList.php
index d40e000..ea6150b 100644
--- a/app/frontend/controls/EventList.php
+++ b/app/frontend/controls/EventList.php
@@ -2,7 +2,7 @@
class EventList extends UrlBasedCalendarControl {
- private function _setDate($key, $date) {
+ private function _setDate(string $key, string $date) {
$datetime = new DateTime($date, new DateTimeZone('UTC'));
if (!$datetime) {
throw new TInvalidDataValueException(
@@ -14,7 +14,7 @@ class EventList extends UrlBasedCalendarControl {
}
public function setDateFrom($date) {
- $this->_setDate('DateFrom', $date);
+ $this->_setDate('DateFrom', TPropertyValue::ensureString($date));
}
public function getDateFrom() {
@@ -22,7 +22,7 @@ class EventList extends UrlBasedCalendarControl {
}
public function setDateTo($date) {
- $this->_setDate('DateTo', $date);
+ $this->_setDate('DateTo', TPropertyValue::ensureString($date));
}
public function getDateTo() {
diff --git a/app/frontend/controls/EventRepeater.php b/app/frontend/controls/EventRepeater.php
index 4fb2812..94fec2c 100644
--- a/app/frontend/controls/EventRepeater.php
+++ b/app/frontend/controls/EventRepeater.php
@@ -4,7 +4,7 @@ Prado::using('Application.web.TemplateControl');
class EventRepeater extends TemplateControl {
- public function setEvents($events) {
+ public function setEvents(array $events) {
$this->Events->DataSource = $events;
$this->Events->dataBind();
}
diff --git a/app/frontend/controls/TimezoneSelect.php b/app/frontend/controls/TimezoneSelect.php
index 25af453..5c198a4 100644
--- a/app/frontend/controls/TimezoneSelect.php
+++ b/app/frontend/controls/TimezoneSelect.php
@@ -44,7 +44,7 @@ class TimezoneSelect extends FacadeTemplateControl {
private function _getTimezones() {
$timezones = array_map(
- function($tz) {
+ function(string $tz) {
return new TimezoneDTO($tz);
},
DateTimeZone::listIdentifiers()
diff --git a/app/frontend/db/ActiveRecord.php b/app/frontend/db/ActiveRecord.php
index 31f87f5..45469dc 100644
--- a/app/frontend/db/ActiveRecord.php
+++ b/app/frontend/db/ActiveRecord.php
@@ -2,7 +2,7 @@
class ActiveRecord extends TActiveRecord {
- private function _getMappedPropertyName($name) {
+ private function _getMappedPropertyName(string $name) {
if (isset(static::$COLUMN_MAPPING[$name])) {
return static::$COLUMN_MAPPING[$name];
}
@@ -16,7 +16,7 @@ class ActiveRecord extends TActiveRecord {
'deleteallby'
];
- private function _getMappedMethodName($method) {
+ private function _getMappedMethodName(string $method) {
if (static::$COLUMN_MAPPING) {
$methodParts = [];
if (preg_match('/^(' . implode('|', self::DYNAMIC_METHODS) . ')(.*)$/i', $method, $methodParts)) {
diff --git a/app/frontend/dto/CalendarGridDTO.php b/app/frontend/dto/CalendarGridDTO.php
index c6f1d00..c9a5bf3 100644
--- a/app/frontend/dto/CalendarGridDTO.php
+++ b/app/frontend/dto/CalendarGridDTO.php
@@ -9,7 +9,7 @@ class CalendarGridDTO {
public $DateTo;
public $Weeks = [];
- public function __construct($events, DateTime $dateFrom, DateTime $dateTo) {
+ public function __construct(array $events, DateTime $dateFrom, DateTime $dateTo) {
$this->DateFrom = DateTimeImmutable::createFromMutable($dateFrom);
$this->DateTo = DateTimeImmutable::createFromMutable($dateTo);
$date = $this->DateFrom;
diff --git a/app/frontend/dto/CalendarGroupDTO.php b/app/frontend/dto/CalendarGroupDTO.php
index a607826..cba1623 100644
--- a/app/frontend/dto/CalendarGroupDTO.php
+++ b/app/frontend/dto/CalendarGroupDTO.php
@@ -19,14 +19,14 @@ class CalendarGroupDTO extends BaseDTO {
$this->ID = $categoryRecord->ID;
$this->Priority = $categoryRecord->Priority;
$this->Calendars = array_map(
- function($calendarRecord) {
+ function(Calendar $calendarRecord) {
$dto = new CalendarDTO();
$dto->loadRecord($calendarRecord);
return $dto;
},
array_filter(
$calendars,
- function($calendarRecord) use($categoryRecord) {
+ function(Calendar $calendarRecord) use($categoryRecord) {
return $categoryRecord->ID == $calendarRecord->CategoryID;
}
)
diff --git a/app/frontend/dto/EventDTO.php b/app/frontend/dto/EventDTO.php
index 9af06e4..13262bb 100644
--- a/app/frontend/dto/EventDTO.php
+++ b/app/frontend/dto/EventDTO.php
@@ -67,7 +67,7 @@ class EventDTO extends BaseDTO {
$calendars = array_filter(
$calendars,
- function ($calendar) use($event) {
+ function (Calendar $calendar) use($event) {
return $calendar->UID == $event->CalendarID;
}
);
diff --git a/app/frontend/events/EventModule.php b/app/frontend/events/EventModule.php
index 6474523..3555510 100644
--- a/app/frontend/events/EventModule.php
+++ b/app/frontend/events/EventModule.php
@@ -33,14 +33,14 @@ class EventModule extends TModule {
}
protected static $_handlers = [];
- private function _registerEventHandler($event, $handler) {
+ private function _registerEventHandler(string $event, callable $handler) {
if (!isset(self::$_handlers[$event])) {
self::$_handlers[$event] = [];
}
self::$_handlers[$event][] = $handler;
}
- public function raiseApplicationEvent($event, ...$params) {
+ public function raiseApplicationEvent(string $event, ...$params) {
if (isset(self::$_handlers[$event])) {
foreach (self::$_handlers[$event] as $handler) {
call_user_func_array($handler, $params);
diff --git a/app/frontend/facades/CalendarFacade.php b/app/frontend/facades/CalendarFacade.php
index 5a68f0a..3b4ec7e 100644
--- a/app/frontend/facades/CalendarFacade.php
+++ b/app/frontend/facades/CalendarFacade.php
@@ -15,7 +15,7 @@ class CalendarFacade extends Facade {
private function _getCategoriesForCalendars(array $calendars) {
return Category::finder()->findAllByPks(
array_map(
- function($calendar) {
+ function(Calendar $calendar) {
return $calendar->CategoryID;
},
$calendars
@@ -43,7 +43,7 @@ class CalendarFacade extends Facade {
$calendars = $this->getCalendarPreference($user);
if ($calendars) {
$categories = array_map(
- function($category) use($calendars) {
+ function(Category $category) use($calendars) {
$dto = new CalendarGroupDTO();
$dto->loadRecord($category, $calendars);
return $dto;
@@ -60,7 +60,7 @@ class CalendarFacade extends Facade {
return in_array(
$calendarID,
array_map(
- function($calendar) {
+ function(Calendar $calendar) {
return $calendar->UID;
},
$this->getCalendarPreference($user)
@@ -124,7 +124,7 @@ class CalendarFacade extends Facade {
$order
);
return array_map(
- function($event) use($calendar) {
+ function(Entry $event) use($calendar) {
$dto = new EventDTO();
$dto->loadRecord($event, $calendar);
return $dto;
@@ -145,7 +145,7 @@ class CalendarFacade extends Facade {
public function getCategories() {
$categories = array_map(
- function($record) {
+ function(Category $record) {
$dto = new CalendarGroupDTO();
$dto->loadRecord($record, []);
return $dto;
diff --git a/app/frontend/facades/EventFacade.php b/app/frontend/facades/EventFacade.php
index 79ca363..454f522 100644
--- a/app/frontend/facades/EventFacade.php
+++ b/app/frontend/facades/EventFacade.php
@@ -21,7 +21,7 @@ class EventFacade extends Facade {
implode(
',',
array_map(
- function($calendar) {
+ function(Calendar $calendar) {
return $this->quoteString($calendar->UID);
},
$calendars
@@ -44,7 +44,7 @@ class EventFacade extends Facade {
TimezoneDTO $tz,
string $class = 'Application.dto.EventDTO') {
return array_map(
- function($event) use($calendars, $class, $tz) {
+ function(Entry $event) use($calendars, $class, $tz) {
$dto = Prado::createComponent($class, $tz);
$dto->loadRecord($event, $calendars);
return $dto;
@@ -105,7 +105,7 @@ class EventFacade extends Facade {
if ($events) {
return Calendar::finder()->findAllByPks(
array_map(
- function($event) {
+ function(Entry $event) {
return $event->CalendarID;
},
$events
diff --git a/app/frontend/facades/Facade.php b/app/frontend/facades/Facade.php
index 346024a..8317822 100644
--- a/app/frontend/facades/Facade.php
+++ b/app/frontend/facades/Facade.php
@@ -31,19 +31,19 @@ class Facade {
return $this->_sqlMap;
}
- protected function quoteString($string) {
+ protected function quoteString(string $string) {
return $this->getClient()->DbConnection->quoteString($string);
}
- protected function fetch($sqlMap, $params) {
+ protected function fetch(string $sqlMap, array $params) {
return $this->getClient()->queryForObject($sqlMap, $params);
}
- protected function fetchList($sqlMap, $params) {
+ protected function fetchList(string $sqlMap, array $params) {
return $this->getClient()->queryForList($sqlMap, $params);
}
- protected function fetchMap($sqlMap, $params, $key, $value=NULL) {
+ protected function fetchMap(string $sqlMap, array $params, string $key, $value=NULL) {
return $this->getClient()->queryForMap($sqlMap, $params, $key, $value);
}
@@ -51,7 +51,7 @@ class Facade {
return $this->getClient()->DbConnection->beginTransaction();
}
- protected function raiseEvent($event, ...$params) {
+ protected function raiseEvent(string $event, ...$params) {
return Prado::getApplication()->getModule('events')->raiseApplicationEvent(
$event, ...$params
);
diff --git a/app/frontend/i18n/DbGlobalization.php b/app/frontend/i18n/DbGlobalization.php
index 4ab4b9e..6e35370 100644
--- a/app/frontend/i18n/DbGlobalization.php
+++ b/app/frontend/i18n/DbGlobalization.php
@@ -6,7 +6,7 @@ class DbGlobalization extends TModule {
private $_connection;
- public function setConnection($dbModule) {
+ public function setConnection(string $dbModule) {
$dbModule = $this->Application->getModule($dbModule);
if (!($dbModule instanceof TDataSourceConfig)) {
throw new TConfigurationException(
diff --git a/app/frontend/i18n/Globalization.php b/app/frontend/i18n/Globalization.php
index 5c0b25a..25294ce 100644
--- a/app/frontend/i18n/Globalization.php
+++ b/app/frontend/i18n/Globalization.php
@@ -50,7 +50,7 @@ class Globalization extends TGlobalization {
return $culture;
}
- private function _getNeutralCulture($culture) {
+ private function _getNeutralCulture(string $culture) {
return explode('_', $culture)[0];
}
@@ -64,7 +64,7 @@ class Globalization extends TGlobalization {
protected $_allowedCultures = [];
- public function setAllowedCultures($cultures) {
+ public function setAllowedCultures(string $cultures) {
$this->_allowedCultures = array_map('trim', explode(',', $cultures));
}
diff --git a/app/frontend/mail/MailModule.php b/app/frontend/mail/MailModule.php
index e10c556..464f1d0 100644
--- a/app/frontend/mail/MailModule.php
+++ b/app/frontend/mail/MailModule.php
@@ -15,7 +15,7 @@ class MailModule extends TModule {
private $_templateCacheSubpath = 'mail';
private static $_templateTranslationCatalogue = 'messages';
- public function setConfigPath($configPath) {
+ public function setConfigPath(string $configPath) {
$this->_configPath = TPropertyValue::ensureString($configPath);
$this->_config = json_decode(
file_get_contents(
@@ -24,7 +24,7 @@ class MailModule extends TModule {
);
}
- public function setTemplatePath($templatePath) {
+ public function setTemplatePath(string $templatePath) {
$this->_templatePath = Prado::getPathOfNamespace(
TPropertyValue::ensureString($templatePath)
);
@@ -42,7 +42,7 @@ class MailModule extends TModule {
return $this->_templatePath;
}
- public function setCachePath($cachePath) {
+ public function setCachePath(string $cachePath) {
$this->templateCacheSubpath = TPropertyValue::ensureString($cachePath);
}
@@ -65,7 +65,7 @@ class MailModule extends TModule {
return $cachePath;
}
- public function setTemplateExtension($ext) {
+ public function setTemplateExtension(string $ext) {
self::$_templateExtension = TPropertyValue::ensureString($ext);
}
@@ -73,7 +73,7 @@ class MailModule extends TModule {
return self::$_templateExtension;
}
- public function setTranslationCatalogue($ext) {
+ public function setTranslationCatalogue(string $ext) {
self::$_templateTranslationCatalogue = TPropertyValue::ensureString($ext);
}
@@ -92,7 +92,7 @@ class MailModule extends TModule {
return self::$_translator;
}
- public function getTemplate($template, $language=NULL) {
+ public function getTemplate(string $template, string $language='') {
$template = new MailTemplate($template . '.' . $this->TemplateExtension);
$template->setOutputMode(PHPTAL::HTML5);
$template->setTemplateRepository($this->_templatePath);
diff --git a/app/frontend/mail/Mailer.php b/app/frontend/mail/Mailer.php
index 327c9af..3b95568 100644
--- a/app/frontend/mail/Mailer.php
+++ b/app/frontend/mail/Mailer.php
@@ -24,7 +24,7 @@ class Mailer extends PHPMailer {
}
}
- public function sendTemplate(MailTemplate $template, $subject, $to, $name) {
+ public function sendTemplate(MailTemplate $template, string $subject, string $to, string $name) {
$this->addAddress($to, $name);
$this->isHTML(TRUE);
$this->Subject = $subject;
diff --git a/app/frontend/model/Calendar.php b/app/frontend/model/Calendar.php
index 47197ef..813c168 100644
--- a/app/frontend/model/Calendar.php
+++ b/app/frontend/model/Calendar.php
@@ -59,7 +59,7 @@ class Calendar extends ActiveRecord {
}
}
- public function getCustomImagePath($forFile = NULL, $type = '') {
+ public function getCustomImagePath(string $forFile = '', string $type = '') {
$pathParts = [
Prado::getApplication()->getBasePath(),
self::CUSTOM_IMAGE_PATH
@@ -70,7 +70,7 @@ class Calendar extends ActiveRecord {
return implode(DIRECTORY_SEPARATOR, $pathParts);
}
- private function _getCustomImageHash($file, $type) {
+ private function _getCustomImageHash(string $file, string $type) {
$hash = md5($file . md5_file($file) . filemtime($file));
if ($type) {
$hash .= '.' . preg_replace('#^image/#', '', $type);
@@ -78,7 +78,7 @@ class Calendar extends ActiveRecord {
return $hash;
}
- public function saveData($data) {
+ public function saveData(array $data) {
$this->copyFrom($data);
return $this->save();
}
diff --git a/app/frontend/url/UrlManager.php b/app/frontend/url/UrlManager.php
index a33d98e..1310eaf 100644
--- a/app/frontend/url/UrlManager.php
+++ b/app/frontend/url/UrlManager.php
@@ -15,7 +15,9 @@ class UrlManager extends TUrlMapping {
return rtrim(
preg_replace(
'#^/' . $serviceParam . '#',
- '/' . $this->_convertServiceParam($serviceParam),
+ '/' . $this->_convertServiceParam(
+ TPropertyValue::ensureString($serviceParam)
+ ),
preg_replace('#^/' . $serviceID . '#', '', $url)
),
'/'
@@ -27,7 +29,9 @@ class UrlManager extends TUrlMapping {
if ($this->MatchingPattern) {
$serviceID = $this->MatchingPattern->ServiceID;
if (isset($params[$serviceID])) {
- $params[$serviceID] = $this->_parseServiceParam($params[$serviceID]);
+ $params[$serviceID] = $this->_parseServiceParam(
+ TPropertyValue::ensureString($params[$serviceID])
+ );
}
}
return $params;
@@ -36,7 +40,7 @@ class UrlManager extends TUrlMapping {
/**
* Convert service param from camelCase to hyphenated-form.
**/
- private function _convertServiceParam($param) {
+ private function _convertServiceParam(string $param = '') {
return implode(
'-',
array_map('mb_strtolower', array_filter(preg_split('/(?=[A-Z])/', $param)))
@@ -46,7 +50,7 @@ class UrlManager extends TUrlMapping {
/**
* Convert service param from hyphenated-form to camelCase.
**/
- private function _parseServiceParam($param) {
+ private function _parseServiceParam(string $param = '') {
return implode(
'',
array_map('ucfirst', explode('-', $param))
diff --git a/app/frontend/user/DbUser.php b/app/frontend/user/DbUser.php
index e398cb0..3fc9b80 100644
--- a/app/frontend/user/DbUser.php
+++ b/app/frontend/user/DbUser.php
@@ -21,7 +21,7 @@ class DbUser extends TDbUser {
private $_authKey;
- public function setAuthKey($key) {
+ public function setAuthKey(string $key) {
$this->_authKey = $key;
}
diff --git a/app/frontend/web/ClientScriptManager.php b/app/frontend/web/ClientScriptManager.php
index 223c6e2..fb8c9fe 100644
--- a/app/frontend/web/ClientScriptManager.php
+++ b/app/frontend/web/ClientScriptManager.php
@@ -21,7 +21,7 @@ class ClientScriptManager extends TClientScriptManager {
return array_combine(
$urls,
array_map(
- function($path) use($basePath) {
+ function(string $path) use($basePath) {
return $basePath . DIRECTORY_SEPARATOR . $path;
},
$urls
@@ -50,7 +50,7 @@ class ClientScriptManager extends TClientScriptManager {
}
// Cache path for a file of specified type
- private function _getCacheFilePath($path, $type) {
+ private function _getCacheFilePath(string $path, string $type) {
return $this->_getCachePath($type)
. DIRECTORY_SEPARATOR
. $path;
@@ -72,7 +72,7 @@ class ClientScriptManager extends TClientScriptManager {
// Storage (application cache) key for list of rendered assets of specified type
// Rendered[ASSET_TYPE].[VIEW_ID] (VIEW_ID as rendered in Layout hidden field)
- private function _getRenderedAssetsStoreKey($type) {
+ private function _getRenderedAssetsStoreKey(string $type) {
$template = $this->_page->Master;
if (!$template instanceof Layout) {
throw new TNotSupportedException(
@@ -104,19 +104,19 @@ class ClientScriptManager extends TClientScriptManager {
}
// Check cache file validity, comparing to source file set
- private function _isCacheValid($cacheFile, array $paths) {
+ private function _isCacheValid(string $cacheFile, array $paths) {
return file_exists($cacheFile)
&& (filemtime($cacheFile) >= $this->_getFileCollectionMTime($paths));
}
// Determine whether specific URL points to a local asset (i.e. existing on the filesystem)
- private function _isFileLocal($file) {
+ private function _isFileLocal(string $file) {
$basePath = $this->_getBasePath();
return file_exists($basePath . DIRECTORY_SEPARATOR . $file);
}
// Filter URL set to leave only local assets
- private function _determineLocalFiles($files) {
+ private function _determineLocalFiles(array $files) {
return array_filter(
$files, [$this, '_isFileLocal']
);
@@ -140,7 +140,7 @@ class ClientScriptManager extends TClientScriptManager {
}
// Store information on rendered scripts in application cache
- private function _appendRenderedScripts(array $newScripts, $compiledFileKey) {
+ private function _appendRenderedScripts(array $newScripts, string $compiledFileKey) {
$scripts = $this->_getRenderedScripts();
if (!isset($scripts[$compiledFileKey])) {
$scripts[$compiledFileKey] = [];
@@ -158,7 +158,7 @@ class ClientScriptManager extends TClientScriptManager {
}
// Compress JS file and return its content
- private function _getCompressedScript($path) {
+ private function _getCompressedScript(string $path) {
return trim(TJavaScript::JSMin(
file_get_contents($path)
));
@@ -209,7 +209,7 @@ class ClientScriptManager extends TClientScriptManager {
// Determine actual asset URL that a source JS file was rendered as (after compilation/compression)
// FALSE means script wasn't rendered at all (i.e. was just registered in current callback)
- private function _getRenderedScriptUrl($registeredScript) {
+ private function _getRenderedScriptUrl(string $registeredScript) {
$renderedScripts = $this->_getRenderedScripts();
foreach ($renderedScripts as $compiledFile => $scripts) {
if (in_array($registeredScript, $scripts)) {
@@ -228,7 +228,7 @@ class ClientScriptManager extends TClientScriptManager {
// Scripts - public interface overrides
// In application modes "higher" than Debug, compile JS assets to as few files as possible
- public function renderScriptFiles($writer, Array $files) {
+ public function renderScriptFiles($writer, array $files) {
if ($this->getApplication()->getMode() !== TApplicationMode::Debug) {
if ($files) {
$localFiles = $this->_determineLocalFiles($files);
@@ -307,7 +307,7 @@ class ClientScriptManager extends TClientScriptManager {
}
// Store information on rendered stylesheets in application cache
- private function _appendRenderedSheets(array $newSheets, $compiledFileKey) {
+ private function _appendRenderedSheets(array $newSheets, string $compiledFileKey) {
$sheets = $this->_getRenderedSheets();
if (!isset($sheets[$compiledFileKey])) {
$sheets[$compiledFileKey] = [];
@@ -324,7 +324,7 @@ class ClientScriptManager extends TClientScriptManager {
// Resolve all "url(FILE)" CSS directives pointing
// to relative resources to specified path
- private function _fixStyleSheetPaths($content, $originalUrl) {
+ private function _fixStyleSheetPaths(string $content, string $originalUrl) {
$originalDir = dirname($originalUrl . '.');
return preg_replace_callback(
'/url\s*\([\'"]?(.*?)[\'"]?\)/',
@@ -348,7 +348,7 @@ class ClientScriptManager extends TClientScriptManager {
}
// Compress CSS file and return its content
- private function _getCompressedSheet($origPath, $path) {
+ private function _getCompressedSheet(string $origPath, string $path) {
Prado::using('Lib.cssmin.CssMin');
return trim(CssMin::minify(
$this->_fixStyleSheetPaths(
@@ -403,7 +403,7 @@ class ClientScriptManager extends TClientScriptManager {
}
// Write HTML markup for CSS stylesheet
- private function _renderSheetFileTag(THtmlWriter $writer, $href, $media) {
+ private function _renderSheetFileTag(THtmlWriter $writer, string $href, string $media) {
$writer->addAttribute('rel', 'stylesheet');
$writer->addAttribute('type', 'text/css');
$writer->addAttribute('media', $media);
@@ -443,7 +443,7 @@ class ClientScriptManager extends TClientScriptManager {
// Determine actual asset URL that a source CSS file was rendered as (after compilation/compression)
// FALSE means sheet wasn't rendered at all (i.e. was just registered in current callback)
// Media query types can easily be ignored in a callback request, only URLs matter
- private function _getRenderedSheetUrl($registeredSheet) {
+ private function _getRenderedSheetUrl(string $registeredSheet) {
$renderedSheets = $this->_getRenderedSheets();
foreach ($renderedSheets as $compiledFile => $sheets) {
foreach ($sheets as $sheet) {
@@ -537,7 +537,7 @@ class ClientScriptManager extends TClientScriptManager {
// when sheets are not compiled (when they are, it's done on compilation anyways).
// Such files are rewritten (not in place, though) and registered so that they don't show up
// within published assets returned from asset manager, as they don't end up in the markup.
- public function registerThemeStyleSheetFile($key, $file, $media = '') {
+ public function registerThemeStyleSheetFile(string $key, string $file, string $media = '') {
if ($this->getApplication()->getMode() !== TApplicationMode::Debug) {
$this->_themeStyles[$key] = $file;
} else {
diff --git a/app/frontend/web/TemplateControl.php b/app/frontend/web/TemplateControl.php
index aa95d75..aac5a6e 100644
--- a/app/frontend/web/TemplateControl.php
+++ b/app/frontend/web/TemplateControl.php
@@ -42,28 +42,28 @@ class TemplateControl extends TTemplateControl {
return [];
}
- private function _getControlScriptPath($className) {
+ private function _getControlScriptPath(string $className) {
return Prado::getPathOfNamespace('Application.controls.scripts')
. DIRECTORY_SEPARATOR
. $className
. '.js';
}
- private function _getControlStylePath($className) {
+ private function _getControlStylePath(string $className) {
return Prado::getPathOfNamespace('Application.controls.styles')
. DIRECTORY_SEPARATOR
. $className
. '.css';
}
- private function _getLibPath($identifier, $extension = '') {
+ private function _getLibPath(string $identifier, string $extension = '') {
return Prado::getPathOfNamespace('Lib')
. DIRECTORY_SEPARATOR
. $identifier
. $extension;
}
- private function _registerScriptFile($scriptFile) {
+ private function _registerScriptFile(string $scriptFile) {
$this->_registerExternalScriptDependencies(
$this->getExternalScriptDependencies()
);
@@ -118,7 +118,7 @@ class TemplateControl extends TTemplateControl {
}
}
- private function _registerStyleFile($styleFile) {
+ private function _registerStyleFile(string $styleFile) {
$this->_registerExternalStyleDependencies(
$this->getExternalStyleDependencies()
);