[ticket/15253] Fix coding style

PHPBB3-15253
This commit is contained in:
Rubén Calvo 2017-06-25 22:18:47 +02:00
parent 91163d7ec3
commit 21c9b0eeae
2 changed files with 10 additions and 10 deletions

View file

@ -34,11 +34,11 @@ class local implements adapter_interface
public function __construct(\phpbb\config\config $config, \phpbb\filesystem\filesystem $filesystem, $phpbb_root_path, $path_key) public function __construct(\phpbb\config\config $config, \phpbb\filesystem\filesystem $filesystem, $phpbb_root_path, $path_key)
{ {
$this->filesystem = $filesystem; $this->filesystem = $filesystem;
$this->root_path = $phpbb_root_path.$config[$path_key]; $this->root_path = $phpbb_root_path . $config[$path_key];
if (substr($this->root_path, -1, 1) != DIRECTORY_SEPARATOR) if (substr($this->root_path, -1, 1) != DIRECTORY_SEPARATOR)
{ {
$this->root_path = $this->root_path.DIRECTORY_SEPARATOR; $this->root_path = $this->root_path . DIRECTORY_SEPARATOR;
} }
} }
@ -54,7 +54,7 @@ class local implements adapter_interface
try try
{ {
$this->filesystem->dump_file($this->root_path.$path, $content); $this->filesystem->dump_file($this->root_path . $path, $content);
} }
catch (filesystem_exception $e) catch (filesystem_exception $e)
{ {
@ -72,7 +72,7 @@ class local implements adapter_interface
throw new exception('', $path); // FILE_DONT_EXIST throw new exception('', $path); // FILE_DONT_EXIST
} }
if (($content = @file_get_contents($this->root_path.$path)) === false) if (($content = @file_get_contents($this->root_path . $path)) === false)
{ {
throw new exception('', $path); // CANNOT READ FILE throw new exception('', $path); // CANNOT READ FILE
} }
@ -85,7 +85,7 @@ class local implements adapter_interface
*/ */
public function exists($path) public function exists($path)
{ {
return $this->filesystem->exists($this->root_path.$path); return $this->filesystem->exists($this->root_path . $path);
} }
/** /**
@ -95,7 +95,7 @@ class local implements adapter_interface
{ {
try try
{ {
$this->filesystem->remove($this->root_path.$path); $this->filesystem->remove($this->root_path . $path);
} }
catch (filesystem_exception $e) catch (filesystem_exception $e)
{ {
@ -110,7 +110,7 @@ class local implements adapter_interface
{ {
try try
{ {
$this->filesystem->rename($this->root_path.$path_orig, $this->root_path.$path_dest, false); $this->filesystem->rename($this->root_path . $path_orig, $this->root_path . $path_dest, false);
} }
catch (filesystem_exception $e) catch (filesystem_exception $e)
{ {
@ -125,7 +125,7 @@ class local implements adapter_interface
{ {
try try
{ {
$this->filesystem->copy($this->root_path.$path_orig, $this->root_path.$path_dest, false); $this->filesystem->copy($this->root_path . $path_orig, $this->root_path . $path_dest, false);
} }
catch (filesystem_exception $e) catch (filesystem_exception $e)
{ {
@ -140,7 +140,7 @@ class local implements adapter_interface
{ {
try try
{ {
$this->filesystem->mkdir($this->root_path.$path); $this->filesystem->mkdir($this->root_path . $path);
} }
catch (filesystem_exception $e) catch (filesystem_exception $e)
{ {

View file

@ -23,7 +23,7 @@
'test_path' => '.', 'test_path' => '.',
)); ));
$filesystem = new \phpbb\filesystem\filesystem(); $filesystem = new \phpbb\filesystem\filesystem();
$phpbb_root_path = getcwd().DIRECTORY_SEPARATOR; $phpbb_root_path = getcwd() . DIRECTORY_SEPARATOR;
$path_key = 'test_path'; $path_key = 'test_path';
$this->adapter = new \phpbb\storage\adapter\local($config, $filesystem, $phpbb_root_path, $path_key); $this->adapter = new \phpbb\storage\adapter\local($config, $filesystem, $phpbb_root_path, $path_key);
} }