Skip to content

Commit

Permalink
Fix deprecations and SA
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu authored and github-actions[bot] committed Dec 16, 2023
1 parent a7d6a75 commit 75687bd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/Admin/Extension/Gedmo/TranslatableAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private function setLocale(object $object): void
\assert($objectManager instanceof ObjectManager);

$configuration = $this->translatableListener->getConfiguration($objectManager, $objectClassName);
/** @psalm-suppress InvalidArrayOffset */
if (!isset($configuration['locale'])) {
throw new \LogicException(sprintf(
'There is no locale or language property found on class: "%s"',
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/Extension/SonataTranslationExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function isTranslatable($object): bool
return $this->getTranslatableChecker()->isTranslatable($object);
}

public function getLocaleName(string $locale, ?string $displayLocale = null): ?string
public function getLocaleName(string $locale, ?string $displayLocale = null): string
{
return Locales::getName($locale, $displayLocale);
}
Expand Down
3 changes: 0 additions & 3 deletions tests/App/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ protected function configureRoutes(RoutingConfigurator $routes): void
$routes->import(sprintf('%s/config/routes.yaml', $this->getProjectDir()));
}

/**
* @psalm-suppress DeprecatedClass
*/
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
{
$container->setParameter('app.base_dir', $this->getBaseDir());
Expand Down
4 changes: 2 additions & 2 deletions tests/Provider/Knplabs/LocaleProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public function __construct(private string $locale)
{
}

public function provideCurrentLocale(): ?string
public function provideCurrentLocale(): string
{
return $this->locale;
}

public function provideFallbackLocale(): ?string
public function provideFallbackLocale(): string
{
return $this->locale;
}
Expand Down
4 changes: 3 additions & 1 deletion tests/Traits/DoctrineOrmTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ final protected function getConfiguration(): Configuration
return ORMSetup::createAttributeMetadataConfiguration(
[],
false,
sys_get_temp_dir().'/sonata-translation-bundle'
sys_get_temp_dir().'/sonata-translation-bundle',
null,
true,
);
}
}

0 comments on commit 75687bd

Please sign in to comment.