fix phpstan/phpcs

This commit is contained in:
Dennis Eichhorn 2021-06-26 14:38:07 +02:00
parent 3dc169e935
commit 62fb162556
3 changed files with 13 additions and 4 deletions

View File

@ -453,7 +453,7 @@ final class ApiController extends Controller
if (!empty($uploadedFiles)) { if (!empty($uploadedFiles)) {
$upload = new UploadFile(); $upload = new UploadFile();
$upload->preserveFileName = false; $upload->preserveFileName = false;
$upload->soutputDir = __DIR__ . '/../../../Web/Backend/img'; $upload->outputDir = __DIR__ . '/../../../Web/Backend/img';
$status = $upload->upload($uploadedFiles, 'logo.png', true); $status = $upload->upload($uploadedFiles, 'logo.png', true);
} }

View File

@ -104,15 +104,24 @@ final class GroupMapper extends DataMapperAbstract
$depth = 3; $depth = 3;
$query = self::getQuery(); $query = self::getQuery();
$query->innerJoin(GroupPermissionMapper::getTable()) $query->innerJoin(GroupPermissionMapper::getTable())
->on(self::$table . '_' . $depth . '.group_id', '=', GroupPermissionMapper::getTable() . '.group_permission_group') ->on(self::$table . '_d' . $depth . '.group_id', '=', GroupPermissionMapper::getTable() . '.group_permission_group')
->where(GroupPermissionMapper::getTable() . '.group_permission_module', '=', $module); ->where(GroupPermissionMapper::getTable() . '.group_permission_module', '=', $module);
return self::getAllByQuery($query, RelationType::ALL, $depth); return self::getAllByQuery($query, RelationType::ALL, $depth);
} }
/**
* Count the number of group members
*
* @param int $group Group to inspect (0 = all groups)
*
* @return array<string, int>
*
* @since 1.0.0
*/
public static function countMembers(int $group = 0) : array public static function countMembers(int $group = 0) : array
{ {
$query = new Builder(self::$db); $query = new Builder(self::$db);
$query->select(self::$hasMany['accounts']['self']) $query->select(self::$hasMany['accounts']['self'])
->select('COUNT(' . self::$hasMany['accounts']['external'] . ')') ->select('COUNT(' . self::$hasMany['accounts']['external'] . ')')
->from(self::$hasMany['accounts']['table']) ->from(self::$hasMany['accounts']['table'])

View File

@ -9,7 +9,7 @@
], ],
"require-dev": { "require-dev": {
"phpunit/phpunit": ">=9.4", "phpunit/phpunit": ">=9.4",
"friendsofphp/php-cs-fixer": ">=2.18", "friendsofphp/php-cs-fixer": ">=3.0",
"squizlabs/php_codesniffer": ">=3.5", "squizlabs/php_codesniffer": ">=3.5",
"phpmd/phpmd": ">=2.9", "phpmd/phpmd": ">=2.9",
"phpstan/phpstan": ">=0.12.58", "phpstan/phpstan": ">=0.12.58",