[ticket/15245] Remove unnecessary arguments and fix whitespace

PHPBB3-15245
This commit is contained in:
Oliver Schramm 2017-09-22 13:33:42 +02:00
parent 27ae01c27a
commit 4a7ead0239
2 changed files with 8 additions and 18 deletions

View file

@ -27,28 +27,18 @@ class helper
/** @var \phpbb\user */ /** @var \phpbb\user */
protected $user; protected $user;
/** @var string */
protected $phpbb_root_path;
/** @var string */
protected $phpEx;
/** /**
* Constructor * Constructor
* *
* @param \phpbb\config\config $config Config object * @param \phpbb\config\config $config Config object
* @param \phpbb\path_helper $path_helper Path helper object * @param \phpbb\path_helper $path_helper Path helper object
* @param \phpbb\user $user User object * @param \phpbb\user $user User object
* @param string $phpbb_root_path Root path
* @param string $phpEx PHP file extension
*/ */
public function __construct(\phpbb\config\config $config, \phpbb\path_helper $path_helper, \phpbb\user $user, $phpbb_root_path, $phpEx) public function __construct(\phpbb\config\config $config, \phpbb\path_helper $path_helper, \phpbb\user $user)
{ {
$this->config = $config; $this->config = $config;
$this->path_helper = $path_helper; $this->path_helper = $path_helper;
$this->user = $user; $this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->phpEx = $phpEx;
} }
/** /**
@ -157,7 +147,7 @@ class helper
$content .= implode('<br />', $post_attachments); $content .= implode('<br />', $post_attachments);
// Convert attachments' relative path to absolute path // Convert attachments' relative path to absolute path
$content = str_replace($this->path_helper->get_web_root_path() . 'download/file.' . $this->phpEx, $this->get_board_url() . '/download/file.' . $this->phpEx, $content); $content = str_replace($this->path_helper->get_web_root_path() . 'download/file.' . $this->path_helper->get_php_ext(), $this->get_board_url() . '/download/file.' . $this->path_helper->get_php_ext(), $content);
} }
// Remove Comments from inline attachments [ia] // Remove Comments from inline attachments [ia]

View file

@ -35,7 +35,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case
new \phpbb\symfony_request( new \phpbb\symfony_request(
new phpbb_mock_request() new phpbb_mock_request()
), ),
new \phpbb\filesystem\filesystem(), $this->filesystem,
$this->getMock('\phpbb\request\request'), $this->getMock('\phpbb\request\request'),
$phpbb_root_path, $phpbb_root_path,
'php' 'php'
@ -46,7 +46,7 @@ class phpbb_feed_attachments_base_test extends phpbb_database_test_case
), ),
'\phpbb\datetime' '\phpbb\datetime'
); );
$feed_helper = new \phpbb\feed\helper($config, $path_helper, $user, $phpbb_root_path, $phpEx); $feed_helper = new \phpbb\feed\helper($config, $path_helper, $user);
$db = $this->new_dbal(); $db = $this->new_dbal();
$cache = new \phpbb_mock_cache(); $cache = new \phpbb_mock_cache();
$auth = new \phpbb\auth\auth(); $auth = new \phpbb\auth\auth();