Skip to content

Commit

Permalink
[#14733] - Renamed DM to DataMapper (namespace)
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Feb 8, 2020
1 parent efdd936 commit ded33db
Show file tree
Hide file tree
Showing 55 changed files with 279 additions and 279 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo;
namespace Phalcon\DataMapper\Pdo;

use InvalidArgumentException;
use Phalcon\DM\Pdo\Connection\AbstractConnection;
use Phalcon\DM\Pdo\Profiler\Profiler;
use Phalcon\DM\Pdo\Profiler\ProfilerInterface;
use Phalcon\DataMapper\Pdo\Connection\AbstractConnection;
use Phalcon\DataMapper\Pdo\Profiler\Profiler;
use Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface;

/**
* Provides array quoting, profiling, a new `perform()` method, new `fetch*()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Connection;
namespace Phalcon\DataMapper\Pdo\Connection;

use BadMethodCallException;
use Phalcon\DM\Pdo\Exception\CannotBindValue;
use Phalcon\DM\Pdo\Profiler\ProfilerInterface;
use Phalcon\DataMapper\Pdo\Exception\CannotBindValue;
use Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface;

/**
* Provides array quoting, profiling, a new `perform()` method, new `fetch*()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Connection;
namespace Phalcon\DataMapper\Pdo\Connection;

use Phalcon\DM\Pdo\Exception\CannotBindValue;
use Phalcon\DM\Pdo\Parser\ParserInterface;
use Phalcon\DM\Pdo\Profiler\ProfilerInterface;
use Phalcon\DataMapper\Pdo\Exception\CannotBindValue;
use Phalcon\DataMapper\Pdo\Parser\ParserInterface;
use Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface;

/**
* Provides array quoting, profiling, a new `perform()` method, new `fetch*()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Connection;
namespace Phalcon\DataMapper\Pdo\Connection;

use Phalcon\DM\Pdo\Exception\CannotDisconnect;
use Phalcon\DM\Pdo\Profiler\Profiler;
use Phalcon\DM\Pdo\Profiler\ProfilerInterface;
use Phalcon\DataMapper\Pdo\Exception\CannotDisconnect;
use Phalcon\DataMapper\Pdo\Profiler\Profiler;
use Phalcon\DataMapper\Pdo\Profiler\ProfilerInterface;

/**
* Decorates an existing PDO instance with the extended methods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Connection;
namespace Phalcon\DataMapper\Pdo\Connection;


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo;
namespace Phalcon\DataMapper\Pdo;

use Phalcon\DM\Pdo\Connection\ConnectionInterface;
use Phalcon\DM\Pdo\Exception\ConnectionNotFound;
use Phalcon\DataMapper\Pdo\Connection\ConnectionInterface;
use Phalcon\DataMapper\Pdo\Exception\ConnectionNotFound;

/**
* Manages Connection instances for default, read, and write connections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo;
namespace Phalcon\DataMapper\Pdo;

use Phalcon\DM\Pdo\Connection\ConnectionInterface;
use Phalcon\DataMapper\Pdo\Connection\ConnectionInterface;

/**
* Locates PDO connections for default, read, and write databases.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Exception;
namespace Phalcon\DataMapper\Pdo\Exception;

/**
* ExtendedPdo could not disconnect; e.g., because its PDO connection was
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Exception;
namespace Phalcon\DataMapper\Pdo\Exception;

/**
* Locator could not find a named connection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Exception;
namespace Phalcon\DataMapper\Pdo\Exception;

/**
* Base Exception class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Profiler;
namespace Phalcon\DataMapper\Pdo\Profiler;

use Psr\Log\AbstractLogger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Profiler;
namespace Phalcon\DataMapper\Pdo\Profiler;

use Phalcon\DM\Pdo\Exception\Exception;
use Phalcon\DataMapper\Pdo\Exception\Exception;
use Phalcon\Helper\Json;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
Expand Down Expand Up @@ -62,7 +62,7 @@ class Profiler implements ProfilerInterface
*/
public function __construct(<LoggerInterface> logger = null)
{
if null === logger {
if unlikely null === logger {
let logger = new MemoryLogger();
}

Expand All @@ -81,7 +81,7 @@ class Profiler implements ProfilerInterface
{
var ex, finish, params;

if this->active {
if unlikely this->active {
let finish = microtime(true),
ex = new Exception(),
params = "";
Expand Down Expand Up @@ -191,7 +191,7 @@ class Profiler implements ProfilerInterface
*/
public function start(string method) -> void
{
if this->active {
if unlikely this->active {
let this->context = [
"method" : method,
"start" : microtime(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @license https://github.com/atlasphp/Atlas.Pdo/blob/1.x/LICENSE.md
*/

namespace Phalcon\DM\Pdo\Profiler;
namespace Phalcon\DataMapper\Pdo\Profiler;

use Psr\Log\LoggerInterface;

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

declare(strict_types=1);

namespace Phalcon\Test\Database\DM\Pdo\Connection;
namespace Phalcon\Test\Database\DataMapper\Pdo\Connection;

use DatabaseTester;
use Phalcon\DM\Pdo\Connection;
use Phalcon\DataMapper\Pdo\Connection;
use Phalcon\Test\Fixtures\Migrations\InvoicesMigration;

use function date;
Expand All @@ -21,16 +21,16 @@
class CommitInTransactionRollBackCest
{
/**
* Database Tests Phalcon\DM\Pdo\Connection :: commit()/inTransaction()
* Database Tests Phalcon\DataMapper\Pdo\Connection :: commit()/inTransaction()
*
* @since 2020-01-25
*/
public function dMPdoConnectionCommitInTransaction(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection - commit()/inTransaction()');
$I->wantToTest('DataMapper\Pdo\Connection - commit()/inTransaction()');

/** @var Connection $connection */
$connection = $I->getDMConnection();
$connection = $I->getDataMapperConnection();
(new InvoicesMigration($connection));
$connection->beginTransaction();

Expand Down Expand Up @@ -64,16 +64,16 @@ public function dMPdoConnectionCommitInTransaction(DatabaseTester $I)
}

/**
* Database Tests Phalcon\DM\Pdo\Connection :: rollBack()
* Database Tests Phalcon\DataMapper\Pdo\Connection :: rollBack()
*
* @since 2020-01-25
*/
public function dMPdoConnectionRollBack(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection - rollBack()');
$I->wantToTest('DataMapper\Pdo\Connection - rollBack()');

/** @var Connection $connection */
$connection = $I->getDMConnection();
$connection = $I->getDataMapperConnection();
(new InvoicesMigration($connection));
$connection->beginTransaction();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@

declare(strict_types=1);

namespace Phalcon\Test\Database\DM\Pdo\Connection;
namespace Phalcon\Test\Database\DataMapper\Pdo\Connection;

use DatabaseTester;
use Phalcon\DM\Pdo\Connection;
use Phalcon\DataMapper\Pdo\Connection;

class ConnectDisconnectIsConnectedCest
{
/**
* Database Tests Phalcon\DM\Pdo\Connection ::
* Database Tests Phalcon\DataMapper\Pdo\Connection ::
* connect()/disconnect()/isConnected()
*
* @since 2020-01-25
*/
public function dMPdoConnectionConnectDisconnectIsConnected(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection - connect()/disconnect()/isConnected()');
$I->wantToTest('DataMapper\Pdo\Connection - connect()/disconnect()/isConnected()');

/** @var Connection $connection */
$connection = $I->getDMConnection();
$connection = $I->getDataMapperConnection();

$I->assertFalse($connection->isConnected());
$connection->connect();
Expand All @@ -37,13 +37,13 @@ public function dMPdoConnectionConnectDisconnectIsConnected(DatabaseTester $I)
}

/**
* Database Tests Phalcon\DM\Pdo\Connection :: connect() - queries
* Database Tests Phalcon\DataMapper\Pdo\Connection :: connect() - queries
*
* @since 2020-01-25
*/
public function dMPdoConnectionConnectQueries(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection - connect() - queries');
$I->wantToTest('DataMapper\Pdo\Connection - connect() - queries');

if ('mysql' === $I->getDriver()) {
/** @var Connection $connection */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@

declare(strict_types=1);

namespace Phalcon\Test\Database\DM\Pdo\Connection;
namespace Phalcon\Test\Database\DataMapper\Pdo\Connection;

use DatabaseTester;
use InvalidArgumentException;
use Phalcon\DM\Pdo\Connection;
use Phalcon\DataMapper\Pdo\Connection;

class ConstructCest
{
/**
* Database Tests Phalcon\DM\Pdo\Connection :: __construct()
* Database Tests Phalcon\DataMapper\Pdo\Connection :: __construct()
*
* @since 2020-01-25
*/
public function dMPdoConnectionConstruct(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection - __construct()');
$I->wantToTest('DataMapper\Pdo\Connection - __construct()');

/** @var Connection $connection */
$connection = $I->getDMConnection();
$connection = $I->getDataMapperConnection();

$I->assertInstanceOf(Connection::class, $connection);
}

/**
* Database Tests Phalcon\DM\Pdo\Connection :: __construct() - exception
* Database Tests Phalcon\DataMapper\Pdo\Connection :: __construct() - exception
*
* @since 2020-01-20
*/
public function dMPdoConnectionConstructException(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection - __construct() - exception');
$I->wantToTest('DataMapper\Pdo\Connection - __construct() - exception');

$I->expectThrowable(
new InvalidArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@

declare(strict_types=1);

namespace Phalcon\Test\Database\DM\Pdo\Connection;
namespace Phalcon\Test\Database\DataMapper\Pdo\Connection;

use DatabaseTester;
use PDO;
use Phalcon\DM\Pdo\Connection;
use Phalcon\DataMapper\Pdo\Connection;

class DebugInfoCest
{
/**
* Database Tests Phalcon\DM\Pdo\Connection :: __debugInfo()
* Database Tests Phalcon\DataMapper\Pdo\Connection :: __debugInfo()
*
* @since 2020-01-25
*/
public function dMPdoConnectionDebugInfo(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection - __debugInfo()');
$I->wantToTest('DataMapper\Pdo\Connection - __debugInfo()');

/** @var Connection $connection */
$connection = $I->getDMConnection();
$connection = $I->getDataMapperConnection();

$expected = [
'arguments' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@

declare(strict_types=1);

namespace Phalcon\Test\Database\DM\Pdo\Connection\Decorated;
namespace Phalcon\Test\Database\DataMapper\Pdo\Connection\Decorated;

use DatabaseTester;
use PDO;
use Phalcon\DM\Pdo\Connection\Decorated;
use Phalcon\DM\Pdo\Profiler\Profiler;
use Phalcon\DataMapper\Pdo\Connection\Decorated;
use Phalcon\DataMapper\Pdo\Profiler\Profiler;

class ConstructCest
{
/**
* Database Tests Phalcon\DM\Pdo\Connection\Decorated :: __construct()
* Database Tests Phalcon\DataMapper\Pdo\Connection\Decorated :: __construct()
*
* @since 2020-01-25
*/
public function dMPdoConnectionDecoratedConstruct(DatabaseTester $I)
{
$I->wantToTest('DM\Pdo\Connection\Decorated - __construct()');
$I->wantToTest('DataMapper\Pdo\Connection\Decorated - __construct()');

$connection = new PDO(
$I->getDatabaseDsn(),
Expand Down
Loading

0 comments on commit ded33db

Please sign in to comment.