[ticket/15699] Improve code style

PHPBB3-15699
This commit is contained in:
Ruben Calvo 2024-02-18 10:44:41 +01:00
parent c366086661
commit 2ec1c3d279
No known key found for this signature in database
5 changed files with 23 additions and 27 deletions

View file

@ -16,34 +16,34 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for storage in STORAGE_STATS %} {% for storage in STORAGE_STATS %}
<tr> <tr>
<td>{{ storage.name }}</td> <td>{{ storage.name }}</td>
<td>{{ storage.files }}</td> <td>{{ storage.files }}</td>
<td>{{ storage.size }}</td> <td>{{ storage.size }}</td>
<td>{{ storage.free_space }}</td> <td>{{ storage.free_space }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% if ERROR_MESSAGES is not empty %} {% if ERROR_MESSAGES is not empty %}
<div class="errorbox"> <div class="errorbox">
<h3>{{ lang('WARNING') }}</h3> <h3>{{ lang('WARNING') }}</h3>
{% for ERROR_MESSAGE in ERROR_MESSAGES %} {% for ERROR_MESSAGE in ERROR_MESSAGES %}
<p>{{ ERROR_MESSAGE }}</p> <p>{{ ERROR_MESSAGE }}</p>
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
<form id="acp_storage" method="post" action="{{ U_ACTION }}"> <form id="acp_storage" method="post" action="{{ U_ACTION }}">
{% for storage in STORAGES %} {% for storage in STORAGES %}
<fieldset> <fieldset>
<legend>{{ lang('STORAGE_' ~ storage.get_name | upper ~ '_TITLE') }}</legend> <legend>{{ lang('STORAGE_' ~ storage.get_name | upper ~ '_TITLE') }}</legend>
<dl> <dl>
<dt><label for="{{ storage.get_name }}">{{ lang('STORAGE_SELECT') }}{{ lang('COLON') }}</label><br /><span>{{ lang('STORAGE_SELECT_DESC') }}</span></dt> <dt><label for="{{ storage.get_name }}">{{ lang('STORAGE_SELECT') }}{{ lang('COLON') }}</label><br /><span>{{ lang('STORAGE_SELECT_DESC') }}</span></dt>
<dd> <dd>
<select id="{{ storage.get_name }}" name="{{ storage.get_name }}[provider]" data-togglable-settings="true"> <select id="{{ storage.get_name }}" name="{{ storage.get_name }}[provider]" data-togglable-settings="true">
{% for provider in PROVIDERS %} {% for provider in PROVIDERS %}
{% if provider.is_available %} {% if provider.is_available %}
<option value="{{ get_class(provider) }}"{{ attribute(config, 'storage\\' ~ storage.get_name ~ '\\provider') == get_class(provider) ? ' selected' : '' }} data-toggle-setting="#{{ storage.get_name }}_{{ provider.get_name }}_settings"> <option value="{{ get_class(provider) }}"{{ attribute(config, 'storage\\' ~ storage.get_name ~ '\\provider') == get_class(provider) ? ' selected' : '' }} data-toggle-setting="#{{ storage.get_name }}_{{ provider.get_name }}_settings">

View file

@ -33,13 +33,13 @@ if (!defined('IN_PHPBB'))
class acp_storage class acp_storage
{ {
/** @var driver_interface $db */ /** @var driver_interface */
protected $db; protected $db;
/** @var language $log */ /** @var language */
protected $lang; protected $lang;
/** @var log_interface $log */ /** @var log_interface */
protected $log; protected $log;
/** @var request */ /** @var request */

View file

@ -299,10 +299,8 @@ class local implements adapter_interface, stream_interface
* @param string $path The file * @param string $path The file
* *
* @return array Properties * @return array Properties
* @throws storage_exception When cannot get size
* *
* @throws storage_exception When cannot get size * @throws storage_exception When cannot get size
*
*/ */
public function file_size(string $path): array public function file_size(string $path): array
{ {

View file

@ -211,6 +211,4 @@ class state_helper
$this->config_text->set('storage_update_state', json_encode($state, JSON_THROW_ON_ERROR)); $this->config_text->set('storage_update_state', json_encode($state, JSON_THROW_ON_ERROR));
} }
} }

View file

@ -124,7 +124,7 @@ class storage
* *
* @return string Returns file contents * @return string Returns file contents
* *
*@throws storage_exception When the file doesn't exist * @throws storage_exception When the file doesn't exist
* When cannot read file contents * When cannot read file contents
* *
*/ */
@ -228,7 +228,7 @@ class storage
* @param string $path File to read * @param string $path File to read
* *
* @return resource Returns a file pointer * @return resource Returns a file pointer
*@throws storage_exception When the file doesn't exist * @throws storage_exception When the file doesn't exist
* When unable to open file * When unable to open file
* *
*/ */
@ -405,7 +405,7 @@ class storage
* @param string $path The file * @param string $path The file
* *
* @return \phpbb\storage\file_info Returns file_info object * @return \phpbb\storage\file_info Returns file_info object
*@throws storage_exception When the adapter doesn't implement the method * @throws storage_exception When the adapter doesn't implement the method
* When the file doesn't exist * When the file doesn't exist
* *
*/ */
@ -486,7 +486,7 @@ class storage
* Get space available in bytes * Get space available in bytes
* *
* @return float Returns available space * @return float Returns available space
*@throws storage_exception When unable to retrieve available storage space * @throws storage_exception When unable to retrieve available storage space
* *
*/ */
public function free_space() public function free_space()