Skip to content

Commit

Permalink
Psalm auto fixes manualy reviewed and edited
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Apr 28, 2020
1 parent 1b7f002 commit b7af136
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ protected function displayHtmlForPartitionChange()
*
* @return array[]|null array of partition details
*/
private function _extractPartitionDetails()
private function _extractPartitionDetails(): ?array
{
$createTable = (new Table($this->table, $this->db))->showCreate();
if (! $createTable) {
Expand Down
4 changes: 1 addition & 3 deletions libraries/classes/Database/Designer/DesignerTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ public function getTableEngine(): string

/**
* Get the displayed field
*
* @return string
*/
public function getDisplayField()
public function getDisplayField(): ?string
{
return $this->displayField;
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Database/Routines.php
Original file line number Diff line number Diff line change
Expand Up @@ -1559,9 +1559,9 @@ public function handleExecute()
*
* @param array $row Columns
*
* @return string
* @return null|string
*/
private function browseRow(array $row)
private function browseRow(array $row): ?string
{
$output = null;
foreach ($row as $value) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Gis/GisPolygon.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public static function isPointInsidePolygon(array $point, array $polygon)
*
* @param array $ring array of points forming the ring
*
* @return array|bool a point on the surface of the ring
* @return array|false a point on the surface of the ring
*
* @access public
* @static
Expand Down
4 changes: 2 additions & 2 deletions libraries/classes/Plugins/AuthenticationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,9 @@ public function checkRules()
* Checks whether two factor authentication is active
* for given user and performs it.
*
* @return bool|void
* @return void
*/
public function checkTwoFactor()
public function checkTwoFactor(): void
{
$twofactor = new TwoFactor($this->user);

Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Sanitize.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public static function escapeJsString($string)
*
* @param string $value String to be formatted.
*
* @return string formatted value.
* @return int|string formatted value.
*/
public static function formatJsVal($value)
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ public function getAttributes()
*
* @return string[]
*/
public function getColumns()
public function getColumns(): array
{
$isMariaDB = $this->_dbi->isMariaDB();
$serverVersion = $this->_dbi->getVersion();
Expand Down
6 changes: 3 additions & 3 deletions libraries/classes/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public static function profilingSupported()
*
* @access public
*/
public static function formatByteDown($value, $limes = 6, $comma = 0)
public static function formatByteDown($value, $limes = 6, $comma = 0): ?array
{
if ($value === null) {
return null;
Expand Down Expand Up @@ -712,7 +712,7 @@ public static function formatNumber(
*
* @return int The numerical part of the expression (for example 8)
*/
public static function extractValueFromFormattedSize($formatted_size)
public static function extractValueFromFormattedSize($formatted_size): int
{
$return_value = -1;

Expand Down Expand Up @@ -1965,7 +1965,7 @@ public static function unsupportedDatatypes()
*
* @return string[] GIS data types
*/
public static function getGISDatatypes($upper_case = false)
public static function getGISDatatypes($upper_case = false): array
{
$gis_data_types = [
'geometry',
Expand Down

0 comments on commit b7af136

Please sign in to comment.