mirror of
https://github.com/dg/dibi.git
synced 2025-07-31 03:10:14 +02:00
coding style: fixed spaces & use statements order
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Dibi\Type;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
||||
|
@@ -69,5 +69,4 @@ class DibiExtension22 extends Nette\DI\CompilerExtension
|
||||
$connection->addSetup([$panel, 'register'], [$connection]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -149,5 +149,4 @@ class Panel implements Tracy\IBarPanel
|
||||
</table>
|
||||
</div>';
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -50,7 +50,6 @@ class Connection
|
||||
* - run (bool) => enable profiler?
|
||||
* - file => file to log
|
||||
* - substitutes (array) => map of driver specific substitutes (under development)
|
||||
|
||||
* @param mixed connection parameters
|
||||
* @param string connection name
|
||||
* @throws Exception
|
||||
@@ -581,5 +580,4 @@ class Connection
|
||||
$handler($arg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -281,5 +281,4 @@ FROM %SQL', $this->sql, '
|
||||
}
|
||||
return $this->totalCount;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -59,5 +59,4 @@ class DateTime extends \DateTime
|
||||
{
|
||||
return $this->format('Y-m-d H:i:s.u');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -760,5 +760,4 @@ class FirebirdDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
||||
}
|
||||
return $functions;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -355,5 +355,4 @@ class MsSqlDriver implements Dibi\Driver, Dibi\ResultDriver
|
||||
$this->autoFree = FALSE;
|
||||
return is_resource($this->resultSet) ? $this->resultSet : NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -205,5 +205,4 @@ class MsSqlReflector implements Dibi\Reflector
|
||||
}
|
||||
return array_values($keys);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -126,5 +126,4 @@ class MySqlReflector implements Dibi\Reflector
|
||||
}
|
||||
return array_values($foreignKeys);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -460,5 +460,4 @@ class MySqliDriver implements Dibi\Driver, Dibi\ResultDriver
|
||||
$this->autoFree = FALSE;
|
||||
return $this->resultSet;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -456,5 +456,4 @@ class OdbcDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
||||
{
|
||||
throw new Dibi\NotImplementedException;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -471,5 +471,4 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
||||
{
|
||||
throw new Dibi\NotImplementedException;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -522,5 +522,4 @@ class PdoDriver implements Dibi\Driver, Dibi\ResultDriver
|
||||
{
|
||||
return $this->resultSet;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -678,5 +678,4 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
||||
|
||||
return $fKeys;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -428,5 +428,4 @@ class Sqlite3Driver implements Dibi\Driver, Dibi\ResultDriver
|
||||
{
|
||||
$this->connection->createAggregate($name, $rowCallback, $agrCallback, $numArgs);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -145,5 +145,4 @@ class SqliteReflector implements Dibi\Reflector
|
||||
}
|
||||
return array_values($keys);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -382,5 +382,4 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver
|
||||
$this->autoFree = FALSE;
|
||||
return is_resource($this->resultSet) ? $this->resultSet : NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -127,5 +127,4 @@ class SqlsrvReflector implements Dibi\Reflector
|
||||
{
|
||||
throw new Dibi\NotImplementedException;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -96,5 +96,4 @@ class Event
|
||||
\dibi::$totalTime += $this->time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -478,5 +478,4 @@ class Fluent implements IDataSource
|
||||
}
|
||||
$this->cursor = &$foo;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -35,7 +35,6 @@ abstract class HashMapBase
|
||||
{
|
||||
return $this->callback;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +45,6 @@ abstract class HashMapBase
|
||||
*/
|
||||
final class HashMap extends HashMapBase
|
||||
{
|
||||
|
||||
public function __set($nm, $val)
|
||||
{
|
||||
if ($nm == '') {
|
||||
@@ -65,5 +63,4 @@ final class HashMap extends HashMapBase
|
||||
return $this->$nm = $this->getCallback()($nm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ class Helpers
|
||||
/** @var array */
|
||||
private static $types;
|
||||
|
||||
|
||||
/**
|
||||
* Prints out a syntax highlighted version of the SQL command or Result.
|
||||
* @param string|Result
|
||||
@@ -283,5 +284,4 @@ class Helpers
|
||||
{
|
||||
return $val === FALSE ? NULL : $val;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -31,5 +31,4 @@ class Literal
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -73,5 +73,4 @@ class FileLogger
|
||||
}
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -89,5 +89,4 @@ class FirePhpLogger
|
||||
}
|
||||
header("X-Wf-dibi-1-1-d$num: |$s|");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -130,5 +130,4 @@ class Column
|
||||
{
|
||||
return $this->info['vendor'][$key] ?? NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -99,5 +99,4 @@ class Database
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -46,5 +46,4 @@ class ForeignKey
|
||||
{
|
||||
return $this->references;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -56,5 +56,4 @@ class Index
|
||||
{
|
||||
return !empty($this->info['primary']);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -92,5 +92,4 @@ class Result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -173,5 +173,4 @@ class Table
|
||||
{
|
||||
throw new Dibi\NotImplementedException;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -292,7 +292,6 @@ class Result implements IDataSource
|
||||
if ($x === NULL) { // build leaf
|
||||
$x = $row;
|
||||
}
|
||||
|
||||
} while ($row = $this->fetch());
|
||||
|
||||
unset($x);
|
||||
@@ -365,7 +364,6 @@ class Result implements IDataSource
|
||||
$x = $row;
|
||||
}
|
||||
}
|
||||
|
||||
} while ($row = $this->fetch());
|
||||
|
||||
unset($x);
|
||||
@@ -574,5 +572,4 @@ class Result implements IDataSource
|
||||
{
|
||||
echo Helpers::dump($this);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -99,5 +99,4 @@ class ResultIterator implements \Iterator, \Countable
|
||||
{
|
||||
return $this->result->getRowCount();
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -15,7 +15,6 @@ namespace Dibi;
|
||||
*/
|
||||
class Row implements \ArrayAccess, \IteratorAggregate, \Countable
|
||||
{
|
||||
|
||||
public function __construct($arr)
|
||||
{
|
||||
foreach ($arr as $k => $v) {
|
||||
@@ -90,5 +89,4 @@ class Row implements \ArrayAccess, \IteratorAggregate, \Countable
|
||||
{
|
||||
unset($this->$nm);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -133,5 +133,4 @@ trait Strict
|
||||
$list[''] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -594,5 +594,4 @@ final class Translator
|
||||
}
|
||||
return implode('.', $parts);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -26,9 +26,9 @@ class Type
|
||||
TIME = 't',
|
||||
TIME_INTERVAL = 'ti';
|
||||
|
||||
|
||||
final public function __construct()
|
||||
{
|
||||
throw new \LogicException('Cannot instantiate static class ' . __CLASS__);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,8 +7,6 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Dibi\Type;
|
||||
|
||||
|
||||
/**
|
||||
* This class is static container class for creating DB objects and
|
||||
@@ -364,5 +362,4 @@ class dibi
|
||||
{
|
||||
return Dibi\Helpers::dump($sql, $return);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -40,7 +40,6 @@ class Exception extends \Exception
|
||||
{
|
||||
return parent::__toString() . ($this->sql ? "\nSQL: " . $this->sql : '');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +56,6 @@ class DriverException extends Exception
|
||||
*/
|
||||
class PcreException extends Exception
|
||||
{
|
||||
|
||||
public function __construct(string $message = '%msg.')
|
||||
{
|
||||
static $messages = [
|
||||
@@ -109,7 +107,6 @@ class ProcedureException extends Exception
|
||||
{
|
||||
$this->severity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -113,7 +113,6 @@ interface Driver
|
||||
* Injects LIMIT/OFFSET to the SQL query.
|
||||
*/
|
||||
function applyLimit(string &$sql, ?int $limit, ?int $offset): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +163,6 @@ interface ResultDriver
|
||||
* Decodes data from result set.
|
||||
*/
|
||||
function unescapeBinary(string $value): string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -196,5 +194,4 @@ interface Reflector
|
||||
* Returns metadata for all foreign keys in a table.
|
||||
*/
|
||||
function getForeignKeys(string $table): array;
|
||||
|
||||
}
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
use Dibi\Connection;
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
use Dibi\Row;
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
@@ -63,8 +63,8 @@ Assert::equal([
|
||||
|
||||
|
||||
// more complex association array
|
||||
function query($conn) {
|
||||
|
||||
function query($conn)
|
||||
{
|
||||
return $conn->query(in_array($conn->getConfig('system'), ['odbc', 'sqlsrv']) ? '
|
||||
SELECT products.title, customers.name, orders.amount
|
||||
FROM ([products]
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
|
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
use Dibi\Row;
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
|
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
use Dibi\Fluent;
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
@@ -10,21 +9,27 @@ require __DIR__ . '/bootstrap.php';
|
||||
class MockDriver extends Dibi\Drivers\SqlsrvDriver
|
||||
{
|
||||
function __construct()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
function connect(array & $config): void
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
function query(string $sql): ?Dibi\ResultDriver
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
function getResultColumns(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
function fetch(bool $type): ?array
|
||||
{
|
||||
return NULL;
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
use Dibi\Row;
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Dibi\Helpers;
|
||||
|
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
use Dibi\Type;
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
@@ -11,7 +10,9 @@ require __DIR__ . '/bootstrap.php';
|
||||
class MockResult extends Dibi\Result
|
||||
{
|
||||
function __construct()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
function test($row)
|
||||
{
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
@@ -17,23 +16,33 @@ class TestClass
|
||||
|
||||
public static $publicStatic;
|
||||
|
||||
|
||||
public function publicMethod()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public static function publicMethodStatic()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected function protectedMethod()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
protected static function protectedMethodS()
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function getBar()
|
||||
{
|
||||
return 123;
|
||||
}
|
||||
|
||||
|
||||
public function isFoo()
|
||||
{
|
||||
return 456;
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Tester\Assert;
|
||||
use Dibi\DateTime;
|
||||
use Tester\Assert;
|
||||
|
||||
require __DIR__ . '/bootstrap.php';
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
// The Nette Tester command-line runner can be
|
||||
|
Reference in New Issue
Block a user