Skip to content

Commit

Permalink
Fix docblock types (#992)
Browse files Browse the repository at this point in the history
  • Loading branch information
kynx committed Apr 11, 2024
1 parent 34adf4e commit 77c0b74
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
38 changes: 18 additions & 20 deletions src/Smarty.php
Expand Up @@ -535,8 +535,6 @@ public function __construct() {
/**
* Load an additional extension.
*
* @param Base $extension
*
* @return void
*/
public function addExtension(ExtensionInterface $extension) {
Expand Down Expand Up @@ -582,7 +580,7 @@ public function templateExists($resource_name) {
*
* @param string|\Smarty\Security $security_class if a string is used, it must be class-name
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
* @throws \Smarty\Exception
*/
public function enableSecurity($security_class = null) {
Expand All @@ -593,7 +591,7 @@ public function enableSecurity($security_class = null) {
/**
* Disable security
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
*/
public function disableSecurity() {
$this->security_policy = null;
Expand All @@ -607,7 +605,7 @@ public function disableSecurity() {
* @param string $key of the array element to assign the template dir to
* @param bool $isConfig true for config_dir
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
*/
public function addTemplateDir($template_dir, $key = null, $isConfig = false) {
if ($isConfig) {
Expand Down Expand Up @@ -672,7 +670,7 @@ public function getTemplateDir($index = null, $isConfig = false) {
* @param string|array $template_dir directory(s) of template sources
* @param bool $isConfig true for config_dir
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
*/
public function setTemplateDir($template_dir, $isConfig = false) {
if ($isConfig) {
Expand All @@ -692,7 +690,7 @@ public function setTemplateDir($template_dir, $isConfig = false) {
* @param string|array $config_dir directory(s) of config sources
* @param mixed $key key of the array element to assign the config dir to
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
*/
public function addConfigDir($config_dir, $key = null) {
return $this->addTemplateDir($config_dir, $key, true);
Expand All @@ -714,7 +712,7 @@ public function getConfigDir($index = null) {
*
* @param $config_dir
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
*/
public function setConfigDir($config_dir) {
return $this->setTemplateDir($config_dir, true);
Expand Down Expand Up @@ -788,7 +786,7 @@ public function unregisterPlugin($type, $name) {
*
* @param null|array|string $plugins_dir
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
* @deprecated since 5.0
*/
public function addPluginsDir($plugins_dir) {
Expand Down Expand Up @@ -821,7 +819,7 @@ public function getPluginsDir() {
*
* @param string|array $plugins_dir directory(s) of plugins
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
* @deprecated since 5.0
*/
public function setPluginsDir($plugins_dir) {
Expand Down Expand Up @@ -882,7 +880,7 @@ public function getCompileDir() {
*
* @param string $compile_dir directory to store compiled templates in
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
*/
public function setCompileDir($compile_dir) {
$this->_normalizeDir('compile_dir', $compile_dir);
Expand All @@ -908,7 +906,7 @@ public function getCacheDir() {
*
* @param string $cache_dir directory to store cached templates in
*
* @return Smarty current Smarty instance for chaining
* @return static current Smarty instance for chaining
*/
public function setCacheDir($cache_dir) {
$this->_normalizeDir('cache_dir', $cache_dir);
Expand Down Expand Up @@ -1171,7 +1169,7 @@ public function testInstall(&$errors = null) {
/**
* Get Smarty object
*
* @return Smarty
* @return static
*/
public function getSmarty() {
return $this;
Expand Down Expand Up @@ -1844,7 +1842,7 @@ public function loadFilter($type, $name) {
* @param string $type filter type
* @param string $name filter name
*
* @return TemplateBase
* @return static
* @throws \Smarty\Exception
* @api Smarty::unloadFilter()
*
Expand Down Expand Up @@ -1890,7 +1888,7 @@ public function getCachingType(): string {
* @param string $name name of resource type
* @param Base $resource_handler
*
* @return Smarty
* @return static
*
* @api Smarty::registerCacheResource()
*
Expand All @@ -1911,7 +1909,7 @@ public function registerCacheResource($name, \Smarty\Cacheresource\Base $resourc
*
* @param $name
*
* @return Smarty
* @return static
* @api Smarty::unregisterCacheResource()
*
* @deprecated since 5.0
Expand Down Expand Up @@ -1944,7 +1942,7 @@ private function activateBCCacheResource() {
* @param callable $callback
* @param string|null $name optional filter name
*
* @return TemplateBase
* @return static
* @throws \Smarty\Exception
*
* @api Smarty::registerFilter()
Expand Down Expand Up @@ -2003,7 +2001,7 @@ private function _getFilterName($callable) {
* @param string $type filter type
* @param callback|string $name the name previously used in ::registerFilter
*
* @return TemplateBase
* @return static
* @throws \Smarty\Exception
* @api Smarty::unregisterFilter()
*
Expand Down Expand Up @@ -2040,7 +2038,7 @@ public function unregisterFilter($type, $name) {
* @param array|string $modifiers modifier or list of modifiers
* to add
*
* @return Smarty
* @return static
* @api Smarty::addDefaultModifiers()
*
*/
Expand Down Expand Up @@ -2070,7 +2068,7 @@ public function getDefaultModifiers() {
* @param array|string $modifiers modifier or list of modifiers
* to set
*
* @return TemplateBase
* @return static
* @api Smarty::setDefaultModifiers()
*
*/
Expand Down
20 changes: 10 additions & 10 deletions src/TemplateBase.php
Expand Up @@ -73,7 +73,7 @@ abstract class TemplateBase extends Data {
* @param bool $format smarty argument format, else traditional
* @param array $block_methods list of block-methods
*
* @return \Smarty|\Smarty\Template
* @return static
* @throws \Smarty\Exception
*
* @api Smarty::registerObject()
Expand Down Expand Up @@ -113,7 +113,7 @@ public function registerObject(
*
* @param string $object_name name of object
*
* @return TemplateBase
* @return static
* @api Smarty::unregisterObject()
*
*/
Expand Down Expand Up @@ -251,7 +251,7 @@ public function getLiterals() {
* @param array|string $literals literal or list of literals
* to addto add
*
* @return TemplateBase
* @return static
* @throws \Smarty\Exception
* @api Smarty::addLiterals()
*
Expand All @@ -269,7 +269,7 @@ public function addLiterals($literals = null) {
* @param array|string $literals literal or list of literals
* to setto set
*
* @return TemplateBase
* @return static
* @throws \Smarty\Exception
* @api Smarty::setLiterals()
*
Expand Down Expand Up @@ -312,7 +312,7 @@ private function _setLiterals(Smarty $smarty, $literals) {
* @param string $class_impl the referenced PHP class to
* register
*
* @return TemplateBase
* @return static
* @throws \Smarty\Exception
* @api Smarty::registerClass()
*
Expand All @@ -333,7 +333,7 @@ public function registerClass($class_name, $class_impl) {
*
* @param callable $callback class/method name
*
* @return TemplateBase
* @return static
* @throws Exception if $callback is not callable
* @api Smarty::registerDefaultConfigHandler()
*
Expand All @@ -353,7 +353,7 @@ public function registerDefaultConfigHandler($callback) {
*
* @param callable $callback class/method name
*
* @return TemplateBase
* @return static
* @throws Exception if $callback is not callable
* @api Smarty::registerDefaultTemplateHandler()
*
Expand All @@ -374,7 +374,7 @@ public function registerDefaultTemplateHandler($callback) {
* @param string $name name of resource type
* @param \Smarty\Resource\BasePlugin $resource_handler instance of Smarty\Resource\BasePlugin
*
* @return \Smarty\Smarty|\Smarty\Template
* @return static
*
* @api Smarty::registerResource()
*/
Expand All @@ -389,7 +389,7 @@ public function registerResource($name, \Smarty\Resource\BasePlugin $resource_ha
*
* @param string $type name of resource type
*
* @return TemplateBase
* @return static
* @api Smarty::unregisterResource()
*
*/
Expand All @@ -406,7 +406,7 @@ public function unregisterResource($type) {
*
* @param string $tpl_name
*
* @return TemplateBase
* @return static
* @throws Exception if file is not readable
* @api Smarty::setDebugTemplate()
*
Expand Down

0 comments on commit 77c0b74

Please sign in to comment.