diff --git a/phpBB/phpbb/storage/controller/attachment.php b/phpBB/phpbb/storage/controller/attachment.php index 8cfae96905..11d254f24a 100644 --- a/phpBB/phpbb/storage/controller/attachment.php +++ b/phpBB/phpbb/storage/controller/attachment.php @@ -278,7 +278,7 @@ class attachment extends controller $response->headers->set('Content-Disposition', $disposition); // Set expires header for browser cache - $time = new \Datetime(); + $time = new \DateTime(); $response->setExpires($time->modify('+1 year')); return parent::handle($attachment['physical_filename']); diff --git a/phpBB/phpbb/storage/controller/avatar.php b/phpBB/phpbb/storage/controller/avatar.php index aaf347fd79..7055961230 100644 --- a/phpBB/phpbb/storage/controller/avatar.php +++ b/phpBB/phpbb/storage/controller/avatar.php @@ -107,7 +107,7 @@ class avatar extends controller $response->headers->set('Content-Disposition', $disposition); - $time = new \Datetime(); + $time = new \DateTime(); $response->setExpires($time->modify('+1 year')); parent::prepare($response, $file); diff --git a/phpBB/phpbb/storage/file_info.php b/phpBB/phpbb/storage/file_info.php index b57faa42ed..2e93846838 100644 --- a/phpBB/phpbb/storage/file_info.php +++ b/phpBB/phpbb/storage/file_info.php @@ -43,7 +43,7 @@ class file_info /** * Constructor * - * @param \Symfony\Component\DependencyInjection\ContainerInterface $adapter + * @param adapter_interface $adapter * @param string $path */ public function __construct(adapter_interface $adapter, $path) diff --git a/phpBB/phpbb/storage/storage.php b/phpBB/phpbb/storage/storage.php index 5689200569..671e9da1a3 100644 --- a/phpBB/phpbb/storage/storage.php +++ b/phpBB/phpbb/storage/storage.php @@ -403,7 +403,7 @@ class storage * * @param string $path The file * - * @throws \phpbb\storage\exception\not_implemented When the adapter doesnt implement the method + * @throws \phpbb\storage\exception\exception When the adapter doesnt implement the method * When the file doesn't exist * * @return \phpbb\storage\file_info Returns file_info object diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php index 742dea8d3e..dcc530f37a 100644 --- a/phpBB/phpbb/template/template.php +++ b/phpBB/phpbb/template/template.php @@ -15,14 +15,6 @@ namespace phpbb\template; interface template { - - /** - * Clear the cache - * - * @return \phpbb\template\template - */ - public function clear_cache(); - /** * Sets the template filenames for handles. * diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index 6dc3bb2994..f745690089 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -53,7 +53,7 @@ class extension extends \Twig\Extension\AbstractExtension /** * Returns the token parser instance to add to the existing list. * - * @return array An array of \Twig\TokenParser\AbstractTokenParser instances + * @return \Twig\TokenParser\TokenParserInterface[] An array of \Twig\TokenParser\AbstractTokenParser instances */ public function getTokenParsers() { @@ -69,7 +69,7 @@ class extension extends \Twig\Extension\AbstractExtension /** * Returns a list of filters to add to the existing list. * - * @return array An array of filters + * @return \Twig\TwigFilter[] An array of filters */ public function getFilters() { @@ -85,7 +85,7 @@ class extension extends \Twig\Extension\AbstractExtension /** * Returns a list of global functions to add to the existing list. * - * @return array An array of global functions + * @return \Twig\TwigFunction[] An array of global functions */ public function getFunctions() { @@ -100,7 +100,7 @@ class extension extends \Twig\Extension\AbstractExtension /** * Returns a list of operators to add to the existing list. * - * @return array An array of operators + * @return array[] An array of operators */ public function getOperators() { diff --git a/phpBB/phpbb/template/twig/extension/avatar.php b/phpBB/phpbb/template/twig/extension/avatar.php index d8b27fed9f..fb7ec92655 100644 --- a/phpBB/phpbb/template/twig/extension/avatar.php +++ b/phpBB/phpbb/template/twig/extension/avatar.php @@ -30,9 +30,9 @@ class avatar extends AbstractExtension /** * Returns a list of global functions to add to the existing list. * - * @return array An array of global functions + * @return \Twig\TwigFunction[] An array of global functions */ - public function getFunctions() + public function getFunctions(): array { return array( new \Twig\TwigFunction('avatar', array($this, 'get_avatar')), diff --git a/phpBB/phpbb/template/twig/extension/config.php b/phpBB/phpbb/template/twig/extension/config.php index a7f1189d27..ebb4f0c3ca 100644 --- a/phpBB/phpbb/template/twig/extension/config.php +++ b/phpBB/phpbb/template/twig/extension/config.php @@ -43,9 +43,9 @@ class config extends AbstractExtension /** * Returns a list of global functions to add to the existing list. * - * @return array An array of global functions + * @return \Twig\TwigFunction[] An array of global functions */ - public function getFunctions() + public function getFunctions(): array { return array( new \Twig\TwigFunction('config', array($this, 'get_config')), diff --git a/phpBB/phpbb/template/twig/extension/routing.php b/phpBB/phpbb/template/twig/extension/routing.php index 9c404e55d3..3073675d0c 100644 --- a/phpBB/phpbb/template/twig/extension/routing.php +++ b/phpBB/phpbb/template/twig/extension/routing.php @@ -22,7 +22,7 @@ use Twig\TwigFunction; class routing extends AbstractExtension { - /** @var \phpbb\controller\helper */ + /** @var \phpbb\routing\helper */ protected $helper; /** diff --git a/phpBB/phpbb/template/twig/extension/username.php b/phpBB/phpbb/template/twig/extension/username.php index 83cbebe29a..bf99907232 100644 --- a/phpBB/phpbb/template/twig/extension/username.php +++ b/phpBB/phpbb/template/twig/extension/username.php @@ -28,14 +28,12 @@ class username extends AbstractExtension } /** - * Returns a list of global functions to add to the existing list. - * - * @return array An array of global functions + * {@inheritDoc} */ public function getFunctions() { return array( - new \Twig\TwigFunction('username', array($this, 'get_username')), + new \Twig\TwigFunction('username', [$this, 'get_username']), ); } diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index 76bfc6d127..4eddcbcf38 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -21,7 +21,7 @@ class event extends \Twig\Node\Node */ protected $listener_directory = 'event/'; - /** @var \Twig\Environment */ + /** @var \phpbb\template\twig\environment */ protected $environment; public function __construct(\Twig\Node\Expression\AbstractExpression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index ac98dce421..a8c83c42bc 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -23,7 +23,7 @@ class defineparser extends \Twig\TokenParser\AbstractTokenParser * * @return \Twig\Node\Node A Twig\Node instance * @throws \Twig\Error\SyntaxError - * @throws \phpbb\template\twig\node\definenode + * @returns \phpbb\template\twig\node\definenode */ public function parse(\Twig\Token $token) { diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index 6f442401ff..1259618175 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -92,27 +92,14 @@ class twig extends \phpbb\template\base } // Add admin namespace - if ($this->path_helper->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/')) + if ($this->path_helper->get_adm_relative_path() !== null + && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/') + && $this->loader instanceof \Twig\Loader\FilesystemLoader) { $this->loader->setPaths($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/', 'admin'); } } - /** - * Clear the cache - * - * @return \phpbb\template\template - */ - public function clear_cache() - { - if (is_dir($this->cachepath)) - { - $this->twig->clearCacheFiles(); - } - - return $this; - } - /** * Get the style tree of the style preferred by the current user *