Mark classes as final

This commit is contained in:
brabli
2024-08-05 12:09:10 +01:00
parent cb16158eb3
commit f30c20ceda
6 changed files with 7 additions and 6 deletions

View File

@@ -9,7 +9,7 @@ namespace Pcm\GeocodeBundle\Model;
*
* @package Pcm\GeocodeBundle
*/
class LatLongModel
final class LatLongModel
{
public function __construct(private float $latitude, private float $longitude) {}

View File

@@ -10,7 +10,7 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
class PcmGeocodeBundle extends AbstractBundle {
final class PcmGeocodeBundle extends AbstractBundle {
public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
{
$loader = new YamlFileLoader($builder, new FileLocator(__DIR__.'/../config/'));

View File

@@ -8,7 +8,7 @@ use Pcm\GeocodeBundle\Model\LatLongModel;
use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Contracts\HttpClient\ResponseInterface;
class Geocoder
final class Geocoder
{
private const string API_URL = "https://nominatim.openstreetmap.org/search";

View File

@@ -9,7 +9,7 @@ use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
final class AppKernel extends Kernel
{
/**
* @return array
@@ -30,3 +30,4 @@ class AppKernel extends Kernel
$loader->load(__DIR__.'/config_'.$this->getEnvironment().'.yml');
}
}

View File

@@ -14,7 +14,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* We sleep 1 second after API calls to prevent breaking the API T&Cs.
*/
class GeocodeTest extends KernelTestCase
final class GeocodeTest extends KernelTestCase
{
// Buckingham Palace
private const string POSTCODE = 'SW1A 1AA';

View File

@@ -8,7 +8,7 @@ use Pcm\GeocodeBundle\Entity\Interface\MappableInterface;
use Pcm\GeocodeBundle\Entity\Trait\MappableTrait;
use PHPUnit\Framework\TestCase;
class MappableTraitTest extends TestCase
final class MappableTraitTest extends TestCase
{
private const float COORD = 123.456;