Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rector] Update rector to ^0.10 #4468

Merged
merged 4 commits into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"phpstan/phpstan": "0.12.82",
"phpunit/phpunit": "^9.1",
"predis/predis": "^1.1",
"rector/rector": "^0.9",
"rector/rector": "^0.10",
"squizlabs/php_codesniffer": "^3.3"
},
"suggest": {
Expand Down
8 changes: 2 additions & 6 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use Utils\Rector\PassStrictParameterToFunctionParameterRector;
use Utils\Rector\UnderscoreToCamelCaseVariableNameRector;

require_once __DIR__ . '/system/Test/bootstrap.php';

return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();

Expand All @@ -41,12 +43,6 @@
PassStrictParameterToFunctionParameterRector::class => [__DIR__ . '/tests/system/Database/Live/SelectTest.php'],
]);

// Rector relies on autoload setup of your project; Composer autoload is included by default; to add more:
$parameters->set(Option::AUTOLOAD_PATHS, [
// autoload specific file
__DIR__ . '/system/Test/bootstrap.php',
]);

// auto import fully qualified class names
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
$parameters->set(Option::ENABLE_CACHE, true);
Expand Down
3 changes: 1 addition & 2 deletions system/Autoloader/FileLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ class FileLocator
/**
* The Autoloader to use.
*
* @var \CodeIgniter\Autoloader\Autoloader
* @var Autoloader
*/
protected $autoloader;

//--------------------------------------------------------------------

/**
* Constructor
*
Expand Down
1 change: 0 additions & 1 deletion system/CLI/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ abstract class BaseCommand
protected $commands;

//--------------------------------------------------------------------

/**
* BaseCommand constructor.
*
Expand Down
7 changes: 3 additions & 4 deletions system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ class BaseBuilder
];

//--------------------------------------------------------------------

/**
* Constructor
*
Expand All @@ -263,7 +262,9 @@ public function __construct($tableName, ConnectionInterface &$db, array $options
throw new DatabaseException('A table must be specified when creating a new Query Builder.');
}

/** @var BaseConnection $db */
/**
* @var BaseConnection $db
*/
$this->db = $db;

$this->tableName = $tableName;
Expand All @@ -282,7 +283,6 @@ public function __construct($tableName, ConnectionInterface &$db, array $options
}

//--------------------------------------------------------------------

/**
* Returns the current database connection
*
Expand Down Expand Up @@ -2022,7 +2022,6 @@ public function getCompiledQBWhere()
}

//--------------------------------------------------------------------

/**
* Get_Where
*
Expand Down
2 changes: 0 additions & 2 deletions system/Database/BaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,6 @@ abstract protected function _transCommit(): bool;
abstract protected function _transRollback(): bool;

//--------------------------------------------------------------------

/**
* Returns an instance of the query builder for this connection.
*
Expand All @@ -972,7 +971,6 @@ public function table($tableName)
}

//--------------------------------------------------------------------

/**
* Creates a prepared statement with the database that can then
* be used to execute multiple statements against. Within the
Expand Down
4 changes: 1 addition & 3 deletions system/Database/BasePreparedQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
protected $db;

//--------------------------------------------------------------------

/**
* Constructor.
*
Expand Down Expand Up @@ -90,7 +89,7 @@ public function prepare(string $sql, array $options = [], string $queryClass = '
$sql = preg_replace('/:[^\s,)]+/', '?', $sql);

/**
* @var \CodeIgniter\Database\Query $query
* @var Query $query
*/
$query = new $queryClass($this->db);

Expand Down Expand Up @@ -119,7 +118,6 @@ public function prepare(string $sql, array $options = [], string $queryClass = '
abstract public function _prepare(string $sql, array $options = []);

//--------------------------------------------------------------------

/**
* Takes a new set of data and runs it against the currently
* prepared query. Upon success, will return a Results object.
Expand Down
3 changes: 0 additions & 3 deletions system/Database/BaseUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ abstract class BaseUtils
protected $repairTable = false;

//--------------------------------------------------------------------

/**
* Class constructor
*
Expand Down Expand Up @@ -221,7 +220,6 @@ public function repairTable(string $tableName)
}

//--------------------------------------------------------------------

/**
* Generate CSV from a query result object
*
Expand Down Expand Up @@ -258,7 +256,6 @@ public function getCSVFromResult(ResultInterface $query, string $delim = ',', st
}

//--------------------------------------------------------------------

/**
* Generate XML data from a query result object
*
Expand Down
3 changes: 0 additions & 3 deletions system/Database/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Config extends BaseConfig
static protected $factory;

//--------------------------------------------------------------------

/**
* Creates the default
*
Expand Down Expand Up @@ -119,7 +118,6 @@ public static function forge($group = null)
}

//--------------------------------------------------------------------

/**
* Returns a new instance of the Database Utilities class.
*
Expand All @@ -135,7 +133,6 @@ public static function utils($group = null)
}

//--------------------------------------------------------------------

/**
* Returns a new instance of the Database Seeder.
*
Expand Down
1 change: 0 additions & 1 deletion system/Database/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ public function query(string $sql, $binds = null);
public function simpleQuery(string $sql);

//--------------------------------------------------------------------

/**
* Returns an instance of the query builder for this connection.
*
Expand Down
10 changes: 4 additions & 6 deletions system/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Database
/**
* Maintains an array of the instances of all connections that have
* been created.
*
*
* Helps to keep track of all open connections for performance
* monitoring, logging, etc.
*
Expand All @@ -41,9 +41,9 @@ class Database
* @param string $alias
*
* @return mixed
*
*
* @throws InvalidArgumentException
*
*
* @internal param bool $useBuilder
*/
public function load(array $params = [], string $alias = '')
Expand Down Expand Up @@ -72,7 +72,6 @@ public function load(array $params = [], string $alias = '')
}

