]> git.mxchange.org Git - city.git/commitdiff
Continued a bit: (yes, very long no activity, I'm a dad now of a half-pinay)
authorRoland Haeder <roland@mxchange.org>
Mon, 27 Jun 2016 18:35:23 +0000 (20:35 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 19 Sep 2016 20:15:40 +0000 (22:15 +0200)
- Uni* LF is now default end-of-line character
- added some assertions on manager instances

Signed-off-by: Roland Haeder <roland@mxchange.org>
.gitattributes
application/city/classes/commands/html/class_CityHtmlCityMapCommand.php
application/city/classes/database/frontend/city/class_CityInformationDatabaseWrapper.php
application/city/classes/database/frontend/region/class_RegionInformationDatabaseWrapper.php
application/city/classes/filter/verifier/class_CityNameVerifierFilter.php
application/city/classes/manager/city/class_CityManager.php

index dfe0770424b2a19faf507a501ebfc23be8f54e7b..17cdcd5373ad22f616149f35b61236dfe81ebec3 100644 (file)
@@ -1,2 +1,2 @@
-# Auto detect text files and perform LF normalization
-* text=auto
+# Use Linux/Uni* line-feed for new lines (prevents converting)
+* text=lf
index 53f66c8a5451612e6ebfa8d4d5b2b2d75e98c7b9..f787793bde4c2be15d7382c31df601c9a071483b 100644 (file)
@@ -60,6 +60,9 @@ class CityHtmlCityMapCommand extends BaseCommand implements Commandable {
                // First get a UserRegistration instance
                $managerInstance = ManagerFactory::createManagerByType('city');
 
+               // Make sure the instance is valid
+               assert($managerInstance instanceof ManageableCity);
+
                // First set request and response instance
                $managerInstance->setRequestInstance($requestInstance);
                $managerInstance->setResponseInstance($responseInstance);
index 6624b56100f39db126518f70953e9099e8bd38ad..3bf431d4dbd896acaefca6eec9c1bb3f817f0c01 100644 (file)
@@ -144,6 +144,9 @@ class CityInformationDatabaseWrapper extends BaseDatabaseWrapper implements City
                // Get city manager instance
                $managerInstance = ManagerFactory::createManagerByType('city');
 
+               // Make sure the manager instance is valid
+               assert($managerInstance instanceof ManageableCity);
+
                // Set result instance
                $managerInstance->setResultInstance($resultInstance);
 
@@ -177,6 +180,9 @@ class CityInformationDatabaseWrapper extends BaseDatabaseWrapper implements City
                // Get manger instance
                $managerInstance = ManagerFactory::createManagerByType('city');
 
+               // Make sure the instance is valid
+               assert($managerInstance instanceof ManageableCity);
+
                // Set result instance
                $managerInstance->setResultInstance($resultInstance);
 
index 5dd07657a4312ab90c6ba421bfdd01e720fb46ad..53b2e8583be24b7021b0da12acb78dad9600a61d 100644 (file)
@@ -92,6 +92,9 @@ class RegionInformationDatabaseWrapper extends BaseDatabaseWrapper implements Re
                // Get region manager instance
                $managerInstance = ManagerFactory::createManagerByType('region');
 
+               // Make sure the instance is valid
+               assert($managerInstance instanceof ManageableRegion);
+
                // Set result instance
                $managerInstance->setResultInstance($resultInstance);
 
@@ -126,6 +129,9 @@ class RegionInformationDatabaseWrapper extends BaseDatabaseWrapper implements Re
                // Get manger instance
                $managerInstance = ManagerFactory::createManagerByType('region');
 
+               // Make sure the instance is valid
+               assert($managerInstance instanceof ManageableRegion);
+
                // Set result instance
                $managerInstance->setResultInstance($resultInstance);
 
index af902017824bf7e06ca0d98a2022e53e757da390..fe24113b050d54586f065266164dbe8dd7b7b067 100644 (file)
@@ -100,6 +100,9 @@ class CityNameVerifierFilter extends BaseFilter implements Filterable {
                // Get a new instance
                $managerInstance = ManagerFactory::createManagerByType('city');
 
+               // Make sure the instance is valid
+               assert($managerInstance instanceof ManageableCity);
+
                // Does the city name exist?
                $alreadyTaken = ($managerInstance->ifCityNameExists($cityName));
 
index e8bb312d4da29c1521075985191d634b858a4a76..9b8748f87a3efbb373e5a7af4f0527ab211e58a4 100644 (file)
@@ -98,7 +98,8 @@ class CityManager extends BaseManager implements ManageableCity {
                // Get region manager
                $managerInstance = ManagerFactory::createManagerByType('region');
 
-               // There should be no region created
+               // The manager instance should be valid and no region should be created
+               assert($managerInstance instanceof ManageableRegion);
                assert(!$managerInstance->ifUserHasCreatedRegion());
 
                // Create first region and get back whole result