[icinga-checkins] icinga.org: icingaweb2/feature/ inirepository-should-support-multiple-tables-13034: IniRepository: Make key column validation in the constructor more readable

git at icinga.org git at icinga.org
Fri Nov 4 10:18:35 CET 2016


Module: icingaweb2
Branch: feature/inirepository-should-support-multiple-tables-13034
Commit: ac3e182f0d4a2420ede171aca53c9273d344b5e8
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=ac3e182f0d4a2420ede171aca53c9273d344b5e8

Author: Johannes Meyer <johannes.meyer at netways.de>
Date:   Fri Nov  4 09:59:37 2016 +0100

IniRepository: Make key column validation in the constructor more readable

refs #13034

---

 library/Icinga/Repository/IniRepository.php |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/Icinga/Repository/IniRepository.php b/library/Icinga/Repository/IniRepository.php
index 08d7213..da1a57c 100644
--- a/library/Icinga/Repository/IniRepository.php
+++ b/library/Icinga/Repository/IniRepository.php
@@ -67,7 +67,7 @@ abstract class IniRepository extends Repository implements Extensible, Updatable
     {
         parent::__construct($ds); // First! Due to init().
 
-        if (! ($ds === null || $ds->getConfigObject()->getKeyColumn())) {
+        if ($ds !== null && !$ds->getConfigObject()->getKeyColumn()) {
             throw new ProgrammingError('INI repositories require their data source to provide a valid key column');
         }
     }



More information about the icinga-checkins mailing list