Run rector

This commit is contained in:
Jan Böhmer 2025-07-14 00:26:40 +02:00
parent 6665203f2a
commit f1d34bbc24
9 changed files with 26 additions and 10 deletions

View file

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace App\Controller; namespace App\Controller;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use App\Settings\AppSettings; use App\Settings\AppSettings;
use Jbtronics\SettingsBundle\Form\SettingsFormFactoryInterface; use Jbtronics\SettingsBundle\Form\SettingsFormFactoryInterface;
use Jbtronics\SettingsBundle\Manager\SettingsManagerInterface; use Jbtronics\SettingsBundle\Manager\SettingsManagerInterface;
@ -49,7 +50,7 @@ class SettingsController extends AbstractController
$builder = $this->settingsFormFactory->createSettingsFormBuilder($settings); $builder = $this->settingsFormFactory->createSettingsFormBuilder($settings);
//Add a submit button to the form //Add a submit button to the form
$builder->add('submit', \Symfony\Component\Form\Extension\Core\Type\SubmitType::class, ['label' => 'save']); $builder->add('submit', SubmitType::class, ['label' => 'save']);
//Create the form //Create the form
$form = $builder->getForm(); $form = $builder->getForm();

View file

@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace App\Services\InfoProviderSystem; namespace App\Services\InfoProviderSystem;
use App\Entity\Parts\Manufacturer; use App\Entity\Parts\Manufacturer;
@ -74,4 +76,4 @@ final class ExistingPartFinder
return $qb->getQuery()->getResult(); return $qb->getQuery()->getResult();
} }
} }

View file

@ -22,6 +22,7 @@ declare(strict_types=1);
*/ */
namespace App\Twig; namespace App\Twig;
use App\Settings\SettingsIcon;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use App\Services\LogSystem\EventCommentType; use App\Services\LogSystem\EventCommentType;
use Jbtronics\SettingsBundle\Proxy\SettingsProxyInterface; use Jbtronics\SettingsBundle\Proxy\SettingsProxyInterface;
@ -71,7 +72,7 @@ final class MiscExtension extends AbstractExtension
$reflection = new ReflectionClass($objectOrClass); $reflection = new ReflectionClass($objectOrClass);
$attribute = $reflection->getAttributes(\App\Settings\SettingsIcon::class)[0] ?? null; $attribute = $reflection->getAttributes(SettingsIcon::class)[0] ?? null;
return $attribute?->newInstance()->icon; return $attribute?->newInstance()->icon;
} }

View file

@ -1,4 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
* *
@ -17,7 +20,6 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
namespace App\Tests\Exceptions; namespace App\Tests\Exceptions;
use App\Exceptions\TwigModeException; use App\Exceptions\TwigModeException;

View file

@ -1,4 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
* *
@ -17,7 +20,6 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
namespace App\Tests\Helpers; namespace App\Tests\Helpers;
use App\Helpers\IPAnonymizer; use App\Helpers\IPAnonymizer;

View file

@ -1,4 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
* *
@ -17,7 +20,6 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
namespace App\Tests\Repository; namespace App\Tests\Repository;
use App\Entity\LogSystem\AbstractLogEntry; use App\Entity\LogSystem\AbstractLogEntry;

View file

@ -1,4 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
* *
@ -17,7 +20,6 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
namespace App\Tests\Services\LabelSystem\BarcodeScanner; namespace App\Tests\Services\LabelSystem\BarcodeScanner;
use App\Services\LabelSystem\BarcodeScanner\EIGP114BarcodeScanResult; use App\Services\LabelSystem\BarcodeScanner\EIGP114BarcodeScanResult;

View file

@ -1,4 +1,7 @@
<?php <?php
declare(strict_types=1);
/* /*
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony). * This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
* *
@ -17,7 +20,6 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
namespace App\Tests\Services\LogSystem; namespace App\Tests\Services\LogSystem;
use App\Entity\LogSystem\ElementEditedLogEntry; use App\Entity\LogSystem\ElementEditedLogEntry;

View file

@ -22,6 +22,8 @@ declare(strict_types=1);
namespace App\Tests; namespace App\Tests;
use Jbtronics\SettingsBundle\Settings\Settings;
use Jbtronics\SettingsBundle\Settings\ResettableSettingsInterface;
use InvalidArgumentException; use InvalidArgumentException;
use ReflectionClass; use ReflectionClass;
@ -41,14 +43,14 @@ class SettingsTestHelper
$reflection = new ReflectionClass($class); $reflection = new ReflectionClass($class);
//Check if it is a settings class (has a Settings attribute) //Check if it is a settings class (has a Settings attribute)
if ($reflection->getAttributes(\Jbtronics\SettingsBundle\Settings\Settings::class) === []) { if ($reflection->getAttributes(Settings::class) === []) {
throw new InvalidArgumentException("The class $class is not a settings class!"); throw new InvalidArgumentException("The class $class is not a settings class!");
} }
$object = $reflection->newInstanceWithoutConstructor(); $object = $reflection->newInstanceWithoutConstructor();
//If the object has some initialization logic, then call it //If the object has some initialization logic, then call it
if ($object instanceof \Jbtronics\SettingsBundle\Settings\ResettableSettingsInterface) { if ($object instanceof ResettableSettingsInterface) {
$object->resetToDefaultValues(); $object->resetToDefaultValues();
} }