Skip to content

Commit 3f71388

Browse files
committed
typos, PHP 5.5 syntax
1 parent 285b7a2 commit 3f71388

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/Database/IConventions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface IConventions
1616
/**
1717
* Returns primary key for table.
1818
* @param string
19-
* @return string
19+
* @return string|array|NULL
2020
*/
2121
function getPrimary($table);
2222

src/Database/Table/Selection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Selection extends Nette\Object implements \Iterator, IRowContainer, \Array
3333
/** @var string table name */
3434
protected $name;
3535

36-
/** @var string primary key field name */
36+
/** @var string|array|NULL primary key field name */
3737
protected $primary;
3838

3939
/** @var string|bool primary column sequence name, FALSE for autodetection */
@@ -122,7 +122,7 @@ public function getName()
122122

123123
/**
124124
* @param bool
125-
* @return string|array
125+
* @return string|array|NULL
126126
*/
127127
public function getPrimary($need = TRUE)
128128
{

src/Database/Table/SqlBuilder.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public function __construct($tableName, Context $context)
8080
$this->driver = $context->getConnection()->getSupplementalDriver();
8181
$this->conventions = $context->getConventions();
8282
$this->structure = $context->getStructure();
83-
8483
$this->delimitedTable = implode('.', array_map([$this->driver, 'delimite'], explode('.', $tableName)));
8584
}
8685

@@ -151,7 +150,6 @@ public function buildSelectQuery($columns = NULL)
151150
} else {
152151
$prefix = $joins ? "{$this->delimitedTable}." : '';
153152
$querySelect = $this->buildSelect([$prefix . '*']);
154-
155153
}
156154

157155
$queryJoins = $this->buildQueryJoins($joins);
@@ -503,14 +501,11 @@ public function parseJoinsCb(& $joins, $match)
503501
protected function buildQueryJoins(array $joins)
504502
{
505503
$return = '';
506-
foreach ($joins as $join) {
507-
list($joinTable, $joinAlias, $table, $tableColumn, $joinColumn) = $join;
508-
504+
foreach ($joins as list($joinTable, $joinAlias, $table, $tableColumn, $joinColumn)) {
509505
$return .=
510506
" LEFT JOIN {$joinTable}" . ($joinTable !== $joinAlias ? " {$joinAlias}" : '') .
511507
" ON {$table}.{$tableColumn} = {$joinAlias}.{$joinColumn}";
512508
}
513-
514509
return $return;
515510
}
516511

@@ -539,9 +534,8 @@ protected function buildQueryEnd()
539534

540535
protected function tryDelimite($s)
541536
{
542-
$driver = $this->driver;
543-
return preg_replace_callback('#(?<=[^\w`"\[?]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|\z)#i', function ($m) use ($driver) {
544-
return strtoupper($m[0]) === $m[0] ? $m[0] : $driver->delimite($m[0]);
537+
return preg_replace_callback('#(?<=[^\w`"\[?]|^)[a-z_][a-z0-9_]*(?=[^\w`"(\]]|\z)#i', function ($m) {
538+
return strtoupper($m[0]) === $m[0] ? $m[0] : $this->driver->delimite($m[0]);
545539
}, $s);
546540
}
547541

0 commit comments

Comments
 (0)