//--------------------------------------------------------------------

/**
* Creates a Forge instance for the current database type.
*
Expand All @@ -92,7 +91,6 @@ public function loadForge(ConnectionInterface $db): object
}

//--------------------------------------------------------------------

/**
* Creates a Utils instance for the current database type.
*
Expand All @@ -119,7 +117,7 @@ public function loadUtils(ConnectionInterface $db): object
* @param array $params
*
* @return array
*
*
* @throws InvalidArgumentException
*/
protected function parseDSN(array $params): array
Expand Down
2 changes: 0 additions & 2 deletions system/Database/Forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ class Forge
protected $default = ' DEFAULT ';

//--------------------------------------------------------------------

/**
* Constructor.
*
Expand All @@ -173,7 +172,6 @@ public function __construct(BaseConnection $db)
}

//--------------------------------------------------------------------

/**
* Provides access to the forge's current database connection.
*
Expand Down
1 change: 0 additions & 1 deletion system/Database/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ abstract class Migration
protected $forge;

//--------------------------------------------------------------------

/**
* Constructor.
*
Expand Down
10 changes: 0 additions & 10 deletions system/HTTP/CURLRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ class CURLRequest extends Request
protected $delay = 0.0;

//--------------------------------------------------------------------

/**
* Takes an array of options to set the following possible class properties:
*
Expand Down Expand Up @@ -105,7 +104,6 @@ public function __construct(App $config, URI $uri, ResponseInterface $response =
}

//--------------------------------------------------------------------

/**
* Sends an HTTP request to the specified $url. If this is a relative
* URL, it will be merged with $this->baseURI to form a complete URL.
Expand All @@ -130,7 +128,6 @@ public function request($method, string $url, array $options = []): ResponseInte
}

//--------------------------------------------------------------------

/**
* Convenience method for sending a GET request.
*
Expand All @@ -145,7 +142,6 @@ public function get(string $url, array $options = []): ResponseInterface
}

//--------------------------------------------------------------------

/**
* Convenience method for sending a DELETE request.
*
Expand All @@ -160,7 +156,6 @@ public function delete(string $url, array $options = []): ResponseInterface
}

//--------------------------------------------------------------------

/**
* Convenience method for sending a HEAD request.
*
Expand All @@ -175,7 +170,6 @@ public function head(string $url, array $options = []): ResponseInterface
}

//--------------------------------------------------------------------

/**
* Convenience method for sending an OPTIONS request.
*
Expand All @@ -190,7 +184,6 @@ public function options(string $url, array $options = []): ResponseInterface
}

//--------------------------------------------------------------------

/**
* Convenience method for sending a PATCH request.
*
Expand All @@ -205,7 +198,6 @@ public function patch(string $url, array $options = []): ResponseInterface
}

//--------------------------------------------------------------------

/**
* Convenience method for sending a POST request.
*
Expand All @@ -220,7 +212,6 @@ public function post(string $url, array $options = []): ResponseInterface
}

//--------------------------------------------------------------------

/**
* Convenience method for sending a PUT request.
*
Expand Down Expand Up @@ -375,7 +366,6 @@ public function getMethod(bool $upper = false): string
}

//--------------------------------------------------------------------

/**
* Fires the actual cURL request.
*
Expand Down
1 change: 0 additions & 1 deletion system/HTTP/DownloadResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ public function setStatusCode(int $code, string $reason = '')
}

//--------------------------------------------------------------------

/**
* Sets the Content Type header for this response with the mime type
* and, optionally, the charset.
Expand Down
2 changes: 0 additions & 2 deletions system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ class IncomingRequest extends Request
protected $userAgent;

//--------------------------------------------------------------------

/**
* Constructor
*
Expand Down Expand Up @@ -472,7 +471,6 @@ public function getCookie($index = null, $filter = null, $flags = null)
}

//--------------------------------------------------------------------

/**
* Fetch the user agent string
*
Expand Down
2 changes: 0 additions & 2 deletions system/HTTP/Negotiate.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class Negotiate
protected $request;

//--------------------------------------------------------------------

/**
* Constructor
*
Expand All @@ -47,7 +46,6 @@ public function __construct(RequestInterface $request = null)
}

//--------------------------------------------------------------------

/**
* Stores the request instance to grab the headers from.
*
Expand Down
Loading