Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,31 @@ jobs:
- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

rector:
name: Run rector
runs-on: "ubuntu-22.04"
strategy:
matrix:
php:
- '8.3'
steps:
- uses: actions/checkout@v4

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: ramsey/composer-install@v3
with:
dependency-versions: highest

- name: Run rector
run: vendor/bin/rector process --dry-run --ansi

tests:
name: Tests
runs-on: "ubuntu-22.04"
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"ibexa/doctrine-schema": "~5.0.x-dev",
"ibexa/fieldtype-richtext": "~5.0.x-dev",
"ibexa/http-cache": "~5.0.x-dev",
"ibexa/rector": "~5.0.x-dev",
"ibexa/rest": "~5.0.x-dev",
"ibexa/search": "~5.0.x-dev",
"matthiasnoback/symfony-dependency-injection-test": "4.3",
Expand Down
40 changes: 0 additions & 40 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,6 @@ parameters:
count: 1
path: src/lib/Form/Processor/UserRegisterFormProcessor.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\Invitation\\\\InvitationType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/Invitation/InvitationType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\Invitation\\\\RoleChoiceType\\:\\:loadFilteredRoles\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -480,46 +475,11 @@ parameters:
count: 1
path: src/lib/Form/Type/Invitation/UserGroupChoiceType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\Invitation\\\\UserInvitationType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/Invitation/UserInvitationType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordChangeType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/UserPasswordChangeType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordForgotType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/UserPasswordForgotType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordForgotWithLoginType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/UserPasswordForgotWithLoginType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserPasswordResetType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/UserPasswordResetType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserRegisterType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/UserRegisterType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserRegisterType\\:\\:getName\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/UserRegisterType.php

-
message: "#^Method Ibexa\\\\User\\\\Form\\\\Type\\\\UserSettingUpdateType\\:\\:buildForm\\(\\) has no return type specified\\.$#"
count: 1
path: src/lib/Form/Type/UserSettingUpdateType.php

-
message: "#^Method Ibexa\\\\User\\\\Invitation\\\\DomainMapper\\:\\:mapRoleLimitation\\(\\) has parameter \\$values with no value type specified in iterable type array\\.$#"
count: 1
Expand Down
25 changes: 25 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

use Ibexa\Contracts\Rector\Sets\IbexaSetList;
use Rector\Config\RectorConfig;
use Rector\Symfony\Set\SymfonySetList;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->withSets([
IbexaSetList::IBEXA_50->value,
SymfonySetList::SYMFONY_60,
SymfonySetList::SYMFONY_61,
SymfonySetList::SYMFONY_62,
SymfonySetList::SYMFONY_63,
SymfonySetList::SYMFONY_64,
]);
2 changes: 1 addition & 1 deletion src/lib/Form/Type/Invitation/InvitationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(InvitationService $invitationService)
$this->invitationService = $invitationService;
}

public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->addViewTransformer(new InvitationTransformer($this->invitationService));
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/Type/Invitation/UserInvitationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class UserInvitationType extends AbstractType
public const LIMITATION_TYPE_SECTION = 'section';
public const LIMITATION_TYPE_LOCATION = 'location';

public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', EmailType::class, [
Expand Down Expand Up @@ -73,7 +73,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$builder->addModelTransformer(new LimitationValueTransformer());
}

public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => UserInvitationData::class,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Form/Type/UserPasswordChangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class UserPasswordChangeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('oldPassword', PasswordType::class, [
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/Type/UserPasswordForgotType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class UserPasswordForgotType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', EmailType::class, [
Expand All @@ -31,7 +31,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
);
}

public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => UserPasswordForgotData::class,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/Type/UserPasswordForgotWithLoginType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class UserPasswordForgotWithLoginType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('login', TextType::class, [
Expand All @@ -31,7 +31,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
);
}

public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => UserPasswordForgotWithLoginData::class,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Form/Type/UserPasswordResetType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class UserPasswordResetType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('new_password', RepeatedType::class, [
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/Type/UserRegisterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getParent(): ?string
return BaseContentType::class;
}

public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('register', SubmitType::class, ['label' => /** @Desc("Register") */ 'user.register_button'])
Expand All @@ -72,7 +72,7 @@ function (FormEvent $event): void {
);
}

public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setDefaults([
Expand Down
4 changes: 2 additions & 2 deletions src/lib/Form/Type/UserSettingUpdateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct(
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
*/
public function buildForm(FormBuilderInterface $builder, array $options)
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$groupDefinition = $this->valueDefinitionRegistry->getValueDefinitionGroup(
$options['user_setting_group_identifier']
Expand Down Expand Up @@ -76,7 +76,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
public function configureOptions(OptionsResolver $resolver): void
{
$resolver
->setRequired('user_setting_group_identifier')
Expand Down
Loading