Permalink
Browse files

fix cs

- clean tailing spaces
- fix typo
  • Loading branch information...
1 parent e0a060c commit c6974129f986e48b9c3ba0d15a6f86eca184377d @ClemensSahs committed Jan 23, 2013
@@ -18,7 +18,7 @@
use Zend\Mvc\Service\Exception\DbAdapterManagerAdapterAlreadyRegistered;
use Zend\Mvc\Service\Exception\DbAdapterManagerAdapterCoundInit;
use Zend\Mvc\Service\Exception\DbAdapterManagerAdapterNotExist;
-use Zend\Mvc\Service\Exception\DbAdapterManagerAdapterConfigNotVaild;
+use Zend\Mvc\Service\Exception\DbAdapterManagerAdapterConfigNotValid;
use Exception;
class DbAdapterManager implements ServiceLocatorAwareInterface
@@ -148,7 +148,7 @@ public function getAdapter($key)
/**
* @param string $key
- * @throws DbAdapterManagerAdapterConfigNotVaild
+ * @throws DbAdapterManagerAdapterConfigNotValid
* @return Adapter
*/
protected function initAdapter($key)
@@ -160,7 +160,7 @@ protected function initAdapter($key)
} elseif (!is_array($config) ||
!array_key_exists('driver', $config)
) {
- throw new DbAdapterManagerAdapterConfigNotVaild(sprintf("adapter config on key (%s) is not an valid key or array", $key));
+ throw new DbAdapterManagerAdapterConfigNotValid(sprintf("adapter config on key (%s) is not an valid key or array", $key));
} else {
try {
$this->_dbAdapter[ $key ] = $this->adapterFactory( $config, $this->getServiceLocator() );
@@ -238,10 +238,10 @@ protected function getDriverObjectFromConfig ($config, ServiceLocatorInterface $
}
if ( !is_object($driver) ) {
- throw new DbAdapterManagerAdapterConfigNotVaild("database config['driver'] string is not a confirmed class/service name");
+ throw new DbAdapterManagerAdapterConfigNotValid("database config['driver'] string is not a confirmed class/service name");
}
} else {
- throw new DbAdapterManagerAdapterConfigNotVaild("database config['driver'] must be a array or string of class/service name");
+ throw new DbAdapterManagerAdapterConfigNotValid("database config['driver'] must be a array or string of class/service name");
}
goto RETURN_OBJECT;
@@ -256,7 +256,7 @@ protected function getDriverObjectFromConfig ($config, ServiceLocatorInterface $
/**
* @param array $config
* @param ServiceLocatorInterface $serviceLocator
- * @throws DbAdapterManagerAdapterConfigNotVaild
+ * @throws DbAdapterManagerAdapterConfigNotValid
* @return Adapter
*/
public function adapterFactory($config, ServiceLocatorInterface $serviceLocator=null)
@@ -292,7 +292,7 @@ public function adapterFactory($config, ServiceLocatorInterface $serviceLocator=
} catch (\Exception $exception) {
throw new DbAdapterManagerAdapterCoundInit("adapter cound init",0,$exception);
}
-
+
return $adapter;
}
}
@@ -2,6 +2,6 @@
namespace Zend\Mvc\Service\Exception;
-class DbAdapterManagerAdapterConfigNotVaild extends \RuntimeException implements ExceptionInterface
+class DbAdapterManagerAdapterConfigNotValid extends \RuntimeException implements ExceptionInterface
{
}
@@ -92,7 +92,7 @@ public function testInitDbAdapter()
if (extension_loaded('mysqli')) {
$adapter = $dam->getAdapter('mysqliDb');
$this->assertInstanceOf('Zend\Db\Adapter\Driver\Mysqli\Mysqli', $adapter->driver);
-
+
$this->assertTrue( $dam->hasAdapter('mysqliDb') );
unset($adapter);
}
@@ -107,7 +107,7 @@ public function testInitDbAdapterAlias()
$adapter1 = $dam->getAdapter('sqlliteDb');
$adapter2 = $dam->getAdapter('sqlliteDb2');
$adapter3 = $dam->getAdapter('sqlliteDb3');
-
+
$this->assertSame($adapter1, $adapter2);
$this->assertSame($adapter1, $adapter3);
unset($adapter);

0 comments on commit c697412

Please sign in to comment.