From e53fa4399bba1f161e061955e08b8cd8f3c8b090 Mon Sep 17 00:00:00 2001 From: Lukasz Cybula Date: Tue, 19 Mar 2019 09:16:31 +0100 Subject: [PATCH 1/3] Upgrade dependencies, require symfony ^3.4, fixtures bundle ^3.1, allow symfony ^4.0 --- .travis.yml | 4 ++-- composer.json | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8feaaf..9f25a07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ sudo: false matrix: include: - - php: 7.0 + - php: 7.1 env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' - - php: 7.0 + - php: 7.3 before_install: - composer self-update diff --git a/composer.json b/composer.json index e2cba0a..13c7958 100644 --- a/composer.json +++ b/composer.json @@ -11,16 +11,15 @@ } ], "require": { - "php": ">=7.0", + "php": ">=7.1", "ext-soap": "*", - "ext-mcrypt": "*", - "symfony/framework-bundle": "^2.7|^3.0", - "symfony/console": "^2.7|^3.0", - "symfony/dom-crawler": "^2.7|^3.0", - "symfony/css-selector": "^2.7|^3.0", + "symfony/framework-bundle": "^3.4|^4.0", + "symfony/console": "^3.4|^4.0", + "symfony/dom-crawler": "^3.4|^4.0", + "symfony/css-selector": "^3.4|^4.0", "doctrine/common": "^2.5", "hobnob/xml-stream-reader": "^1.0", - "doctrine/doctrine-fixtures-bundle": "^2.3", + "doctrine/doctrine-fixtures-bundle": "^3.1", "robrichards/wse-php": "^2.0" }, "require-dev": { @@ -42,7 +41,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } } } From e05a527911c74117e88f0060e129abe9536db0e8 Mon Sep 17 00:00:00 2001 From: Lukasz Cybula Date: Tue, 19 Mar 2019 11:01:46 +0100 Subject: [PATCH 2/3] Simplified services registration --- Command/TerytDownloadCommand.php | 34 ++++++++++++++----- .../TerytDownloadPlacesDatabaseCommand.php | 4 +-- ...ownloadPlacesDictionaryDatabaseCommand.php | 4 +-- .../TerytDownloadStreetsDatabaseCommand.php | 4 +-- ...loadTerritorialDivisionDatabaseCommand.php | 4 +-- Command/TerytImportCommand.php | 26 +++++++++----- DataFixtures/ORM/LoadCommunityTypeData.php | 6 ++-- Resources/config/services.xml | 12 +++---- Teryt/Api/Client.php | 16 +++++---- Teryt/Api/TerytSoapClient.php | 2 +- Teryt/Api/WSASoap.php | 6 ++-- composer.json | 5 ++- 12 files changed, 78 insertions(+), 45 deletions(-) diff --git a/Command/TerytDownloadCommand.php b/Command/TerytDownloadCommand.php index 4eb23b6..472ab69 100644 --- a/Command/TerytDownloadCommand.php +++ b/Command/TerytDownloadCommand.php @@ -11,28 +11,46 @@ use FSi\Bundle\TerytDatabaseBundle\Teryt\Api\Client; use SplTempFileObject; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Filesystem\Filesystem; -abstract class TerytDownloadCommand extends ContainerAwareCommand +abstract class TerytDownloadCommand extends Command { - protected function getDefaultTargetPath() + /** + * @var Client + */ + private $client; + + /** + * @var string + */ + private $rootDir; + + public function __construct(Client $client, string $rootDir) + { + parent::__construct(); + + $this->client = $client; + $this->rootDir = $rootDir; + } + + protected function getDefaultTargetPath(): string { - return $this->getContainer()->getParameter('kernel.root_dir') . '/teryt'; + return $this->rootDir . '/teryt'; } - protected function getApiClient() : Client + protected function getApiClient(): Client { - return $this->getContainer()->get('fsi_teryt_db.api_client'); + return $this->client; } - protected function saveFile(SplTempFileObject $file, string $path, string $fileName) + protected function saveFile(SplTempFileObject $file, string $path, string $fileName): void { $filesystem = new Filesystem(); $filesystem->dumpFile(sprintf('%s/%s', $path, $fileName), $file->fread($this->getFileSize($file))); } - private function getFileSize(SplTempFileObject $file) : int + private function getFileSize(SplTempFileObject $file): int { $file->fseek(0, SEEK_END); $size = $file->ftell(); diff --git a/Command/TerytDownloadPlacesDatabaseCommand.php b/Command/TerytDownloadPlacesDatabaseCommand.php index a6e8e31..2a2d8ca 100644 --- a/Command/TerytDownloadPlacesDatabaseCommand.php +++ b/Command/TerytDownloadPlacesDatabaseCommand.php @@ -15,7 +15,7 @@ class TerytDownloadPlacesDatabaseCommand extends TerytDownloadCommand { - protected function configure() + protected function configure(): void { $this->setName('teryt:download:places') ->setDescription('Download teryt places (SIMC) database files') @@ -32,7 +32,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): void { $this->saveFile( $this->getApiClient()->getPlacesData(), diff --git a/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php b/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php index 73ea248..de5f839 100644 --- a/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php +++ b/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php @@ -15,7 +15,7 @@ class TerytDownloadPlacesDictionaryDatabaseCommand extends TerytDownloadCommand { - protected function configure() + protected function configure(): void { $this->setName('teryt:download:places-dictionary') ->setDescription('Download teryt places dictionary (WMRODZ) database files') @@ -32,7 +32,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): void { $this->saveFile( $this->getApiClient()->getPlacesDictionaryData(), diff --git a/Command/TerytDownloadStreetsDatabaseCommand.php b/Command/TerytDownloadStreetsDatabaseCommand.php index caf57e0..a27a3d1 100644 --- a/Command/TerytDownloadStreetsDatabaseCommand.php +++ b/Command/TerytDownloadStreetsDatabaseCommand.php @@ -15,7 +15,7 @@ class TerytDownloadStreetsDatabaseCommand extends TerytDownloadCommand { - protected function configure() + protected function configure(): void { $this->setName('teryt:download:streets') ->setDescription('Download teryt streets database files') @@ -32,7 +32,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): void { $this->saveFile( $this->getApiClient()->getStreetsData(), diff --git a/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php b/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php index b990d84..cbfd62c 100644 --- a/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php +++ b/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php @@ -15,7 +15,7 @@ class TerytDownloadTerritorialDivisionDatabaseCommand extends TerytDownloadCommand { - protected function configure() + protected function configure(): void { $this->setName('teryt:download:territorial-division') ->setDescription('Download teryt territorial division (TERC) database files') @@ -32,7 +32,7 @@ protected function configure() ); } - protected function execute(InputInterface $input, OutputInterface $output) + protected function execute(InputInterface $input, OutputInterface $output): void { $this->saveFile( $this->getApiClient()->getTerritorialDivisionData(), diff --git a/Command/TerytImportCommand.php b/Command/TerytImportCommand.php index e445b30..78bb20f 100644 --- a/Command/TerytImportCommand.php +++ b/Command/TerytImportCommand.php @@ -9,18 +9,24 @@ namespace FSi\Bundle\TerytDatabaseBundle\Command; +use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\Common\Persistence\ObjectManager; use Hobnob\XmlStreamReader\Parser; use SimpleXMLElement; -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -abstract class TerytImportCommand extends ContainerAwareCommand +abstract class TerytImportCommand extends Command { const FLUSH_FREQUENCY = 2000; + /** + * @var ManagerRegistry + */ + private $managerRegistry; + /** @var resource */ protected $handle; @@ -29,11 +35,18 @@ abstract class TerytImportCommand extends ContainerAwareCommand */ private $progressBar; + public function __construct(ManagerRegistry $managerRegistry) + { + parent::__construct(); + + $this->managerRegistry = $managerRegistry; + } + private $recordsCount = 0; /** * @param SimpleXMLElement $node - * @param \Doctrine\Common\Persistence\ObjectManager $om + * @param ObjectManager $om * @return \FSi\Bundle\TerytDatabaseBundle\Teryt\Import\NodeConverter */ abstract public function getNodeConverter(SimpleXMLElement $node, ObjectManager $om); @@ -135,11 +148,8 @@ private function importXmlFile(Parser $xmlParser, $xmlFile) fclose($this->handle); } - /** - * @return ObjectManager - */ - private function getObjectManager() + private function getObjectManager(): ObjectManager { - return $this->getContainer()->get('doctrine')->getManager(); + return $this->managerRegistry->getManager(); } } diff --git a/DataFixtures/ORM/LoadCommunityTypeData.php b/DataFixtures/ORM/LoadCommunityTypeData.php index 0dbd0da..5f7e4ba 100644 --- a/DataFixtures/ORM/LoadCommunityTypeData.php +++ b/DataFixtures/ORM/LoadCommunityTypeData.php @@ -2,11 +2,11 @@ namespace FSi\Bundle\TerytDatabaseBundle\DataFixtures\ORM; -use Doctrine\Common\DataFixtures\FixtureInterface; +use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use FSi\Bundle\TerytDatabaseBundle\Entity\CommunityType; -class LoadCommunityTypeData implements FixtureInterface +class LoadCommunityTypeData implements ORMFixtureInterface { protected $communityTypes = array( 1 => 'gmina miejska', @@ -31,4 +31,4 @@ public function load(ObjectManager $manager) $manager->flush(); } } -} \ No newline at end of file +} diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 534c829..8666f53 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -4,17 +4,17 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - - Guzzle\Http\Client - - - + + %kernel.root_dir% + - + %fsi_teryt_db.api.url% %fsi_teryt_db.api.username% %fsi_teryt_db.api.password% + + diff --git a/Teryt/Api/Client.php b/Teryt/Api/Client.php index b5d5668..db2e8a2 100644 --- a/Teryt/Api/Client.php +++ b/Teryt/Api/Client.php @@ -9,6 +9,7 @@ namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Api; +use SoapClient; use SplTempFileObject; class Client @@ -29,7 +30,7 @@ class Client private $password; /** - * @var \SoapClient + * @var SoapClient */ private $soapClient; @@ -42,17 +43,17 @@ public function __construct(string $url, string $username, string $password) $this->initClient(); } - public function getTerritorialDivisionData() : SplTempFileObject + public function getTerritorialDivisionData(): SplTempFileObject { return $this->getFile('PobierzKatalogTERC'); } - public function getPlacesData() : SplTempFileObject + public function getPlacesData(): SplTempFileObject { return $this->getFile('PobierzKatalogSIMC'); } - public function getStreetsData() : SplTempFileObject + public function getStreetsData(): SplTempFileObject { return $this->getFile('PobierzKatalogULIC'); } @@ -62,7 +63,7 @@ public function getPlacesDictionaryData() : SplTempFileObject return $this->getFile('PobierzKatalogWMRODZ'); } - private function getFile($functionName) : SplTempFileObject + private function getFile($functionName): SplTempFileObject { $response = $this->makeCall($functionName, [ 'DataStanu' => (new \DateTime())->format('Y-m-d') @@ -78,7 +79,7 @@ private function makeCall($functionName, array $args) return $this->soapClient->__soapCall($functionName, [$args]); } - private function prepareTempFile($data) : SplTempFileObject + private function prepareTempFile($data): SplTempFileObject { $tempXml = new SplTempFileObject(); $tempXml->fwrite(base64_decode($data)); @@ -86,13 +87,14 @@ private function prepareTempFile($data) : SplTempFileObject return $tempXml; } - private function initClient() + private function initClient(): void { $this->soapClient = new TerytSoapClient($this->url, [ 'soap_version' => SOAP_1_1, 'exceptions' => true, 'cache_wsdl' => WSDL_CACHE_BOTH, ]); + $this->soapClient->addUserToken($this->username, $this->password); } } diff --git a/Teryt/Api/TerytSoapClient.php b/Teryt/Api/TerytSoapClient.php index 38ca664..eca0144 100644 --- a/Teryt/Api/TerytSoapClient.php +++ b/Teryt/Api/TerytSoapClient.php @@ -23,7 +23,7 @@ class TerytSoapClient extends SoapClient */ private $digest; - public function addUserToken(string $username, string $password, bool $digest = false) + public function addUserToken(string $username, string $password, bool $digest = false): void { $this->username = $username; $this->password = $password; diff --git a/Teryt/Api/WSASoap.php b/Teryt/Api/WSASoap.php index ff5571e..0240015 100644 --- a/Teryt/Api/WSASoap.php +++ b/Teryt/Api/WSASoap.php @@ -32,7 +32,7 @@ public function __construct(DOMDocument $doc) $this->locateHeader(); } - public function addAction($action) + public function addAction(string $action): void { /* Add the WSA Action */ $header = $this->locateHeader(); @@ -41,14 +41,14 @@ public function addAction($action) $header->appendChild($nodeAction); } - public function getDoc() + public function getDoc(): ?DOMDocument { return $this->soapDoc; } private function locateHeader() { - if ($this->header == null) { + if ($this->header === null) { $headers = $this->SOAPXPath->query('//wssoap:Envelope/wssoap:Header'); $header = $headers->item(0); if (!$header) { diff --git a/composer.json b/composer.json index 13c7958..a0096a5 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,8 @@ ], "require": { "php": ">=7.1", + "ext-dom": "*", + "ext-simplexml": "*", "ext-soap": "*", "symfony/framework-bundle": "^3.4|^4.0", "symfony/console": "^3.4|^4.0", @@ -20,7 +22,8 @@ "doctrine/common": "^2.5", "hobnob/xml-stream-reader": "^1.0", "doctrine/doctrine-fixtures-bundle": "^3.1", - "robrichards/wse-php": "^2.0" + "robrichards/wse-php": "^2.0", + "robrichards/xmlseclibs": "^3.0" }, "require-dev": { "ext-pdo_sqlite": "*", From 9c47b978b963511cc7e841f2b6ddf4ce34f373e4 Mon Sep 17 00:00:00 2001 From: Lukasz Cybula Date: Tue, 19 Mar 2019 11:23:05 +0100 Subject: [PATCH 3/3] Added missing copyright notices and strict types declaration --- Behat/Context/CommandContext.php | 11 +++++++++-- Behat/Context/Console/ApplicationTester.php | 9 +++++++++ Behat/Context/DataContext.php | 11 ++++++++++- Behat/Context/DownloadTerytCommandContext.php | 9 +++++++++ Behat/Context/ImportTerytCommandContext.php | 12 ++++++++++-- Behat/Fixtures/Project/app/AppKernel.php | 9 +++++++++ Command/TerytDownloadCommand.php | 2 ++ Command/TerytDownloadPlacesDatabaseCommand.php | 2 ++ .../TerytDownloadPlacesDictionaryDatabaseCommand.php | 2 ++ Command/TerytDownloadStreetsDatabaseCommand.php | 2 ++ ...rytDownloadTerritorialDivisionDatabaseCommand.php | 2 ++ Command/TerytImportCommand.php | 2 ++ Command/TerytImportPlacesCommand.php | 2 ++ Command/TerytImportPlacesDictionaryCommand.php | 2 ++ Command/TerytImportStreetsCommand.php | 2 ++ Command/TerytImportTerritorialDivisionCommand.php | 2 ++ DataFixtures/ORM/LoadCommunityTypeData.php | 9 +++++++++ DependencyInjection/Configuration.php | 2 ++ DependencyInjection/FSITerytDbExtension.php | 2 ++ Entity/Community.php | 4 +++- Entity/CommunityType.php | 4 +++- Entity/District.php | 4 +++- Entity/Place.php | 4 +++- Entity/PlaceType.php | 4 +++- Entity/Province.php | 4 +++- Entity/Street.php | 4 +++- .../TerritorialDivisionNodeConverterException.php | 4 +++- FSiTerytDbBundle.php | 5 +++-- Model/Place/Place.php | 2 ++ Model/Place/Street.php | 2 ++ Model/Place/Type.php | 4 +++- Model/Territory/Community.php | 2 ++ Model/Territory/CommunityType.php | 4 +++- Model/Territory/District.php | 2 ++ Model/Territory/Province.php | 2 ++ Model/Territory/Territory.php | 2 ++ Teryt/Api/Client.php | 2 ++ Teryt/Api/TerytSoapClient.php | 9 +++++++++ Teryt/Api/WSASoap.php | 9 +++++++++ Teryt/Import/NodeConverter.php | 2 ++ Teryt/Import/PlacesDictionaryNodeConverter.php | 2 ++ Teryt/Import/PlacesNodeConverter.php | 2 ++ Teryt/Import/StreetsNodeConverter.php | 2 ++ Teryt/Import/TerritorialDivisionNodeConverter.php | 2 ++ .../Import/PlacesDictionaryNodeConverterSpec.php | 9 +++++++++ .../Teryt/Import/PlacesNodeConverterSpec.php | 9 +++++++++ .../Teryt/Import/StreetsNodeConverterSpec.php | 9 +++++++++ .../Import/TerritorialDivisionNodeConverterSpec.php | 9 +++++++++ 48 files changed, 200 insertions(+), 17 deletions(-) diff --git a/Behat/Context/CommandContext.php b/Behat/Context/CommandContext.php index 95aed15..f1b08ac 100644 --- a/Behat/Context/CommandContext.php +++ b/Behat/Context/CommandContext.php @@ -1,11 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Behat\Context; use Behat\Symfony2Extension\Context\KernelAwareContext; use FSi\Bundle\TerytDatabaseBundle\Behat\Context\Console\ApplicationTester; -use Guzzle\Http\Message\Response; -use Guzzle\Plugin\Mock\MockPlugin; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\HttpKernel\KernelInterface; diff --git a/Behat/Context/Console/ApplicationTester.php b/Behat/Context/Console/ApplicationTester.php index a58c52b..c495da8 100644 --- a/Behat/Context/Console/ApplicationTester.php +++ b/Behat/Context/Console/ApplicationTester.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Behat\Context\Console; use Symfony\Bundle\FrameworkBundle\Console\Application; diff --git a/Behat/Context/DataContext.php b/Behat/Context/DataContext.php index 9f69386..93c45b4 100644 --- a/Behat/Context/DataContext.php +++ b/Behat/Context/DataContext.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Behat\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; @@ -294,4 +303,4 @@ protected function findPlaceByName($name) ->getRepository('FSiTerytDbBundle:Place') ->findOneByName($name); } -} \ No newline at end of file +} diff --git a/Behat/Context/DownloadTerytCommandContext.php b/Behat/Context/DownloadTerytCommandContext.php index 20beaa8..d192ce5 100644 --- a/Behat/Context/DownloadTerytCommandContext.php +++ b/Behat/Context/DownloadTerytCommandContext.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Behat\Context; use Behat\Symfony2Extension\Context\KernelAwareContext; diff --git a/Behat/Context/ImportTerytCommandContext.php b/Behat/Context/ImportTerytCommandContext.php index 34c75ac..b9aa6f3 100644 --- a/Behat/Context/ImportTerytCommandContext.php +++ b/Behat/Context/ImportTerytCommandContext.php @@ -1,11 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Behat\Context; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use Behat\Symfony2Extension\Context\KernelAwareContext; -use Behat\Symfony2Extension\Context\KernelAwareInterface; use Symfony\Component\HttpKernel\KernelInterface; class ImportTerytCommandContext implements KernelAwareContext @@ -291,4 +299,4 @@ private function getStreetRepository() ->getManager() ->getRepository('FSiTerytDbBundle:Street'); } -} \ No newline at end of file +} diff --git a/Behat/Fixtures/Project/app/AppKernel.php b/Behat/Fixtures/Project/app/AppKernel.php index b4b62d9..5bbdb22 100644 --- a/Behat/Fixtures/Project/app/AppKernel.php +++ b/Behat/Fixtures/Project/app/AppKernel.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; diff --git a/Command/TerytDownloadCommand.php b/Command/TerytDownloadCommand.php index 472ab69..107f617 100644 --- a/Command/TerytDownloadCommand.php +++ b/Command/TerytDownloadCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use FSi\Bundle\TerytDatabaseBundle\Teryt\Api\Client; diff --git a/Command/TerytDownloadPlacesDatabaseCommand.php b/Command/TerytDownloadPlacesDatabaseCommand.php index 2a2d8ca..6bf6c08 100644 --- a/Command/TerytDownloadPlacesDatabaseCommand.php +++ b/Command/TerytDownloadPlacesDatabaseCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Symfony\Component\Console\Input\InputArgument; diff --git a/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php b/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php index de5f839..526539d 100644 --- a/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php +++ b/Command/TerytDownloadPlacesDictionaryDatabaseCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Symfony\Component\Console\Input\InputArgument; diff --git a/Command/TerytDownloadStreetsDatabaseCommand.php b/Command/TerytDownloadStreetsDatabaseCommand.php index a27a3d1..de4cf43 100644 --- a/Command/TerytDownloadStreetsDatabaseCommand.php +++ b/Command/TerytDownloadStreetsDatabaseCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Symfony\Component\Console\Input\InputArgument; diff --git a/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php b/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php index cbfd62c..442c2e7 100644 --- a/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php +++ b/Command/TerytDownloadTerritorialDivisionDatabaseCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Symfony\Component\Console\Input\InputArgument; diff --git a/Command/TerytImportCommand.php b/Command/TerytImportCommand.php index 78bb20f..cf2a256 100644 --- a/Command/TerytImportCommand.php +++ b/Command/TerytImportCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Doctrine\Common\Persistence\ManagerRegistry; diff --git a/Command/TerytImportPlacesCommand.php b/Command/TerytImportPlacesCommand.php index 67d4745..0b7ed78 100644 --- a/Command/TerytImportPlacesCommand.php +++ b/Command/TerytImportPlacesCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Doctrine\Common\Persistence\ObjectManager; diff --git a/Command/TerytImportPlacesDictionaryCommand.php b/Command/TerytImportPlacesDictionaryCommand.php index f57c933..0bc28b4 100644 --- a/Command/TerytImportPlacesDictionaryCommand.php +++ b/Command/TerytImportPlacesDictionaryCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Doctrine\Common\Persistence\ObjectManager; diff --git a/Command/TerytImportStreetsCommand.php b/Command/TerytImportStreetsCommand.php index 75ff886..e3f2cd2 100644 --- a/Command/TerytImportStreetsCommand.php +++ b/Command/TerytImportStreetsCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Doctrine\Common\Persistence\ObjectManager; diff --git a/Command/TerytImportTerritorialDivisionCommand.php b/Command/TerytImportTerritorialDivisionCommand.php index 74b4588..c2ce7ef 100644 --- a/Command/TerytImportTerritorialDivisionCommand.php +++ b/Command/TerytImportTerritorialDivisionCommand.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Command; use Doctrine\Common\Persistence\ObjectManager; diff --git a/DataFixtures/ORM/LoadCommunityTypeData.php b/DataFixtures/ORM/LoadCommunityTypeData.php index 5f7e4ba..8912b33 100644 --- a/DataFixtures/ORM/LoadCommunityTypeData.php +++ b/DataFixtures/ORM/LoadCommunityTypeData.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\DataFixtures\ORM; use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface; diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 4d0d4a3..a822918 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; diff --git a/DependencyInjection/FSITerytDbExtension.php b/DependencyInjection/FSITerytDbExtension.php index 76c1ec0..2cdacc0 100644 --- a/DependencyInjection/FSITerytDbExtension.php +++ b/DependencyInjection/FSITerytDbExtension.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; diff --git a/Entity/Community.php b/Entity/Community.php index 16cf2ab..9ec5568 100644 --- a/Entity/Community.php +++ b/Entity/Community.php @@ -7,10 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Entity; use FSi\Bundle\TerytDatabaseBundle\Model\Territory\Community as BaseCommunity; class Community extends BaseCommunity { -} \ No newline at end of file +} diff --git a/Entity/CommunityType.php b/Entity/CommunityType.php index ae8baae..4777c54 100644 --- a/Entity/CommunityType.php +++ b/Entity/CommunityType.php @@ -7,10 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Entity; use FSi\Bundle\TerytDatabaseBundle\Model\Territory\CommunityType as BaseCommunityType; class CommunityType extends BaseCommunityType { -} \ No newline at end of file +} diff --git a/Entity/District.php b/Entity/District.php index f3ebba7..3ebfed8 100644 --- a/Entity/District.php +++ b/Entity/District.php @@ -7,10 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Entity; use FSi\Bundle\TerytDatabaseBundle\Model\Territory\District as BaseDistrict; class District extends BaseDistrict { -} \ No newline at end of file +} diff --git a/Entity/Place.php b/Entity/Place.php index 9f860d0..87821bc 100644 --- a/Entity/Place.php +++ b/Entity/Place.php @@ -7,10 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Entity; use FSi\Bundle\TerytDatabaseBundle\Model\Place\Place as BasePlace; class Place extends BasePlace { -} \ No newline at end of file +} diff --git a/Entity/PlaceType.php b/Entity/PlaceType.php index 50ed66b..4c06dc7 100644 --- a/Entity/PlaceType.php +++ b/Entity/PlaceType.php @@ -7,10 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Entity; use FSi\Bundle\TerytDatabaseBundle\Model\Place\Type; class PlaceType extends Type { -} \ No newline at end of file +} diff --git a/Entity/Province.php b/Entity/Province.php index 38479d9..b52fd87 100644 --- a/Entity/Province.php +++ b/Entity/Province.php @@ -7,10 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Entity; use FSi\Bundle\TerytDatabaseBundle\Model\Territory\Province as BaseProvince; class Province extends BaseProvince { -} \ No newline at end of file +} diff --git a/Entity/Street.php b/Entity/Street.php index 1a18d76..4a47a78 100644 --- a/Entity/Street.php +++ b/Entity/Street.php @@ -7,10 +7,12 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Entity; use FSi\Bundle\TerytDatabaseBundle\Model\Place\Street as BaseStreet; class Street extends BaseStreet { -} \ No newline at end of file +} diff --git a/Exception/TerritorialDivisionNodeConverterException.php b/Exception/TerritorialDivisionNodeConverterException.php index 2c7595a..c8c9416 100644 --- a/Exception/TerritorialDivisionNodeConverterException.php +++ b/Exception/TerritorialDivisionNodeConverterException.php @@ -7,8 +7,10 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Exception; class TerritorialDivisionNodeConverterException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/FSiTerytDbBundle.php b/FSiTerytDbBundle.php index 0965bf4..9919ffd 100644 --- a/FSiTerytDbBundle.php +++ b/FSiTerytDbBundle.php @@ -7,10 +7,11 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle; use FSi\Bundle\TerytDatabaseBundle\DependencyInjection\FSITerytDbExtension; -use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; /** @@ -26,4 +27,4 @@ public function getContainerExtension() return $this->extension; } -} \ No newline at end of file +} diff --git a/Model/Place/Place.php b/Model/Place/Place.php index be5f914..3fb5b7c 100644 --- a/Model/Place/Place.php +++ b/Model/Place/Place.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Place; use Doctrine\Common\Collections\ArrayCollection; diff --git a/Model/Place/Street.php b/Model/Place/Street.php index 88a4a5f..c2d8ddf 100644 --- a/Model/Place/Street.php +++ b/Model/Place/Street.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Place; class Street diff --git a/Model/Place/Type.php b/Model/Place/Type.php index 1ee0c8f..c137cf2 100644 --- a/Model/Place/Type.php +++ b/Model/Place/Type.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Place; use Doctrine\Common\Collections\ArrayCollection; @@ -71,4 +73,4 @@ public function getPlaces() { return $this->places; } -} \ No newline at end of file +} diff --git a/Model/Territory/Community.php b/Model/Territory/Community.php index 93f81ea..9bf98fc 100644 --- a/Model/Territory/Community.php +++ b/Model/Territory/Community.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Territory; use Doctrine\Common\Collections\ArrayCollection; diff --git a/Model/Territory/CommunityType.php b/Model/Territory/CommunityType.php index 6abb509..fe5d029 100644 --- a/Model/Territory/CommunityType.php +++ b/Model/Territory/CommunityType.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Territory; use Doctrine\Common\Collections\ArrayCollection; @@ -72,4 +74,4 @@ public function getCommunities() { return $this->communities; } -} \ No newline at end of file +} diff --git a/Model/Territory/District.php b/Model/Territory/District.php index 32509bd..1d6550a 100644 --- a/Model/Territory/District.php +++ b/Model/Territory/District.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Territory; use Doctrine\Common\Collections\ArrayCollection; diff --git a/Model/Territory/Province.php b/Model/Territory/Province.php index e4dd03c..afc5000 100644 --- a/Model/Territory/Province.php +++ b/Model/Territory/Province.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Territory; use Doctrine\Common\Collections\ArrayCollection; diff --git a/Model/Territory/Territory.php b/Model/Territory/Territory.php index 703c64b..abda7f6 100644 --- a/Model/Territory/Territory.php +++ b/Model/Territory/Territory.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Model\Territory; class Territory diff --git a/Teryt/Api/Client.php b/Teryt/Api/Client.php index db2e8a2..3270f51 100644 --- a/Teryt/Api/Client.php +++ b/Teryt/Api/Client.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Api; use SoapClient; diff --git a/Teryt/Api/TerytSoapClient.php b/Teryt/Api/TerytSoapClient.php index eca0144..a407dea 100644 --- a/Teryt/Api/TerytSoapClient.php +++ b/Teryt/Api/TerytSoapClient.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Api; use DOMDocument; diff --git a/Teryt/Api/WSASoap.php b/Teryt/Api/WSASoap.php index 0240015..e4641b4 100644 --- a/Teryt/Api/WSASoap.php +++ b/Teryt/Api/WSASoap.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Api; use DOMDocument; diff --git a/Teryt/Import/NodeConverter.php b/Teryt/Import/NodeConverter.php index 1f8b2b9..460e44a 100644 --- a/Teryt/Import/NodeConverter.php +++ b/Teryt/Import/NodeConverter.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use Doctrine\Common\Persistence\ObjectManager; diff --git a/Teryt/Import/PlacesDictionaryNodeConverter.php b/Teryt/Import/PlacesDictionaryNodeConverter.php index 9d06d6b..66a9c67 100644 --- a/Teryt/Import/PlacesDictionaryNodeConverter.php +++ b/Teryt/Import/PlacesDictionaryNodeConverter.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use FSi\Bundle\TerytDatabaseBundle\Entity\PlaceType; diff --git a/Teryt/Import/PlacesNodeConverter.php b/Teryt/Import/PlacesNodeConverter.php index 4e8fe37..1418621 100644 --- a/Teryt/Import/PlacesNodeConverter.php +++ b/Teryt/Import/PlacesNodeConverter.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use FSi\Bundle\TerytDatabaseBundle\Entity\Community; diff --git a/Teryt/Import/StreetsNodeConverter.php b/Teryt/Import/StreetsNodeConverter.php index 774549e..8e4b06f 100644 --- a/Teryt/Import/StreetsNodeConverter.php +++ b/Teryt/Import/StreetsNodeConverter.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use FSi\Bundle\TerytDatabaseBundle\Entity\Place; diff --git a/Teryt/Import/TerritorialDivisionNodeConverter.php b/Teryt/Import/TerritorialDivisionNodeConverter.php index 94515e7..ec1e037 100644 --- a/Teryt/Import/TerritorialDivisionNodeConverter.php +++ b/Teryt/Import/TerritorialDivisionNodeConverter.php @@ -7,6 +7,8 @@ * file that was distributed with this source code. */ +declare(strict_types=1); + namespace FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use FSi\Bundle\TerytDatabaseBundle\Entity\Community; diff --git a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesDictionaryNodeConverterSpec.php b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesDictionaryNodeConverterSpec.php index 22da54b..489f283 100644 --- a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesDictionaryNodeConverterSpec.php +++ b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesDictionaryNodeConverterSpec.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace spec\FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use Doctrine\Common\Persistence\ObjectManager; diff --git a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesNodeConverterSpec.php b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesNodeConverterSpec.php index 4f668a7..7575e56 100644 --- a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesNodeConverterSpec.php +++ b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/PlacesNodeConverterSpec.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace spec\FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use Doctrine\Common\Persistence\ObjectManager; diff --git a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/StreetsNodeConverterSpec.php b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/StreetsNodeConverterSpec.php index 316e4b5..6c6026c 100644 --- a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/StreetsNodeConverterSpec.php +++ b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/StreetsNodeConverterSpec.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace spec\FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use Doctrine\Common\Persistence\ObjectManager; diff --git a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/TerritorialDivisionNodeConverterSpec.php b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/TerritorialDivisionNodeConverterSpec.php index 9771611..5db24d8 100644 --- a/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/TerritorialDivisionNodeConverterSpec.php +++ b/spec/FSi/Bundle/TerytDatabaseBundle/Teryt/Import/TerritorialDivisionNodeConverterSpec.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + namespace spec\FSi\Bundle\TerytDatabaseBundle\Teryt\Import; use Doctrine\Common\Persistence\ObjectManager;