From 0bf6dc24a857baeb2c0d040dfd55d50b93bc7246 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 30 Oct 2014 09:53:55 +0100 Subject: [PATCH] monitoring: Use command transports constants in the command transport factory --- .../Monitoring/Command/Transport/CommandTransport.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php b/modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php index 53dff5f8c..e5c9f7ba1 100644 --- a/modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php +++ b/modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php @@ -53,19 +53,21 @@ abstract class CommandTransport public static function fromConfig(Zend_Config $config) { switch (strtolower($config->transport)) { - case 'remote': + case RemoteCommandFile::TRANSPORT: $transport = new RemoteCommandFile(); break; - case 'local': + case LocalCommandFile::TRANSPORT: case '': // Casting null to string is the empty string $transport = new LocalCommandFile(); break; default: throw new ConfigurationError( 'Can\'t create command transport \'%s\'. Invalid transport defined in \'%s\'.' - . ' Use one of \'local\' or \'remote\'.', + . ' Use one of \'%s\' or \'%s\'.', $config->transport, - self::$config->getConfigFile() + self::$config->getConfigFile(), + LocalCommandFile::TRANSPORT, + RemoteCommandFile::TRANSPORT ); } unset($config->transport);