Skip to content

Commit 1b974d3

Browse files
committed
renamed IConventions -> Conventions
1 parent 689c298 commit 1b974d3

9 files changed

+25
-17
lines changed

src/Database/IConventions.php renamed to src/Database/Conventions.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use Nette\Database\Conventions\AmbiguousReferenceKeyException;
1313

1414

15-
interface IConventions
15+
interface Conventions
1616
{
1717
/**
1818
* Returns primary key for table.
@@ -40,3 +40,6 @@ function getHasManyReference(string $table, string $key): ?array;
4040
*/
4141
function getBelongsToReference(string $table, string $key): ?array;
4242
}
43+
44+
45+
interface_exists(IConventions::class);

src/Database/Conventions/DiscoveredConventions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
namespace Nette\Database\Conventions;
1111

12-
use Nette\Database\IConventions;
12+
use Nette\Database\Conventions;
1313
use Nette\Database\IStructure;
1414

1515

1616
/**
1717
* Conventions based on database structure.
1818
*/
19-
class DiscoveredConventions implements IConventions
19+
class DiscoveredConventions implements Conventions
2020
{
2121
/** @var IStructure */
2222
protected $structure;

src/Database/Conventions/StaticConventions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
namespace Nette\Database\Conventions;
1111

1212
use Nette;
13-
use Nette\Database\IConventions;
13+
use Nette\Database\Conventions;
1414

1515

1616
/**
1717
* Conventions based on static definition.
1818
*/
19-
class StaticConventions implements IConventions
19+
class StaticConventions implements Conventions
2020
{
2121
use Nette\SmartObject;
2222

src/Database/Explorer.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Explorer
2626
/** @var IStructure */
2727
private $structure;
2828

29-
/** @var IConventions */
29+
/** @var Conventions */
3030
private $conventions;
3131

3232
/** @var Nette\Caching\IStorage */
@@ -35,8 +35,8 @@ class Explorer
3535

3636
public function __construct(
3737
Connection $connection,
38-
IStructure $structure,
39-
IConventions $conventions = null,
38+
Structure $structure,
39+
Conventions $conventions = null,
4040
Nette\Caching\IStorage $cacheStorage = null
4141
) {
4242
$this->connection = $connection;
@@ -112,7 +112,7 @@ public function getStructure(): IStructure
112112
}
113113

114114

115-
public function getConventions(): IConventions
115+
public function getConventions(): Conventions
116116
{
117117
return $this->conventions;
118118
}

src/Database/Table/GroupedSelection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace Nette\Database\Table;
1111

1212
use Nette;
13+
use Nette\Database\Conventions;
1314
use Nette\Database\Explorer;
14-
use Nette\Database\IConventions;
1515

1616

1717
/**
@@ -38,7 +38,7 @@ class GroupedSelection extends Selection
3838
*/
3939
public function __construct(
4040
Explorer $explorer,
41-
IConventions $conventions,
41+
Conventions $conventions,
4242
string $tableName,
4343
string $column,
4444
Selection $refTable,

src/Database/Table/Selection.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace Nette\Database\Table;
1111

1212
use Nette;
13+
use Nette\Database\Conventions;
1314
use Nette\Database\Explorer;
14-
use Nette\Database\IConventions;
1515

1616

1717
/**
@@ -28,7 +28,7 @@ class Selection implements \Iterator, IRowContainer, \ArrayAccess, \Countable
2828
/** @var Explorer back compatibility */
2929
protected $context;
3030

31-
/** @var IConventions */
31+
/** @var Conventions */
3232
protected $conventions;
3333

3434
/** @var Nette\Caching\Cache */
@@ -88,7 +88,7 @@ class Selection implements \Iterator, IRowContainer, \ArrayAccess, \Countable
8888
*/
8989
public function __construct(
9090
Explorer $explorer,
91-
IConventions $conventions,
91+
Conventions $conventions,
9292
string $tableName,
9393
Nette\Caching\IStorage $cacheStorage = null
9494
) {

src/Database/Table/SqlBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace Nette\Database\Table;
1111

1212
use Nette;
13+
use Nette\Database\Conventions;
1314
use Nette\Database\Driver;
1415
use Nette\Database\Explorer;
15-
use Nette\Database\IConventions;
1616
use Nette\Database\IStructure;
1717
use Nette\Database\SqlLiteral;
1818

@@ -28,7 +28,7 @@ class SqlBuilder
2828
/** @var string */
2929
protected $tableName;
3030

31-
/** @var IConventions */
31+
/** @var Conventions */
3232
protected $conventions;
3333

3434
/** @var string delimited table name */

src/compatibility-intf.php

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
interface ISupplementalDriver
1515
{
1616
}
17+
/** @deprecated use Nette\Database\Conventions */
18+
interface IConventions
19+
{
20+
}
1721
} elseif (!interface_exists(ISupplementalDriver::class)) {
1822
class_alias(Driver::class, ISupplementalDriver::class);
23+
class_alias(Conventions::class, IConventions::class);
1924
}

tests/Database.DI/DatabaseExtension.multiple.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ test('', function () {
5858
Assert::type(Nette\Database\Structure::class, $explorer->getStructure());
5959
Assert::same($explorer->getStructure(), $container->getByType(Nette\Database\IStructure::class));
6060
Assert::type(Nette\Database\Conventions\DiscoveredConventions::class, $explorer->getConventions());
61-
Assert::same($explorer->getConventions(), $container->getByType(Nette\Database\IConventions::class));
61+
Assert::same($explorer->getConventions(), $container->getByType(Nette\Database\Conventions::class));
6262

6363
// aliases
6464
Assert::same($connection, $container->getService('nette.database.first'));

0 commit comments

Comments
 (0)