Skip to content

Commit 80fd6c6

Browse files
committed
Minor: Format code + fix psalm
1 parent f53d420 commit 80fd6c6

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

src/CoreBundle/Component/Utils/ChamiloApi.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Chamilo\CoreBundle\Component\Utils;
88

9+
use Chamilo\CoreBundle\Framework\Container;
910
use ChamiloSession as Session;
1011
use Database;
1112
use DateInterval;
@@ -156,7 +157,7 @@ public static function getPlatformLogo(
156157
): string {
157158
$logoPath = Container::getThemeHelper()->getThemeAssetUrl('images/header-logo.svg');
158159

159-
if (empty($logo)) {
160+
if (empty($logoPath)) {
160161
$logoPath = Container::getThemeHelper()->getThemeAssetUrl('images/header-logo.png');
161162
}
162163

src/CoreBundle/Form/PermissionType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Symfony\Component\Form\FormBuilderInterface;
1212
use Symfony\Component\OptionsResolver\OptionsResolver;
1313

14+
/**
15+
* @template-extends AbstractType<string>
16+
*/
1417
class PermissionType extends AbstractType
1518
{
1619
public function buildForm(FormBuilderInterface $builder, array $options): void

src/CoreBundle/Migrations/Schema/V200/Version20230215072918.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function up(Schema $schema): void
5050

5151
if (!empty($items)) {
5252
foreach ($items as $item) {
53-
if (!($item['to_user_id'] === NULL || $item['to_user_id'] === 0)) {
53+
if (!(null === $item['to_user_id'] || 0 === $item['to_user_id'])) {
5454
$sessionId = $item['session_id'] ?? 0;
5555
$userId = $item['to_user_id'] ?? 0;
5656
$session = $sessionRepo->find($sessionId);

src/CoreBundle/Migrations/Schema/V200/Version20240713125400.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,16 @@ public function up(Schema $schema): void
2525
foreach ($users as $user) {
2626
$roles = unserialize($user['roles']);
2727

28-
if ($roles !== false) {
28+
if (false !== $roles) {
2929
$updatedRoles = array_map(function ($role) {
30-
return $role === 'ROLE_RRHH' ? 'ROLE_HR' : $role;
30+
return 'ROLE_RRHH' === $role ? 'ROLE_HR' : $role;
3131
}, $roles);
3232

3333
$newRolesSerialized = serialize($updatedRoles);
3434
$conn->executeUpdate(
3535
'UPDATE user SET roles = ? WHERE id = ?',
3636
[$newRolesSerialized, $user['id']]
3737
);
38-
3938
}
4039
}
4140
}
@@ -49,9 +48,9 @@ public function down(Schema $schema): void
4948
foreach ($users as $user) {
5049
$roles = unserialize($user['roles']);
5150

52-
if ($roles !== false) {
51+
if (false !== $roles) {
5352
$updatedRoles = array_map(function ($role) {
54-
return $role === 'ROLE_HR' ? 'ROLE_RRHH' : $role;
53+
return 'ROLE_HR' === $role ? 'ROLE_RRHH' : $role;
5554
}, $roles);
5655

5756
$newRolesSerialized = serialize($updatedRoles);

src/CoreBundle/Migrations/Schema/V200/Version20240715183456.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,5 @@ public function up(Schema $schema): void
3131
$this->addSql("DELETE FROM extra_field WHERE variable = 'special_course' AND item_type = $extraFieldType");
3232
}
3333

34-
public function down(Schema $schema): void
35-
{
36-
}
34+
public function down(Schema $schema): void {}
3735
}

0 commit comments

Comments
 (0)