Skip to content

Commit

Permalink
cs
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 13, 2023
1 parent 43b2758 commit 26a93f2
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/Bridges/DatabaseDI/DatabaseExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Nette;
use Nette\Schema\Expect;
use Tracy\BlueScreen;


/**
Expand Down Expand Up @@ -66,7 +67,7 @@ public function beforeCompile()
$builder = $this->getContainerBuilder();

foreach ($this->config as $name => $config) {
if ($config->debugger ?? $builder->getByType(\Tracy\BlueScreen::class)) {
if ($config->debugger ?? $builder->getByType(BlueScreen::class)) {
$connection = $builder->getDefinition($this->prefix("$name.connection"));
$connection->addSetup('@Tracy\BlueScreen::addPanel', [
[Nette\Bridges\DatabaseTracy\ConnectionPanel::class, 'renderException'],
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ public static function createDebugPanel(
$connection,
bool $explain = true,
string $name = null
): Nette\Bridges\DatabaseTracy\ConnectionPanel {
): Nette\Bridges\DatabaseTracy\ConnectionPanel
{
$panel = new Nette\Bridges\DatabaseTracy\ConnectionPanel($connection);
$panel->explain = $explain;
$panel->name = $name;
Expand Down
4 changes: 2 additions & 2 deletions src/Database/Table/Selection.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ protected function condition($condition, array $params, $tableChain = null): voi
* More calls appends with AND.
* @param array $parameters ['column1' => 1, 'column2 > ?' => 2, 'full condition']
* @return static
* @throws \Nette\InvalidArgumentException
* @throws Nette\InvalidArgumentException
*/
public function whereOr(array $parameters)
{
Expand Down Expand Up @@ -841,7 +841,7 @@ public function insert(iterable $data)
}
}

// Primary without autoincrement, try get primary from inserting data
// Primary without autoincrement, try get primary from inserting data
} elseif ($this->primary && isset($data[$this->primary])) {
$primaryKey = $data[$this->primary];

Expand Down
3 changes: 2 additions & 1 deletion src/Database/Table/SqlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,8 @@ protected function addConditionComposition(
array $parameters,
array &$conditions,
array &$conditionsParameters
): bool {
): bool
{
if ($this->driver->isSupported(ISupplementalDriver::SUPPORT_MULTI_COLUMN_AS_OR_COND)) {
$conditionFragment = '(' . implode(' = ? AND ', $columns) . ' = ?) OR ';
$condition = substr(str_repeat($conditionFragment, count($parameters)), 0, -4);
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/Reflection.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $expectedColumns = [

switch ($driverName) {
case 'mysql':
$version = $connection->getPdo()->getAttribute(\PDO::ATTR_SERVER_VERSION);
$version = $connection->getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION);
if (version_compare($version, '8.0', '>=')) {
$expectedColumns[0]['size'] = null;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/Table/Selection.insert().phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Nette\Database\Helpers::loadFromFile($connection, __DIR__ . "/../files/{$driverN
$book = $context->table('author')->insert([
'name' => $context->literal('LOWER(?)', 'Eddard Stark'),
'web' => 'http://example.com',
'born' => new \DateTime('2011-11-11'),
'born' => new DateTime('2011-11-11'),
]); // INSERT INTO `author` (`name`, `web`) VALUES (LOWER('Eddard Stark'), 'http://example.com', '2011-11-11 00:00:00')
// id = 14

Expand Down
2 changes: 1 addition & 1 deletion tests/Database/Table/bugs/bug216.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Nette\Database\Helpers::loadFromFile($connection, __DIR__ . "/../../files/{$driv
$book = $context->table('author')->insert([
'name' => $context->literal('LOWER(?)', 'Eddard Stark'),
'web' => 'http://example.com',
'born' => new \DateTime('2011-11-11'),
'born' => new DateTime('2011-11-11'),
]); // INSERT INTO `author` (`name`, `web`) VALUES (LOWER('Eddard Stark'), 'http://example.com', '2011-11-11 00:00:00')
// id = 14

Expand Down

0 comments on commit 26a93f2

Please sign in to comment.