mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Remove superfluous phpdoc tags (#4941)
This commit is contained in:
parent
a037b50012
commit
b7ec33cd56
@ -64,8 +64,6 @@ class Format extends BaseConfig
|
||||
/**
|
||||
* A Factory method to return the appropriate formatter for the given mime type.
|
||||
*
|
||||
* @param string $mime
|
||||
*
|
||||
* @return FormatterInterface
|
||||
*
|
||||
* @deprecated This is an alias of `\CodeIgniter\Format\Format::getFormatter`. Use that instead.
|
||||
|
@ -485,8 +485,6 @@ class Mimes
|
||||
/**
|
||||
* Attempts to determine the best mime type for the given file extension.
|
||||
*
|
||||
* @param string $extension
|
||||
*
|
||||
* @return string|null The mime type found, or none if unable to determine.
|
||||
*/
|
||||
public static function guessTypeFromExtension(string $extension)
|
||||
@ -503,7 +501,6 @@ class Mimes
|
||||
/**
|
||||
* Attempts to determine the best file extension for a given mime type.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string|null $proposedExtension - default extension (in case there is more than one with the same mime type)
|
||||
*
|
||||
* @return string|null The extension determined, or null if unable to match.
|
||||
|
@ -39,10 +39,6 @@ class BaseController extends Controller
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param RequestInterface $request
|
||||
* @param ResponseInterface $response
|
||||
* @param LoggerInterface $logger
|
||||
*/
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
|
@ -87,7 +87,6 @@ trait ResponseTrait
|
||||
*
|
||||
* @param array|string|null $data
|
||||
* @param int $status
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -125,9 +124,8 @@ trait ResponseTrait
|
||||
* Used for generic failures that no custom methods exist for.
|
||||
*
|
||||
* @param array|string $messages
|
||||
* @param int $status HTTP status code
|
||||
* @param string|null $code Custom, API-specific, error code
|
||||
* @param string $customMessage
|
||||
* @param int $status HTTP status code
|
||||
* @param string|null $code Custom, API-specific, error code
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -207,9 +205,7 @@ trait ResponseTrait
|
||||
* or had bad authorization credentials. User is encouraged to try again
|
||||
* with the proper information.
|
||||
*
|
||||
* @param string $description
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -222,9 +218,7 @@ trait ResponseTrait
|
||||
* Used when access is always denied to this resource and no amount
|
||||
* of trying again will help.
|
||||
*
|
||||
* @param string $description
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -236,9 +230,7 @@ trait ResponseTrait
|
||||
/**
|
||||
* Used when a specified resource cannot be found.
|
||||
*
|
||||
* @param string $description
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -250,9 +242,7 @@ trait ResponseTrait
|
||||
/**
|
||||
* Used when the data provided by the client cannot be validated.
|
||||
*
|
||||
* @param string $description
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
@ -267,8 +257,6 @@ trait ResponseTrait
|
||||
* Used when the data provided by the client cannot be validated on one or more fields.
|
||||
*
|
||||
* @param string|string[] $errors
|
||||
* @param string|null $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -280,9 +268,7 @@ trait ResponseTrait
|
||||
/**
|
||||
* Use when trying to create a new resource and it already exists.
|
||||
*
|
||||
* @param string $description
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -296,9 +282,7 @@ trait ResponseTrait
|
||||
* Not Found, because here we know the data previously existed, but is now gone,
|
||||
* where Not Found means we simply cannot find any information about it.
|
||||
*
|
||||
* @param string $description
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -310,9 +294,7 @@ trait ResponseTrait
|
||||
/**
|
||||
* Used when the user has made too many requests for the resource recently.
|
||||
*
|
||||
* @param string $description
|
||||
* @param string $code
|
||||
* @param string $message
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
|
@ -80,9 +80,6 @@ class Autoloader
|
||||
* Reads in the configuration array (described above) and stores
|
||||
* the valid parts that we'll need.
|
||||
*
|
||||
* @param Autoload $config
|
||||
* @param Modules $modules
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function initialize(Autoload $config, Modules $modules)
|
||||
@ -136,7 +133,6 @@ class Autoloader
|
||||
* Registers namespaces with the autoloader.
|
||||
*
|
||||
* @param array|string $namespace
|
||||
* @param string|null $path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -168,8 +164,6 @@ class Autoloader
|
||||
*
|
||||
* If a prefix param is set, returns only paths to the given prefix.
|
||||
*
|
||||
* @param string|null $prefix
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getNamespace(?string $prefix = null)
|
||||
@ -184,8 +178,6 @@ class Autoloader
|
||||
/**
|
||||
* Removes a single namespace from the psr4 settings.
|
||||
*
|
||||
* @param string $namespace
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function removeNamespace(string $namespace)
|
||||
@ -200,8 +192,6 @@ class Autoloader
|
||||
/**
|
||||
* Load a class using available class mapping.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public function loadClassmap(string $class)
|
||||
@ -266,8 +256,6 @@ class Autoloader
|
||||
/**
|
||||
* A central way to include a file. Split out primarily for testing purposes.
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return false|string The filename on success, false if the file is not loaded
|
||||
*/
|
||||
protected function includeFile(string $file)
|
||||
@ -292,8 +280,6 @@ class Autoloader
|
||||
* dashes with a single dash. Trim period, dash and underscore from beginning
|
||||
* and end of filename.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return string The sanitized filename
|
||||
*/
|
||||
public function sanitizeFilename(string $filename): string
|
||||
|
@ -28,8 +28,6 @@ class FileLocator
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Autoloader $autoloader
|
||||
*/
|
||||
public function __construct(Autoloader $autoloader)
|
||||
{
|
||||
@ -118,10 +116,6 @@ class FileLocator
|
||||
|
||||
/**
|
||||
* Examines a file and returns the fully qualified domain name.
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getClassname(string $file): string
|
||||
{
|
||||
@ -175,12 +169,6 @@ class FileLocator
|
||||
* 'app/Modules/foo/Config/Routes.php',
|
||||
* 'app/Modules/bar/Config/Routes.php',
|
||||
* ]
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $ext
|
||||
* @param bool $prioritizeApp
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function search(string $path, string $ext = 'php', bool $prioritizeApp = true): array
|
||||
{
|
||||
@ -214,11 +202,6 @@ class FileLocator
|
||||
|
||||
/**
|
||||
* Ensures a extension is at the end of a filename
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $ext
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function ensureExt(string $path, string $ext): string
|
||||
{
|
||||
@ -272,8 +255,6 @@ class FileLocator
|
||||
* Find the qualified name of a file according to
|
||||
* the namespace of the first matched namespace path.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return false|string The qualified name or false if the path is not found
|
||||
*/
|
||||
public function findQualifiedNameFromPath(string $path)
|
||||
@ -315,10 +296,6 @@ class FileLocator
|
||||
/**
|
||||
* Scans the defined namespaces, returning a list of all files
|
||||
* that are contained within the subpath specified by $path.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function listFiles(string $path): array
|
||||
{
|
||||
@ -350,11 +327,6 @@ class FileLocator
|
||||
/**
|
||||
* Scans the provided namespace, returning a list of all files
|
||||
* that are contained within the subpath specified by $path.
|
||||
*
|
||||
* @param string $prefix
|
||||
* @param string $path
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function listNamespaceFiles(string $prefix, string $path): array
|
||||
{
|
||||
@ -388,9 +360,6 @@ class FileLocator
|
||||
* Checks the app folder to see if the file can be found.
|
||||
* Only for use with filenames that DO NOT include namespacing.
|
||||
*
|
||||
* @param string $file
|
||||
* @param string|null $folder
|
||||
*
|
||||
* @return false|string The path to the file, or false if not found.
|
||||
*/
|
||||
protected function legacyLocate(string $file, ?string $folder = null)
|
||||
|
@ -387,8 +387,6 @@ abstract class BaseModel
|
||||
*
|
||||
* @param array|int|string|null $id ID
|
||||
* @param array|null $data Data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function doUpdate($id = null, $data = null): bool;
|
||||
|
||||
@ -658,8 +656,6 @@ abstract class BaseModel
|
||||
* @param array|object $data Data
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function save($data): bool
|
||||
{
|
||||
@ -685,8 +681,6 @@ abstract class BaseModel
|
||||
* If this method return false insert operation will be executed
|
||||
*
|
||||
* @param array|object $data Data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function shouldUpdate($data): bool
|
||||
{
|
||||
@ -839,8 +833,6 @@ abstract class BaseModel
|
||||
* @param array|object|null $data Data
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function update($id = null, $data = null): bool
|
||||
{
|
||||
@ -1142,8 +1134,6 @@ abstract class BaseModel
|
||||
* @param array $data Data
|
||||
*
|
||||
* @throws DataException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function doProtectFields(array $data): array
|
||||
{
|
||||
@ -1339,8 +1329,6 @@ abstract class BaseModel
|
||||
* specified in the class property, $validationRules.
|
||||
*
|
||||
* @param array|object $data Data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function validate($data): bool
|
||||
{
|
||||
@ -1371,8 +1359,6 @@ abstract class BaseModel
|
||||
* can be used elsewhere, if needed.
|
||||
*
|
||||
* @param array $options Options
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getValidationRules(array $options = []): array
|
||||
{
|
||||
@ -1396,8 +1382,6 @@ abstract class BaseModel
|
||||
/**
|
||||
* Returns the model's define validation messages so they
|
||||
* can be used elsewhere, if needed.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getValidationMessages(): array
|
||||
{
|
||||
@ -1411,8 +1395,6 @@ abstract class BaseModel
|
||||
*
|
||||
* @param array $rules Array containing field name and rule
|
||||
* @param array|null $data Data
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function cleanValidationRules(array $rules, ?array $data = null): array
|
||||
{
|
||||
@ -1588,8 +1570,6 @@ abstract class BaseModel
|
||||
* @throws DataException
|
||||
* @throws InvalidArgumentException
|
||||
* @throws ReflectionException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function transformDataToArray($data, string $type): array
|
||||
{
|
||||
@ -1643,8 +1623,6 @@ abstract class BaseModel
|
||||
* Checks for the existence of properties across this model, and db connection.
|
||||
*
|
||||
* @param string $name Name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset(string $name): bool
|
||||
{
|
||||
@ -1693,8 +1671,6 @@ abstract class BaseModel
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @deprecated use fillPlaceholders($rules, $data) from Validation instead
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function fillPlaceholders(array $rules, array $data): array
|
||||
{
|
||||
|
@ -89,9 +89,6 @@ abstract class BaseCommand
|
||||
|
||||
/**
|
||||
* BaseCommand constructor.
|
||||
*
|
||||
* @param LoggerInterface $logger
|
||||
* @param Commands $commands
|
||||
*/
|
||||
public function __construct(LoggerInterface $logger, Commands $commands)
|
||||
{
|
||||
@ -102,17 +99,12 @@ abstract class BaseCommand
|
||||
/**
|
||||
* Actually execute a command.
|
||||
* This has to be over-ridden in any concrete implementation.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
abstract public function run(array $params);
|
||||
|
||||
/**
|
||||
* Can be used by a command to run other commands.
|
||||
*
|
||||
* @param string $command
|
||||
* @param array $params
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*
|
||||
* @return mixed
|
||||
@ -124,8 +116,6 @@ abstract class BaseCommand
|
||||
|
||||
/**
|
||||
* A simple method to display an error with line/file, in child commands.
|
||||
*
|
||||
* @param Throwable $e
|
||||
*/
|
||||
protected function showError(Throwable $e)
|
||||
{
|
||||
@ -184,12 +174,7 @@ abstract class BaseCommand
|
||||
/**
|
||||
* Pads our string out so that all titles are the same length to nicely line up descriptions.
|
||||
*
|
||||
* @param string $item
|
||||
* @param int $max
|
||||
* @param int $extra How many extra spaces to add at the end
|
||||
* @param int $indent
|
||||
*
|
||||
* @return string
|
||||
* @param int $extra How many extra spaces to add at the end
|
||||
*/
|
||||
public function setPad(string $item, int $max, int $extra = 2, int $indent = 0): string
|
||||
{
|
||||
@ -201,11 +186,6 @@ abstract class BaseCommand
|
||||
/**
|
||||
* Get pad for $key => $value array output
|
||||
*
|
||||
* @param array $array
|
||||
* @param int $pad
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @deprecated Use setPad() instead.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
@ -224,8 +204,6 @@ abstract class BaseCommand
|
||||
/**
|
||||
* Makes it simple to access our protected properties.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get(string $key)
|
||||
@ -235,10 +213,6 @@ abstract class BaseCommand
|
||||
|
||||
/**
|
||||
* Makes it simple to check our protected properties.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset(string $key): bool
|
||||
{
|
||||
|
@ -178,8 +178,6 @@ class CLI
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public static function input(?string $prefix = null): string
|
||||
@ -273,8 +271,6 @@ class CLI
|
||||
* @param string $value Input value
|
||||
* @param array|string $rules Validation rules
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
protected static function validate(string $field, string $value, $rules): bool
|
||||
@ -302,10 +298,6 @@ class CLI
|
||||
/**
|
||||
* Outputs a string to the CLI without any surrounding newlines.
|
||||
* Useful for showing repeating elements on a single line.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string|null $foreground
|
||||
* @param string|null $background
|
||||
*/
|
||||
public static function print(string $text = '', ?string $foreground = null, ?string $background = null)
|
||||
{
|
||||
@ -342,9 +334,7 @@ class CLI
|
||||
/**
|
||||
* Outputs an error to the CLI using STDERR instead of STDOUT
|
||||
*
|
||||
* @param string $text The text to output, or array of errors
|
||||
* @param string $foreground
|
||||
* @param string|null $background
|
||||
* @param string $text The text to output, or array of errors
|
||||
*/
|
||||
public static function error(string $text, string $foreground = 'light_red', ?string $background = null)
|
||||
{
|
||||
@ -404,8 +394,6 @@ class CLI
|
||||
|
||||
/**
|
||||
* if operating system === windows
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isWindows(): bool
|
||||
{
|
||||
@ -510,8 +498,6 @@ class CLI
|
||||
* and ignores styles set by the color() function
|
||||
*
|
||||
* @param string $string
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function strlen(?string $string): int
|
||||
{
|
||||
@ -536,10 +522,7 @@ class CLI
|
||||
* Checks whether the current stream resource supports or
|
||||
* refers to a valid terminal type device.
|
||||
*
|
||||
* @param string $function
|
||||
* @param resource $resource
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function streamSupports(string $function, $resource): bool
|
||||
{
|
||||
@ -564,8 +547,6 @@ class CLI
|
||||
* Reference: https://github.com/composer/xdebug-handler/blob/master/src/Process.php
|
||||
*
|
||||
* @param resource $resource
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function hasColorSupport($resource): bool
|
||||
{
|
||||
@ -593,10 +574,6 @@ class CLI
|
||||
|
||||
/**
|
||||
* Attempts to determine the width of the viewable CLI window.
|
||||
*
|
||||
* @param int $default
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getWidth(int $default = 80): int
|
||||
{
|
||||
@ -609,10 +586,6 @@ class CLI
|
||||
|
||||
/**
|
||||
* Attempts to determine the height of the viewable CLI window.
|
||||
*
|
||||
* @param int $default
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getHeight(int $default = 32): int
|
||||
{
|
||||
@ -677,7 +650,6 @@ class CLI
|
||||
* to update it. Set $thisStep = false to erase the progress bar.
|
||||
*
|
||||
* @param bool|int $thisStep
|
||||
* @param int $totalSteps
|
||||
*/
|
||||
public static function showProgress($thisStep = 1, int $totalSteps = 10)
|
||||
{
|
||||
@ -716,10 +688,6 @@ class CLI
|
||||
* short descriptions that need to start on an existing line.
|
||||
*
|
||||
* @param string $string
|
||||
* @param int $max
|
||||
* @param int $padLeft
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function wrap(?string $string = null, int $max = 0, int $padLeft = 0): string
|
||||
{
|
||||
@ -804,8 +772,6 @@ class CLI
|
||||
* Returns the command line string portions of the arguments, minus
|
||||
* any options, as a string. This is used to pass along to the main
|
||||
* CodeIgniter application.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getURI(): string
|
||||
{
|
||||
@ -823,8 +789,6 @@ class CLI
|
||||
*
|
||||
* **IMPORTANT:** The index here is one-based instead of zero-based.
|
||||
*
|
||||
* @param int $index
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
public static function getSegment(int $index)
|
||||
@ -834,8 +798,6 @@ class CLI
|
||||
|
||||
/**
|
||||
* Returns the raw array of segments found.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getSegments(): array
|
||||
{
|
||||
@ -846,8 +808,6 @@ class CLI
|
||||
* Gets a single command-line option. Returns TRUE if the option
|
||||
* exists, but doesn't have a value, and is simply acting as a flag.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return bool|mixed|null
|
||||
*/
|
||||
public static function getOption(string $name)
|
||||
@ -865,8 +825,6 @@ class CLI
|
||||
|
||||
/**
|
||||
* Returns the raw array of options found.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getOptions(): array
|
||||
{
|
||||
@ -879,8 +837,6 @@ class CLI
|
||||
*
|
||||
* @param bool $useLongOpts Use '--' for long options?
|
||||
* @param bool $trim Trim final string output?
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getOptionString(bool $useLongOpts = false, bool $trim = false): string
|
||||
{
|
||||
@ -1013,7 +969,6 @@ class CLI
|
||||
* solution down the road.
|
||||
*
|
||||
* @param resource $handle
|
||||
* @param string $string
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -59,8 +59,6 @@ class CommandRunner extends Controller
|
||||
/**
|
||||
* Default command.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*
|
||||
* @return mixed
|
||||
@ -74,8 +72,6 @@ class CommandRunner extends Controller
|
||||
|
||||
/**
|
||||
* Allows access to the current commands that have been found.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCommands(): array
|
||||
{
|
||||
|
@ -48,9 +48,6 @@ class Commands
|
||||
|
||||
/**
|
||||
* Runs a command given
|
||||
*
|
||||
* @param string $command
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(string $command, array $params)
|
||||
{
|
||||
@ -138,11 +135,6 @@ class Commands
|
||||
/**
|
||||
* Verifies if the command being sought is found
|
||||
* in the commands list.
|
||||
*
|
||||
* @param string $command
|
||||
* @param array $commands
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function verifyCommand(string $command, array $commands): bool
|
||||
{
|
||||
@ -171,11 +163,6 @@ class Commands
|
||||
/**
|
||||
* Finds alternative of `$name` among collection
|
||||
* of commands.
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $collection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getCommandAlternatives(string $name, array $collection): array
|
||||
{
|
||||
|
@ -31,8 +31,6 @@ class Console
|
||||
|
||||
/**
|
||||
* Console constructor.
|
||||
*
|
||||
* @param CodeIgniter $app
|
||||
*/
|
||||
public function __construct(CodeIgniter $app)
|
||||
{
|
||||
@ -42,8 +40,6 @@ class Console
|
||||
/**
|
||||
* Runs the current command discovered on the CLI.
|
||||
*
|
||||
* @param bool $useSafeOutput
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return mixed|RequestInterface|Response|ResponseInterface
|
||||
@ -60,8 +56,6 @@ class Console
|
||||
|
||||
/**
|
||||
* Displays basic information about the Console.
|
||||
*
|
||||
* @param bool $suppress
|
||||
*/
|
||||
public function showHeader(bool $suppress = false)
|
||||
{
|
||||
|
@ -25,9 +25,6 @@ class CLIException extends RuntimeException
|
||||
* Thrown when `$color` specified for `$type` is not within the
|
||||
* allowed list of colors.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $color
|
||||
*
|
||||
* @return CLIException
|
||||
*/
|
||||
public static function forInvalidColor(string $type, string $color)
|
||||
|
@ -86,10 +86,6 @@ trait GeneratorTrait
|
||||
|
||||
/**
|
||||
* Execute the command.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function execute(array $params): void
|
||||
{
|
||||
@ -167,10 +163,6 @@ trait GeneratorTrait
|
||||
|
||||
/**
|
||||
* Prepare options and do the necessary replacements.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepare(string $class): string
|
||||
{
|
||||
@ -181,10 +173,6 @@ trait GeneratorTrait
|
||||
* Change file basename before saving.
|
||||
*
|
||||
* Useful for components where the file name has a date.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function basename(string $filename): string
|
||||
{
|
||||
@ -193,8 +181,6 @@ trait GeneratorTrait
|
||||
|
||||
/**
|
||||
* Parses the class name and checks if it is already qualified.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function qualifyClassName(): string
|
||||
{
|
||||
@ -244,8 +230,6 @@ trait GeneratorTrait
|
||||
* with fallback to `$template` when the defined view does not exist.
|
||||
*
|
||||
* @param array $data Data to be passed to the view.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function renderTemplate(array $data = []): string
|
||||
{
|
||||
@ -260,13 +244,6 @@ trait GeneratorTrait
|
||||
|
||||
/**
|
||||
* Performs pseudo-variables contained within view file.
|
||||
*
|
||||
* @param string $class
|
||||
* @param array $search
|
||||
* @param array $replace
|
||||
* @param array $data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function parseTemplate(string $class, array $search = [], array $replace = [], array $data = []): string
|
||||
{
|
||||
@ -286,10 +263,6 @@ trait GeneratorTrait
|
||||
* Builds the contents for class being generated, doing all
|
||||
* the replacements necessary, and alphabetically sorts the
|
||||
* imports for a given template.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildContent(string $class): string
|
||||
{
|
||||
@ -307,10 +280,6 @@ trait GeneratorTrait
|
||||
|
||||
/**
|
||||
* Builds the file path from the class name.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildPath(string $class): string
|
||||
{
|
||||
@ -335,8 +304,6 @@ trait GeneratorTrait
|
||||
/**
|
||||
* Allows child generators to modify the internal `$hasClassName` flag.
|
||||
*
|
||||
* @param bool $hasClassName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
protected function setHasClassName(bool $hasClassName)
|
||||
@ -349,8 +316,6 @@ trait GeneratorTrait
|
||||
/**
|
||||
* Allows child generators to modify the internal `$sortImports` flag.
|
||||
*
|
||||
* @param bool $sortImports
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
protected function setSortImports(bool $sortImports)
|
||||
@ -363,8 +328,6 @@ trait GeneratorTrait
|
||||
/**
|
||||
* Allows child generators to modify the internal `$enabledSuffixing` flag.
|
||||
*
|
||||
* @param bool $enabledSuffixing
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
protected function setEnabledSuffixing(bool $enabledSuffixing)
|
||||
@ -378,8 +341,6 @@ trait GeneratorTrait
|
||||
* Gets a single command-line option. Returns TRUE if the option exists,
|
||||
* but doesn't have a value, and is simply acting as a flag.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getOption(string $name)
|
||||
|
@ -25,10 +25,6 @@ class CacheFactory
|
||||
/**
|
||||
* Attempts to create the desired cache handler, based upon the
|
||||
*
|
||||
* @param Cache $config
|
||||
* @param string|null $handler
|
||||
* @param string|null $backup
|
||||
*
|
||||
* @return CacheInterface
|
||||
*/
|
||||
public static function getHandler(Cache $config, ?string $handler = null, ?string $backup = null)
|
||||
|
@ -101,8 +101,6 @@ interface CacheInterface
|
||||
|
||||
/**
|
||||
* Determines if the driver is supported on this system.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported(): bool;
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ class CacheException extends RuntimeException implements ExceptionInterface
|
||||
/**
|
||||
* Thrown when handler has no permission to write cache.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return CacheException
|
||||
*/
|
||||
public static function forUnableToWrite(string $path)
|
||||
|
@ -152,8 +152,6 @@ class DummyHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Determines if the driver is supported on this system.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported(): bool
|
||||
{
|
||||
|
@ -45,8 +45,6 @@ class FileHandler extends BaseHandler
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Cache $config
|
||||
*
|
||||
* @throws CacheException
|
||||
*/
|
||||
public function __construct(Cache $config)
|
||||
@ -264,8 +262,6 @@ class FileHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Determines if the driver is supported on this system.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported(): bool
|
||||
{
|
||||
@ -276,8 +272,6 @@ class FileHandler extends BaseHandler
|
||||
* Does the heavy lifting of actually retrieving the file and
|
||||
* verifying it's age.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return bool|mixed
|
||||
*/
|
||||
protected function getItem(string $filename)
|
||||
@ -345,8 +339,6 @@ class FileHandler extends BaseHandler
|
||||
* @param bool $delDir Whether to delete any directories found in the path
|
||||
* @param bool $htdocs Whether to skip deleting .htaccess and index page files
|
||||
* @param int $_level Current directory depth level (default: 0; internal use only)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function deleteFiles(string $path, bool $delDir = false, bool $htdocs = false, int $_level = 0): bool
|
||||
{
|
||||
|
@ -43,8 +43,6 @@ class MemcachedHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Cache $config
|
||||
*/
|
||||
public function __construct(Cache $config)
|
||||
{
|
||||
@ -316,8 +314,6 @@ class MemcachedHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Determines if the driver is supported on this system.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported(): bool
|
||||
{
|
||||
|
@ -44,8 +44,6 @@ class PredisHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Cache $config
|
||||
*/
|
||||
public function __construct(Cache $config)
|
||||
{
|
||||
@ -269,8 +267,6 @@ class PredisHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Determines if the driver is supported on this system.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported(): bool
|
||||
{
|
||||
|
@ -43,8 +43,6 @@ class RedisHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Cache $config
|
||||
*/
|
||||
public function __construct(Cache $config)
|
||||
{
|
||||
@ -307,8 +305,6 @@ class RedisHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Determines if the driver is supported on this system.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported(): bool
|
||||
{
|
||||
|
@ -23,8 +23,6 @@ class WincacheHandler extends BaseHandler
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Cache $config
|
||||
*/
|
||||
public function __construct(Cache $config)
|
||||
{
|
||||
@ -183,8 +181,6 @@ class WincacheHandler extends BaseHandler
|
||||
|
||||
/**
|
||||
* Determines if the driver is supported on this system.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSupported(): bool
|
||||
{
|
||||
|
@ -142,8 +142,6 @@ class CodeIgniter
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param App $config
|
||||
*/
|
||||
public function __construct(App $config)
|
||||
{
|
||||
@ -284,9 +282,6 @@ class CodeIgniter
|
||||
* tries to route the response, loads the controller and generally
|
||||
* makes all of the pieces work together.
|
||||
*
|
||||
* @param RouteCollectionInterface|null $routes
|
||||
* @param bool $returnResponse
|
||||
*
|
||||
* @throws Exception
|
||||
* @throws RedirectException
|
||||
*
|
||||
@ -344,8 +339,6 @@ class CodeIgniter
|
||||
* cookies and headers are not actually sent, allowing PHP 7.2+ to
|
||||
* not complain when ini_set() function is used.
|
||||
*
|
||||
* @param bool $safe
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function useSafeOutput(bool $safe = true)
|
||||
@ -358,10 +351,6 @@ class CodeIgniter
|
||||
/**
|
||||
* Handles the main request logic and fires the controller.
|
||||
*
|
||||
* @param RouteCollectionInterface|null $routes
|
||||
* @param Cache $cacheConfig
|
||||
* @param bool $returnResponse
|
||||
*
|
||||
* @throws RedirectException
|
||||
*
|
||||
* @return mixed|RequestInterface|ResponseInterface
|
||||
@ -514,8 +503,6 @@ class CodeIgniter
|
||||
* Sets a Request object to be used for this request.
|
||||
* Used when running certain tests.
|
||||
*
|
||||
* @param Request $request
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRequest(Request $request)
|
||||
@ -586,8 +573,6 @@ class CodeIgniter
|
||||
/**
|
||||
* Determines if a response has been cached for the given URI.
|
||||
*
|
||||
* @param Cache $config
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return bool|ResponseInterface
|
||||
@ -625,8 +610,6 @@ class CodeIgniter
|
||||
/**
|
||||
* Tells the app that the final output should be cached.
|
||||
*
|
||||
* @param int $time
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function cache(int $time)
|
||||
@ -638,8 +621,6 @@ class CodeIgniter
|
||||
* Caches the full response from the current request. Used for
|
||||
* full-page caching for very high performance.
|
||||
*
|
||||
* @param Cache $config
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function cachePage(Cache $config)
|
||||
@ -655,8 +636,6 @@ class CodeIgniter
|
||||
|
||||
/**
|
||||
* Returns an array with our basic performance stats collected.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getPerformanceStats(): array
|
||||
{
|
||||
@ -668,10 +647,6 @@ class CodeIgniter
|
||||
|
||||
/**
|
||||
* Generates the cache name to use for our full-page caching.
|
||||
*
|
||||
* @param Cache $config
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function generateCacheName(Cache $config): string
|
||||
{
|
||||
@ -692,10 +667,6 @@ class CodeIgniter
|
||||
|
||||
/**
|
||||
* Replaces the elapsed_time tag.
|
||||
*
|
||||
* @param string $output
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function displayPerformanceMetrics(string $output): string
|
||||
{
|
||||
@ -765,8 +736,6 @@ class CodeIgniter
|
||||
*
|
||||
* This is primarily used by the Console.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPath(string $path)
|
||||
@ -845,8 +814,6 @@ class CodeIgniter
|
||||
/**
|
||||
* Displays a 404 Page Not Found error. If set, will try to
|
||||
* call the 404Override controller/method that was set in routing config.
|
||||
*
|
||||
* @param PageNotFoundException $e
|
||||
*/
|
||||
protected function display404errors(PageNotFoundException $e)
|
||||
{
|
||||
@ -896,7 +863,6 @@ class CodeIgniter
|
||||
* Gathers the script output from the buffer, replaces some execution
|
||||
* time tag in the output and displays the debug toolbar, if required.
|
||||
*
|
||||
* @param Cache|null $cacheConfig
|
||||
* @param mixed|null $returned
|
||||
*/
|
||||
protected function gatherOutput(?Cache $cacheConfig = null, $returned = null)
|
||||
|
@ -59,8 +59,6 @@ class ClearCache extends BaseCommand
|
||||
|
||||
/**
|
||||
* Clears the cache
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -51,8 +51,6 @@ class InfoCache extends BaseCommand
|
||||
|
||||
/**
|
||||
* Clears the cache
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -73,8 +73,6 @@ class CreateDatabase extends BaseCommand
|
||||
/**
|
||||
* Creates a new database.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $params)
|
||||
|
@ -64,8 +64,6 @@ class Migrate extends BaseCommand
|
||||
/**
|
||||
* Ensures that all migrations have been run.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $params)
|
||||
|
@ -65,8 +65,6 @@ class MigrateRefresh extends BaseCommand
|
||||
* Does a rollback followed by a latest to refresh the current state
|
||||
* of the database.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $params)
|
||||
|
@ -66,8 +66,6 @@ class MigrateRollback extends BaseCommand
|
||||
* Runs all of the migrations in reverse order, until they have
|
||||
* all been unapplied.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $params)
|
||||
|
@ -64,8 +64,6 @@ class Seed extends BaseCommand
|
||||
/**
|
||||
* Passes to Seeder to populate the database.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $params)
|
||||
|
@ -64,8 +64,6 @@ class GenerateKey extends BaseCommand
|
||||
/**
|
||||
* Actually execute the command.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $params)
|
||||
@ -112,11 +110,6 @@ class GenerateKey extends BaseCommand
|
||||
|
||||
/**
|
||||
* Generates a key and encodes it.
|
||||
*
|
||||
* @param string $prefix
|
||||
* @param int $length
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function generateRandomKey(string $prefix, int $length): string
|
||||
{
|
||||
@ -131,11 +124,6 @@ class GenerateKey extends BaseCommand
|
||||
|
||||
/**
|
||||
* Sets the new encryption key in your .env file.
|
||||
*
|
||||
* @param string $key
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function setNewEncryptionKey(string $key, array $params): bool
|
||||
{
|
||||
@ -153,10 +141,6 @@ class GenerateKey extends BaseCommand
|
||||
|
||||
/**
|
||||
* Checks whether to overwrite existing encryption key.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function confirmOverwrite(array $params): bool
|
||||
{
|
||||
@ -165,11 +149,6 @@ class GenerateKey extends BaseCommand
|
||||
|
||||
/**
|
||||
* Writes the new encryption key to .env file.
|
||||
*
|
||||
* @param string $oldKey
|
||||
* @param string $newKey
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function writeNewEncryptionKeyToFile(string $oldKey, string $newKey): bool
|
||||
{
|
||||
@ -199,10 +178,6 @@ class GenerateKey extends BaseCommand
|
||||
|
||||
/**
|
||||
* Get the regex of the current encryption key.
|
||||
*
|
||||
* @param string $oldKey
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function keyPattern(string $oldKey): string
|
||||
{
|
||||
|
@ -75,8 +75,6 @@ class CommandGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
@ -90,10 +88,6 @@ class CommandGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Prepare options and do the necessary replacements.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepare(string $class): string
|
||||
{
|
||||
|
@ -71,8 +71,6 @@ class ConfigGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
@ -86,10 +84,6 @@ class ConfigGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Prepare options and do the necessary replacements.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepare(string $class): string
|
||||
{
|
||||
|
@ -74,8 +74,6 @@ class ControllerGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
@ -89,10 +87,6 @@ class ControllerGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Prepare options and do the necessary replacements.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepare(string $class): string
|
||||
{
|
||||
|
@ -71,8 +71,6 @@ class EntityGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -71,8 +71,6 @@ class FilterGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -73,8 +73,6 @@ class MigrateCreate extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -74,8 +74,6 @@ class MigrationGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
@ -94,10 +92,6 @@ class MigrationGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Prepare options and do the necessary replacements.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepare(string $class): string
|
||||
{
|
||||
@ -118,10 +112,6 @@ class MigrationGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Change file basename before saving.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function basename(string $filename): string
|
||||
{
|
||||
|
@ -75,8 +75,6 @@ class ModelGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
@ -90,10 +88,6 @@ class ModelGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Prepare options and do the necessary replacements.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepare(string $class): string
|
||||
{
|
||||
|
@ -77,8 +77,6 @@ class ScaffoldGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -71,8 +71,6 @@ class SeederGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -66,8 +66,6 @@ class SessionMigrationGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
@ -88,10 +86,6 @@ class SessionMigrationGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Performs the necessary replacements.
|
||||
*
|
||||
* @param string $class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepare(string $class): string
|
||||
{
|
||||
@ -108,10 +102,6 @@ class SessionMigrationGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Change file basename before saving.
|
||||
*
|
||||
* @param string $filename
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function basename(string $filename): string
|
||||
{
|
||||
|
@ -71,8 +71,6 @@ class ValidationGenerator extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -68,8 +68,6 @@ class Help extends BaseCommand
|
||||
|
||||
/**
|
||||
* Displays the help for spark commands.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -51,8 +51,6 @@ class ClearDebugbar extends BaseCommand
|
||||
/**
|
||||
* Actually runs the command.
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run(array $params)
|
||||
|
@ -59,8 +59,6 @@ class ClearLogs extends BaseCommand
|
||||
|
||||
/**
|
||||
* Actually execute a command.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -69,8 +69,6 @@ class ListCommands extends BaseCommand
|
||||
|
||||
/**
|
||||
* Displays the help for the spark cli script itself.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
@ -85,8 +83,6 @@ class ListCommands extends BaseCommand
|
||||
|
||||
/**
|
||||
* Lists the commands with accompanying info.
|
||||
*
|
||||
* @param array $commands
|
||||
*/
|
||||
protected function listFull(array $commands)
|
||||
{
|
||||
@ -128,8 +124,6 @@ class ListCommands extends BaseCommand
|
||||
|
||||
/**
|
||||
* Lists the commands only.
|
||||
*
|
||||
* @param array $commands
|
||||
*/
|
||||
protected function listSimple(array $commands)
|
||||
{
|
||||
|
@ -130,10 +130,6 @@ final class Environment extends BaseCommand
|
||||
|
||||
/**
|
||||
* @see https://regex101.com/r/4sSORp/1 for the regex in action
|
||||
*
|
||||
* @param string $newEnv
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function writeNewEnvironmentToEnvFile(string $newEnv): bool
|
||||
{
|
||||
|
@ -67,8 +67,6 @@ class Namespaces extends BaseCommand
|
||||
|
||||
/**
|
||||
* Displays the help for the spark cli script itself.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -67,8 +67,6 @@ class Routes extends BaseCommand
|
||||
|
||||
/**
|
||||
* Displays the help for the spark cli script itself.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function run(array $params)
|
||||
{
|
||||
|
@ -40,8 +40,6 @@ if (! function_exists('app_timezone')) {
|
||||
* dates in. This might be different than the timezone set
|
||||
* at the server level, as you often want to stores dates in UTC
|
||||
* and convert them on the fly for the user.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function app_timezone(): string
|
||||
{
|
||||
@ -61,8 +59,6 @@ if (! function_exists('cache')) {
|
||||
* cache()->save('foo', 'bar');
|
||||
* $foo = cache('bar');
|
||||
*
|
||||
* @param string|null $key
|
||||
*
|
||||
* @return CacheInterface|mixed
|
||||
*/
|
||||
function cache(?string $key = null)
|
||||
@ -84,10 +80,6 @@ if (! function_exists('clean_path')) {
|
||||
* A convenience method to clean paths for
|
||||
* a nicer looking output. Useful for exception
|
||||
* handling, error logging, etc.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function clean_path(string $path): string
|
||||
{
|
||||
@ -124,8 +116,6 @@ if (! function_exists('command')) {
|
||||
*
|
||||
* > command('migrate:create SomeMigration');
|
||||
*
|
||||
* @param string $command
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
function command(string $command)
|
||||
@ -200,9 +190,6 @@ if (! function_exists('config')) {
|
||||
/**
|
||||
* More simple way of getting config instances from Factories
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function config(string $name, bool $getShared = true)
|
||||
@ -220,8 +207,6 @@ if (! function_exists('cookie')) {
|
||||
* @param array $options Array of options to be passed to the cookie
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
* @return Cookie
|
||||
*/
|
||||
function cookie(string $name, string $value = '', array $options = []): Cookie
|
||||
{
|
||||
@ -235,8 +220,6 @@ if (! function_exists('cookies')) {
|
||||
*
|
||||
* @param Cookie[] $cookies If `getGlobal` is false, this is passed to CookieStore's constructor
|
||||
* @param bool $getGlobal If false, creates a new instance of CookieStore
|
||||
*
|
||||
* @return CookieStore
|
||||
*/
|
||||
function cookies(array $cookies = [], bool $getGlobal = true): CookieStore
|
||||
{
|
||||
@ -253,8 +236,6 @@ if (! function_exists('csrf_token')) {
|
||||
* Returns the CSRF token name.
|
||||
* Can be used in Views when building hidden inputs manually,
|
||||
* or used in javascript vars when using APIs.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function csrf_token(): string
|
||||
{
|
||||
@ -267,8 +248,6 @@ if (! function_exists('csrf_header')) {
|
||||
* Returns the CSRF header name.
|
||||
* Can be used in Views by adding it to the meta tag
|
||||
* or used in javascript to define a header name when using APIs.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function csrf_header(): string
|
||||
{
|
||||
@ -281,8 +260,6 @@ if (! function_exists('csrf_hash')) {
|
||||
* Returns the current hash value for the CSRF protection.
|
||||
* Can be used in Views when building hidden inputs manually,
|
||||
* or used in javascript vars for API usage.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function csrf_hash(): string
|
||||
{
|
||||
@ -293,10 +270,6 @@ if (! function_exists('csrf_hash')) {
|
||||
if (! function_exists('csrf_field')) {
|
||||
/**
|
||||
* Generates a hidden input field for use within manually generated forms.
|
||||
*
|
||||
* @param string|null $id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function csrf_field(?string $id = null): string
|
||||
{
|
||||
@ -307,10 +280,6 @@ if (! function_exists('csrf_field')) {
|
||||
if (! function_exists('csrf_meta')) {
|
||||
/**
|
||||
* Generates a meta tag for use within javascript calls.
|
||||
*
|
||||
* @param string|null $id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function csrf_meta(?string $id = null): string
|
||||
{
|
||||
@ -334,7 +303,6 @@ if (! function_exists('db_connect')) {
|
||||
* otherwise it will all calls will return the same instance.
|
||||
*
|
||||
* @param array|ConnectionInterface|string|null $db
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return BaseConnection
|
||||
*/
|
||||
@ -370,7 +338,6 @@ if (! function_exists('env')) {
|
||||
* retrieving values set from the .env file for
|
||||
* use in config files.
|
||||
*
|
||||
* @param string $key
|
||||
* @param string|null $default
|
||||
*
|
||||
* @return mixed
|
||||
@ -415,7 +382,6 @@ if (! function_exists('esc')) {
|
||||
* Valid context values: html, js, css, url, attr, raw, null
|
||||
*
|
||||
* @param array|string $data
|
||||
* @param string $context
|
||||
* @param string $encoding
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
@ -682,8 +648,6 @@ if (! function_exists('is_cli')) {
|
||||
/**
|
||||
* Check if PHP was invoked from the command line.
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @codeCoverageIgnore Cannot be tested fully as PHPUnit always run in CLI
|
||||
*/
|
||||
function is_cli(): bool
|
||||
@ -719,12 +683,8 @@ if (! function_exists('is_really_writable')) {
|
||||
*
|
||||
* @see https://bugs.php.net/bug.php?id=54709
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @codeCoverageIgnore Not practical to test, as travis runs on linux
|
||||
*/
|
||||
function is_really_writable(string $file): bool
|
||||
@ -765,10 +725,6 @@ if (! function_exists('lang')) {
|
||||
* A convenience method to translate a string or array of them and format
|
||||
* the result with the intl extension's MessageFormatter.
|
||||
*
|
||||
* @param string $line
|
||||
* @param array $args
|
||||
* @param string|null $locale
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function lang(string $line, array $args = [], ?string $locale = null)
|
||||
@ -793,10 +749,6 @@ if (! function_exists('log_message')) {
|
||||
* - info
|
||||
* - debug
|
||||
*
|
||||
* @param string $level
|
||||
* @param string $message
|
||||
* @param array $context
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function log_message(string $level, string $message, array $context = [])
|
||||
@ -821,10 +773,6 @@ if (! function_exists('model')) {
|
||||
/**
|
||||
* More simple way of getting model instances from Factories
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $getShared
|
||||
* @param ConnectionInterface|null $conn
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn = null)
|
||||
@ -838,7 +786,6 @@ if (! function_exists('old')) {
|
||||
* Provides access to "old input" that was set in the session
|
||||
* during a redirect()->withInput().
|
||||
*
|
||||
* @param string $key
|
||||
* @param null $default
|
||||
* @param bool|string $escape
|
||||
*
|
||||
@ -883,8 +830,6 @@ if (! function_exists('redirect')) {
|
||||
* If more control is needed, you must use $response->redirect explicitly.
|
||||
*
|
||||
* @param string $route
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
function redirect(?string $route = null): RedirectResponse
|
||||
{
|
||||
@ -904,11 +849,6 @@ if (! function_exists('remove_invisible_characters')) {
|
||||
*
|
||||
* This prevents sandwiching null characters
|
||||
* between ascii characters, like Java\0script.
|
||||
*
|
||||
* @param string $str
|
||||
* @param bool $urlEncoded
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function remove_invisible_characters(string $str, bool $urlEncoded = true): string
|
||||
{
|
||||
@ -940,8 +880,7 @@ if (! function_exists('route_to')) {
|
||||
* NOTE: This requires the controller/method to
|
||||
* have a route defined in the routes Config file.
|
||||
*
|
||||
* @param string $method
|
||||
* @param mixed ...$params
|
||||
* @param mixed ...$params
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
@ -988,8 +927,7 @@ if (! function_exists('service')) {
|
||||
* - $timer = service('timer')
|
||||
* - $timer = \CodeIgniter\Config\Services::timer();
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed ...$params
|
||||
* @param mixed ...$params
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -1003,8 +941,7 @@ if (! function_exists('single_service')) {
|
||||
/**
|
||||
* Always returns a new instance of the class.
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed ...$params
|
||||
* @param mixed ...$params
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -1072,9 +1009,6 @@ if (! function_exists('stringify_attributes')) {
|
||||
* of attributes to a string.
|
||||
*
|
||||
* @param mixed $attributes string, array, object
|
||||
* @param bool $js
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function stringify_attributes($attributes, bool $js = false): string
|
||||
{
|
||||
@ -1104,8 +1038,6 @@ if (! function_exists('timer')) {
|
||||
* If no parameter is passed, it will return the timer instance,
|
||||
* otherwise will start or stop the timer intelligently.
|
||||
*
|
||||
* @param string|null $name
|
||||
*
|
||||
* @return mixed|Timer
|
||||
*/
|
||||
function timer(?string $name = null)
|
||||
@ -1145,11 +1077,7 @@ if (! function_exists('view')) {
|
||||
* NOTE: Does not provide any escaping of the data, so that must
|
||||
* all be handled manually by the developer.
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $data
|
||||
* @param array $options Unused - reserved for third-party extensions.
|
||||
*
|
||||
* @return string
|
||||
* @param array $options Unused - reserved for third-party extensions.
|
||||
*/
|
||||
function view(string $name, array $data = [], array $options = []): string
|
||||
{
|
||||
@ -1174,14 +1102,9 @@ if (! function_exists('view_cell')) {
|
||||
* View cells are used within views to insert HTML chunks that are managed
|
||||
* by other classes.
|
||||
*
|
||||
* @param string $library
|
||||
* @param null $params
|
||||
* @param int $ttl
|
||||
* @param string|null $cacheName
|
||||
* @param null $params
|
||||
*
|
||||
* @throws ReflectionException
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function view_cell(string $library, $params = null, int $ttl = 0, ?string $cacheName = null): string
|
||||
{
|
||||
|
@ -80,10 +80,6 @@ final class ComposerScripts
|
||||
|
||||
/**
|
||||
* Recursively remove the contents of the previous `system/ThirdParty`.
|
||||
*
|
||||
* @param string $directory
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function recursiveDelete(string $directory): void
|
||||
{
|
||||
@ -109,11 +105,6 @@ final class ComposerScripts
|
||||
/**
|
||||
* Recursively copy the files and directories of the origin directory
|
||||
* into the target directory, i.e. "mirror" its contents.
|
||||
*
|
||||
* @param string $originDir
|
||||
* @param string $targetDir
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function recursiveMirror(string $originDir, string $targetDir): void
|
||||
{
|
||||
@ -154,8 +145,6 @@ final class ComposerScripts
|
||||
|
||||
/**
|
||||
* Copy Kint's init files into `system/ThirdParty/Kint/`
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private static function copyKintInitFiles(): void
|
||||
{
|
||||
|
@ -86,10 +86,7 @@ class BaseConfig
|
||||
/**
|
||||
* Initialization an environment-specific configuration setting
|
||||
*
|
||||
* @param mixed $property
|
||||
* @param string $name
|
||||
* @param string $prefix
|
||||
* @param string $shortPrefix
|
||||
* @param mixed $property
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -114,10 +111,6 @@ class BaseConfig
|
||||
/**
|
||||
* Retrieve an environment-specific configuration setting
|
||||
*
|
||||
* @param string $property
|
||||
* @param string $prefix
|
||||
* @param string $shortPrefix
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getEnvValue(string $property, string $prefix, string $shortPrefix)
|
||||
|
@ -169,8 +169,7 @@ class BaseService
|
||||
*
|
||||
* $key must be a name matching a service.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed ...$params
|
||||
* @param mixed ...$params
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -197,8 +196,6 @@ class BaseService
|
||||
* The Autoloader class is the central class that handles our
|
||||
* spl_autoload_register method, and helper methods.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Autoloader
|
||||
*/
|
||||
public static function autoloader(bool $getShared = true)
|
||||
@ -219,8 +216,6 @@ class BaseService
|
||||
* within namespaced folders, as well as convenience methods for
|
||||
* loading 'helpers', and 'libraries'.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return FileLocator
|
||||
*/
|
||||
public static function locator(bool $getShared = true)
|
||||
@ -240,9 +235,6 @@ class BaseService
|
||||
* Provides the ability to perform case-insensitive calling of service
|
||||
* names.
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $arguments
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function __callStatic(string $name, array $arguments)
|
||||
@ -259,10 +251,6 @@ class BaseService
|
||||
/**
|
||||
* Check if the requested service is defined and return the declaring
|
||||
* class. Return null if not found.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public static function serviceExists(string $name): ?string
|
||||
{
|
||||
@ -296,8 +284,6 @@ class BaseService
|
||||
|
||||
/**
|
||||
* Resets any mock and shared instances for a single service.
|
||||
*
|
||||
* @param string $name
|
||||
*/
|
||||
public static function resetSingle(string $name)
|
||||
{
|
||||
@ -307,8 +293,7 @@ class BaseService
|
||||
/**
|
||||
* Inject mock object for testing.
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $mock
|
||||
* @param mixed $mock
|
||||
*/
|
||||
public static function injectMock(string $name, $mock)
|
||||
{
|
||||
@ -321,9 +306,6 @@ class BaseService
|
||||
* looks for the service method in each, returning an instance of
|
||||
* the service, if available.
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $arguments
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @deprecated
|
||||
|
@ -35,7 +35,6 @@ class Config
|
||||
/**
|
||||
* Helper method for injecting mock instances while testing.
|
||||
*
|
||||
* @param string $name
|
||||
* @param object $instance
|
||||
*/
|
||||
public static function injectMock(string $name, $instance)
|
||||
|
@ -27,9 +27,6 @@ class DotEnv
|
||||
|
||||
/**
|
||||
* Builds the path to our file.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $file
|
||||
*/
|
||||
public function __construct(string $path, string $file = '.env')
|
||||
{
|
||||
@ -40,8 +37,6 @@ class DotEnv
|
||||
* The main entry point, will load the .env file and process it
|
||||
* so that we end up with all settings in the PHP environment vars
|
||||
* (i.e. getenv(), $_ENV, and $_SERVER)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function load(): bool
|
||||
{
|
||||
@ -52,8 +47,6 @@ class DotEnv
|
||||
|
||||
/**
|
||||
* Parse the .env file into an array of key => value
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function parse(): ?array
|
||||
{
|
||||
@ -92,9 +85,6 @@ class DotEnv
|
||||
* Sets the variable into the environment. Will parse the string
|
||||
* first to look for {name}={value} pattern, ensure that nested
|
||||
* variables are handled, and strip it of single and double quotes.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*/
|
||||
protected function setVariable(string $name, string $value = '')
|
||||
{
|
||||
@ -114,11 +104,6 @@ class DotEnv
|
||||
/**
|
||||
* Parses for assignment, cleans the $name and $value, and ensures
|
||||
* that nested variables are handled.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function normaliseVariable(string $name, string $value = ''): array
|
||||
{
|
||||
@ -146,11 +131,7 @@ class DotEnv
|
||||
* This was borrowed from the excellent phpdotenv with very few changes.
|
||||
* https://github.com/vlucas/phpdotenv
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function sanitizeValue(string $value): string
|
||||
{
|
||||
@ -203,10 +184,6 @@ class DotEnv
|
||||
*
|
||||
* This was borrowed from the excellent phpdotenv with very few changes.
|
||||
* https://github.com/vlucas/phpdotenv
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function resolveNestedVariables(string $value): string
|
||||
{
|
||||
@ -235,8 +212,6 @@ class DotEnv
|
||||
* This was borrowed from the excellent phpdotenv with very few changes.
|
||||
* https://github.com/vlucas/phpdotenv
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected function getVariable(string $name)
|
||||
|
@ -71,9 +71,6 @@ class Factories
|
||||
* Loads instances based on the method component name. Either
|
||||
* creates a new instance or returns an existing shared instance.
|
||||
*
|
||||
* @param string $component
|
||||
* @param array $arguments
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public static function __callStatic(string $component, array $arguments)
|
||||
@ -121,8 +118,6 @@ class Factories
|
||||
*
|
||||
* @param array $options The array of component-specific directives
|
||||
* @param string $name Class name, namespace optional
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
protected static function locateClass(array $options, string $name): ?string
|
||||
{
|
||||
@ -180,8 +175,6 @@ class Factories
|
||||
*
|
||||
* @param array $options The array of component-specific directives
|
||||
* @param string $name Class name, namespace optional
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function verifyPreferApp(array $options, string $name): bool
|
||||
{
|
||||
@ -203,8 +196,6 @@ class Factories
|
||||
*
|
||||
* @param array $options The array of component-specific directives
|
||||
* @param string $name Class name, namespace optional
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected static function verifyInstanceOf(array $options, string $name): bool
|
||||
{
|
||||
@ -245,7 +236,6 @@ class Factories
|
||||
* Normalizes, stores, and returns the configuration for a specific component
|
||||
*
|
||||
* @param string $component Lowercase, plural component name
|
||||
* @param array $values
|
||||
*
|
||||
* @return array<string, mixed> The result after applying defaults and normalization
|
||||
*/
|
||||
@ -297,7 +287,6 @@ class Factories
|
||||
*
|
||||
* @param string $component Lowercase, plural component name
|
||||
* @param string $name The name of the instance
|
||||
* @param object $instance
|
||||
*/
|
||||
public static function injectMock(string $component, string $name, object $instance)
|
||||
{
|
||||
@ -314,10 +303,6 @@ class Factories
|
||||
|
||||
/**
|
||||
* Gets a basename from a class name, namespaced or not.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getBasename(string $name): string
|
||||
{
|
||||
|
@ -93,9 +93,6 @@ class Services extends BaseService
|
||||
* The cache class provides a simple way to store and retrieve
|
||||
* complex data for later.
|
||||
*
|
||||
* @param Cache|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return CacheInterface
|
||||
*/
|
||||
public static function cache(?Cache $config = null, bool $getShared = true)
|
||||
@ -113,9 +110,6 @@ class Services extends BaseService
|
||||
* The CLI Request class provides for ways to interact with
|
||||
* a command line request.
|
||||
*
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return CLIRequest
|
||||
*/
|
||||
public static function clirequest(?App $config = null, bool $getShared = true)
|
||||
@ -132,9 +126,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* CodeIgniter, the core of the framework.
|
||||
*
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return CodeIgniter
|
||||
*/
|
||||
public static function codeigniter(?App $config = null, bool $getShared = true)
|
||||
@ -151,8 +142,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The commands utility for running and working with CLI commands.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Commands
|
||||
*/
|
||||
public static function commands(bool $getShared = true)
|
||||
@ -168,11 +157,6 @@ class Services extends BaseService
|
||||
* The CURL Request class acts as a simple HTTP client for interacting
|
||||
* with other servers, typically through APIs.
|
||||
*
|
||||
* @param array $options
|
||||
* @param ResponseInterface|null $response
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return CURLRequest
|
||||
*/
|
||||
public static function curlrequest(array $options = [], ?ResponseInterface $response = null, ?App $config = null, bool $getShared = true)
|
||||
@ -196,7 +180,6 @@ class Services extends BaseService
|
||||
* The Email class allows you to send email via mail, sendmail, SMTP.
|
||||
*
|
||||
* @param array|EmailConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Email
|
||||
*/
|
||||
@ -216,8 +199,7 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Encryption class provides two-way encryption.
|
||||
*
|
||||
* @param EncryptionConfig|null $config
|
||||
* @param bool $getShared
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return EncrypterInterface Encryption handler
|
||||
*/
|
||||
@ -240,11 +222,6 @@ class Services extends BaseService
|
||||
* - set_error_handler
|
||||
* - register_shutdown_function
|
||||
*
|
||||
* @param ExceptionsConfig|null $config
|
||||
* @param IncomingRequest|null $request
|
||||
* @param Response|null $response
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Exceptions
|
||||
*/
|
||||
public static function exceptions(
|
||||
@ -270,9 +247,6 @@ class Services extends BaseService
|
||||
* and actions taken based on the request, while after filters can
|
||||
* act on or modify the response itself before it is sent to the client.
|
||||
*
|
||||
* @param FiltersConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Filters
|
||||
*/
|
||||
public static function filters(?FiltersConfig $config = null, bool $getShared = true)
|
||||
@ -289,9 +263,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Format class is a convenient place to create Formatters.
|
||||
*
|
||||
* @param FormatConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Format
|
||||
*/
|
||||
public static function format(?FormatConfig $config = null, bool $getShared = true)
|
||||
@ -309,9 +280,6 @@ class Services extends BaseService
|
||||
* The Honeypot provides a secret input on forms that bots should NOT
|
||||
* fill in, providing an additional safeguard when accepting user input.
|
||||
*
|
||||
* @param HoneypotConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Honeypot
|
||||
*/
|
||||
public static function honeypot(?HoneypotConfig $config = null, bool $getShared = true)
|
||||
@ -329,10 +297,6 @@ class Services extends BaseService
|
||||
* Acts as a factory for ImageHandler classes and returns an instance
|
||||
* of the handler. Used like Services::image()->withFile($path)->rotate(90)->save();
|
||||
*
|
||||
* @param string|null $handler
|
||||
* @param Images|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return BaseHandler
|
||||
*/
|
||||
public static function image(?string $handler = null, ?Images $config = null, bool $getShared = true)
|
||||
@ -353,8 +317,6 @@ class Services extends BaseService
|
||||
* and timing the results and memory usage. Used when debugging and
|
||||
* optimizing applications.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Iterator
|
||||
*/
|
||||
public static function iterator(bool $getShared = true)
|
||||
@ -369,9 +331,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* Responsible for loading the language string translations.
|
||||
*
|
||||
* @param string|null $locale
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Language
|
||||
*/
|
||||
public static function language(?string $locale = null, bool $getShared = true)
|
||||
@ -390,8 +349,6 @@ class Services extends BaseService
|
||||
* The Logger class is a PSR-3 compatible Logging class that supports
|
||||
* multiple handlers that process the actual logging.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Logger
|
||||
*/
|
||||
public static function logger(bool $getShared = true)
|
||||
@ -406,10 +363,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* Return the appropriate Migration runner.
|
||||
*
|
||||
* @param Migrations|null $config
|
||||
* @param ConnectionInterface|null $db
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return MigrationRunner
|
||||
*/
|
||||
public static function migrations(?Migrations $config = null, ?ConnectionInterface $db = null, bool $getShared = true)
|
||||
@ -428,9 +381,6 @@ class Services extends BaseService
|
||||
* working the request to determine correct language, encoding, charset,
|
||||
* and more.
|
||||
*
|
||||
* @param RequestInterface|null $request
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Negotiate
|
||||
*/
|
||||
public static function negotiator(?RequestInterface $request = null, bool $getShared = true)
|
||||
@ -447,10 +397,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* Return the appropriate pagination handler.
|
||||
*
|
||||
* @param PagerConfig|null $config
|
||||
* @param RendererInterface|null $view
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Pager
|
||||
*/
|
||||
public static function pager(?PagerConfig $config = null, ?RendererInterface $view = null, bool $getShared = true)
|
||||
@ -468,10 +414,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Parser is a simple template parser.
|
||||
*
|
||||
* @param string|null $viewPath
|
||||
* @param ViewConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Parser
|
||||
*/
|
||||
public static function parser(?string $viewPath = null, ?ViewConfig $config = null, bool $getShared = true)
|
||||
@ -491,10 +433,6 @@ class Services extends BaseService
|
||||
* The default View class within CodeIgniter is intentionally simple, but this
|
||||
* service could easily be replaced by a template engine if the user needed to.
|
||||
*
|
||||
* @param string|null $viewPath
|
||||
* @param ViewConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return View
|
||||
*/
|
||||
public static function renderer(?string $viewPath = null, ?ViewConfig $config = null, bool $getShared = true)
|
||||
@ -512,9 +450,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Request class models an HTTP request.
|
||||
*
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return IncomingRequest
|
||||
*/
|
||||
public static function request(?App $config = null, bool $getShared = true)
|
||||
@ -536,9 +471,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Response class models an HTTP response.
|
||||
*
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public static function response(?App $config = null, bool $getShared = true)
|
||||
@ -555,9 +487,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Redirect class provides nice way of working with redirects.
|
||||
*
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public static function redirectresponse(?App $config = null, bool $getShared = true)
|
||||
@ -577,8 +506,6 @@ class Services extends BaseService
|
||||
* The Routes service is a class that allows for easily building
|
||||
* a collection of routes.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return RouteCollection
|
||||
*/
|
||||
public static function routes(bool $getShared = true)
|
||||
@ -594,10 +521,6 @@ class Services extends BaseService
|
||||
* The Router class uses a RouteCollection's array of routes, and determines
|
||||
* the correct Controller and Method to execute.
|
||||
*
|
||||
* @param RouteCollectionInterface|null $routes
|
||||
* @param Request|null $request
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Router
|
||||
*/
|
||||
public static function router(?RouteCollectionInterface $routes = null, ?Request $request = null, bool $getShared = true)
|
||||
@ -616,9 +539,6 @@ class Services extends BaseService
|
||||
* The Security class provides a few handy tools for keeping the site
|
||||
* secure, most notably the CSRF protection tools.
|
||||
*
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Security
|
||||
*/
|
||||
public static function security(?App $config = null, bool $getShared = true)
|
||||
@ -635,9 +555,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* Return the session manager.
|
||||
*
|
||||
* @param App|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Session
|
||||
*/
|
||||
public static function session(?App $config = null, bool $getShared = true)
|
||||
@ -667,8 +584,6 @@ class Services extends BaseService
|
||||
* The Throttler class provides a simple method for implementing
|
||||
* rate limiting in your applications.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Throttler
|
||||
*/
|
||||
public static function throttler(bool $getShared = true)
|
||||
@ -684,8 +599,6 @@ class Services extends BaseService
|
||||
* The Timer class provides a simple way to Benchmark portions of your
|
||||
* application.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Timer
|
||||
*/
|
||||
public static function timer(bool $getShared = true)
|
||||
@ -700,9 +613,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* Return the debug toolbar.
|
||||
*
|
||||
* @param ToolbarConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Toolbar
|
||||
*/
|
||||
public static function toolbar(?ToolbarConfig $config = null, bool $getShared = true)
|
||||
@ -720,7 +630,6 @@ class Services extends BaseService
|
||||
* The URI class provides a way to model and manipulate URIs.
|
||||
*
|
||||
* @param string $uri
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return URI
|
||||
*/
|
||||
@ -736,9 +645,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Validation class provides tools for validating input data.
|
||||
*
|
||||
* @param ValidationConfig|null $config
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Validation
|
||||
*/
|
||||
public static function validation(?ValidationConfig $config = null, bool $getShared = true)
|
||||
@ -756,8 +662,6 @@ class Services extends BaseService
|
||||
* View cells are intended to let you insert HTML into view
|
||||
* that has been generated by any callable in the system.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Cell
|
||||
*/
|
||||
public static function viewcell(bool $getShared = true)
|
||||
@ -772,8 +676,6 @@ class Services extends BaseService
|
||||
/**
|
||||
* The Typography class provides a way to format text in semantically relevant ways.
|
||||
*
|
||||
* @param bool $getShared
|
||||
*
|
||||
* @return Typography
|
||||
*/
|
||||
public static function typography(bool $getShared = true)
|
||||
|
@ -69,10 +69,6 @@ class Controller
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param RequestInterface $request
|
||||
* @param ResponseInterface $response
|
||||
* @param LoggerInterface $logger
|
||||
*
|
||||
* @throws HTTPException
|
||||
*/
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
@ -109,8 +105,6 @@ class Controller
|
||||
/**
|
||||
* Provides a simple way to tie into the main CodeIgniter class and
|
||||
* tell it how long to cache the current page for.
|
||||
*
|
||||
* @param int $time
|
||||
*/
|
||||
protected function cachePage(int $time)
|
||||
{
|
||||
@ -139,8 +133,6 @@ class Controller
|
||||
*
|
||||
* @param array|string $rules
|
||||
* @param array $messages An array of custom error messages
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function validate($rules, array $messages = []): bool
|
||||
{
|
||||
|
@ -22,8 +22,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with a new cookie prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withPrefix(string $prefix = '');
|
||||
@ -31,8 +29,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with a new name.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withName(string $name);
|
||||
@ -40,8 +36,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with new value.
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withValue(string $value);
|
||||
@ -72,8 +66,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with a new path on the server the cookie is available.
|
||||
*
|
||||
* @param string|null $path
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withPath(?string $path);
|
||||
@ -81,8 +73,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with a new domain the cookie is available.
|
||||
*
|
||||
* @param string|null $domain
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withDomain(?string $domain);
|
||||
@ -90,8 +80,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with a new "Secure" attribute.
|
||||
*
|
||||
* @param bool $secure
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withSecure(bool $secure = true);
|
||||
@ -99,8 +87,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with a new "HttpOnly" attribute
|
||||
*
|
||||
* @param bool $httponly
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withHTTPOnly(bool $httponly = true);
|
||||
@ -108,8 +94,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with a new "SameSite" attribute.
|
||||
*
|
||||
* @param string $samesite
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withSameSite(string $samesite);
|
||||
@ -117,8 +101,6 @@ interface CloneableCookieInterface extends CookieInterface
|
||||
/**
|
||||
* Creates a new Cookie with URL encoding option updated.
|
||||
*
|
||||
* @param bool $raw
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withRaw(bool $raw = true);
|
||||
|
@ -158,9 +158,6 @@ class Cookie implements ArrayAccess, CloneableCookieInterface
|
||||
/**
|
||||
* Create a new Cookie instance from a `Set-Cookie` header.
|
||||
*
|
||||
* @param string $cookie
|
||||
* @param bool $raw
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
* @return static
|
||||
@ -701,8 +698,6 @@ class Cookie implements ArrayAccess, CloneableCookieInterface
|
||||
* Converts expires time to Unix format.
|
||||
*
|
||||
* @param DateTimeInterface|int|string $expires
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected static function convertExpiresTimestamp($expires = 0): int
|
||||
{
|
||||
@ -735,12 +730,7 @@ class Cookie implements ArrayAccess, CloneableCookieInterface
|
||||
* If `$raw` is true, names should not contain invalid characters
|
||||
* as `setrawcookie()` will reject this.
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $raw
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function validateName(string $name, bool $raw): void
|
||||
{
|
||||
@ -756,14 +746,7 @@ class Cookie implements ArrayAccess, CloneableCookieInterface
|
||||
/**
|
||||
* Validates the special prefixes if some attribute requirements are met.
|
||||
*
|
||||
* @param string $prefix
|
||||
* @param bool $secure
|
||||
* @param string $path
|
||||
* @param string $domain
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function validatePrefix(string $prefix, bool $secure, string $path, string $domain): void
|
||||
{
|
||||
@ -779,13 +762,8 @@ class Cookie implements ArrayAccess, CloneableCookieInterface
|
||||
/**
|
||||
* Validates the `SameSite` to be within the allowed types.
|
||||
*
|
||||
* @param string $samesite
|
||||
* @param bool $secure
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
|
||||
*/
|
||||
protected function validateSameSite(string $samesite, bool $secure): void
|
||||
|
@ -60,78 +60,56 @@ interface CookieInterface
|
||||
/**
|
||||
* Returns a unique identifier for the cookie consisting
|
||||
* of its prefixed name, path, and domain.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): string;
|
||||
|
||||
/**
|
||||
* Gets the cookie prefix.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrefix(): string;
|
||||
|
||||
/**
|
||||
* Gets the cookie name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string;
|
||||
|
||||
/**
|
||||
* Gets the cookie name prepended with the prefix, if any.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrefixedName(): string;
|
||||
|
||||
/**
|
||||
* Gets the cookie value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getValue(): string;
|
||||
|
||||
/**
|
||||
* Gets the time in Unix timestamp the cookie expires.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getExpiresTimestamp(): int;
|
||||
|
||||
/**
|
||||
* Gets the formatted expires time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getExpiresString(): string;
|
||||
|
||||
/**
|
||||
* Checks if the cookie is expired.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isExpired(): bool;
|
||||
|
||||
/**
|
||||
* Gets the "Max-Age" cookie attribute.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxAge(): int;
|
||||
|
||||
/**
|
||||
* Gets the "Path" cookie attribute.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPath(): string;
|
||||
|
||||
/**
|
||||
* Gets the "Domain" cookie attribute.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDomain(): string;
|
||||
|
||||
@ -141,8 +119,6 @@ interface CookieInterface
|
||||
* Checks if the cookie is only sent to the server when a request is made
|
||||
* with the `https:` scheme (except on `localhost`), and therefore is more
|
||||
* resistent to man-in-the-middle attacks.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isSecure(): bool;
|
||||
|
||||
@ -150,22 +126,16 @@ interface CookieInterface
|
||||
* Gets the "HttpOnly" cookie attribute.
|
||||
*
|
||||
* Checks if JavaScript is forbidden from accessing the cookie.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isHTTPOnly(): bool;
|
||||
|
||||
/**
|
||||
* Gets the "SameSite" cookie attribute.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSameSite(): string;
|
||||
|
||||
/**
|
||||
* Checks if the cookie should be sent with no URL encoding.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isRaw(): bool;
|
||||
|
||||
@ -179,8 +149,6 @@ interface CookieInterface
|
||||
|
||||
/**
|
||||
* Returns the Cookie as a header value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHeaderString(): string;
|
||||
|
||||
|
@ -35,7 +35,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
* Creates a CookieStore from an array of `Set-Cookie` headers.
|
||||
*
|
||||
* @param string[] $headers
|
||||
* @param bool $raw
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
@ -76,12 +75,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
/**
|
||||
* Checks if a `Cookie` object identified by name and
|
||||
* prefix is present in the collection.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $prefix
|
||||
* @param string|null $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function has(string $name, string $prefix = '', ?string $value = null): bool
|
||||
{
|
||||
@ -106,12 +99,7 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
* Retrieves an instance of `Cookie` identified by a name and prefix.
|
||||
* This throws an exception if not found.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $prefix
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
* @return Cookie
|
||||
*/
|
||||
public function get(string $name, string $prefix = ''): Cookie
|
||||
{
|
||||
@ -130,8 +118,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
* Store a new cookie and return a new collection. The original collection
|
||||
* is left unchanged.
|
||||
*
|
||||
* @param Cookie $cookie
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function put(Cookie $cookie)
|
||||
@ -151,9 +137,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
* If you intend to delete a cookie *from the browser*, you must put an empty
|
||||
* value cookie with the same name to the store.
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $prefix
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function remove(string $name, string $prefix = '')
|
||||
@ -175,8 +158,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
|
||||
/**
|
||||
* Dispatches all cookies in store.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function dispatch(): void
|
||||
{
|
||||
@ -207,8 +188,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
|
||||
/**
|
||||
* Clears the cookie collection.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function clear(): void
|
||||
{
|
||||
@ -217,8 +196,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
|
||||
/**
|
||||
* Gets the Cookie count in this collection.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
@ -238,11 +215,7 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
/**
|
||||
* Validates all cookies passed to be instances of Cookie.
|
||||
*
|
||||
* @param array $cookies
|
||||
*
|
||||
* @throws CookieException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function validateCookies(array $cookies): void
|
||||
{
|
||||
@ -259,12 +232,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
* Extracted call to `setrawcookie()` in order to run unit tests on it.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setRawCookie(string $name, string $value, array $options): void
|
||||
{
|
||||
@ -275,12 +242,6 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
* Extracted call to `setcookie()` in order to run unit tests on it.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $value
|
||||
* @param array $options
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setCookie(string $name, string $value, array $options): void
|
||||
{
|
||||
|
@ -21,8 +21,6 @@ class CookieException extends FrameworkException
|
||||
/**
|
||||
* Thrown for invalid type given for the "Expires" attribute.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function forInvalidExpiresTime(string $type)
|
||||
@ -43,8 +41,6 @@ class CookieException extends FrameworkException
|
||||
/**
|
||||
* Thrown when the cookie name contains invalid characters per RFC 2616.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function forInvalidCookieName(string $name)
|
||||
@ -87,8 +83,6 @@ class CookieException extends FrameworkException
|
||||
/**
|
||||
* Thrown when the `SameSite` attribute given is not of the valid types.
|
||||
*
|
||||
* @param string $sameSite
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public static function forInvalidSameSite(string $sameSite)
|
||||
|
@ -247,9 +247,7 @@ class BaseBuilder
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array|string $tableName
|
||||
* @param ConnectionInterface $db
|
||||
* @param array $options
|
||||
* @param array|string $tableName
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -302,8 +300,6 @@ class BaseBuilder
|
||||
|
||||
/**
|
||||
* Gets the name of the primary table.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTable(): string
|
||||
{
|
||||
@ -313,8 +309,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Returns an array of bind values and their
|
||||
* named parameters for binding in the Query object later.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBinds(): array
|
||||
{
|
||||
@ -327,8 +321,6 @@ class BaseBuilder
|
||||
* Set ignore Flag for next insert,
|
||||
* update or delete query.
|
||||
*
|
||||
* @param bool $ignore
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function ignore(bool $ignore = true)
|
||||
@ -467,8 +459,6 @@ class BaseBuilder
|
||||
* @used-by selectSum()
|
||||
*
|
||||
* @param string $select Field name
|
||||
* @param string $alias
|
||||
* @param string $type
|
||||
*
|
||||
* @throws DatabaseException
|
||||
* @throws DataException
|
||||
@ -505,10 +495,6 @@ class BaseBuilder
|
||||
|
||||
/**
|
||||
* Determines the alias name based on the table
|
||||
*
|
||||
* @param string $item
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function createAliasFromTable(string $item): string
|
||||
{
|
||||
@ -526,8 +512,6 @@ class BaseBuilder
|
||||
*
|
||||
* Sets a flag which tells the query string compiler to add DISTINCT
|
||||
*
|
||||
* @param bool $val
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function distinct(bool $val = true)
|
||||
@ -581,7 +565,6 @@ class BaseBuilder
|
||||
*
|
||||
* Generates the JOIN portion of the query
|
||||
*
|
||||
* @param string $table
|
||||
* @param string $cond The join condition
|
||||
* @param string $type The type of join
|
||||
* @param bool $escape Whether not to try to escape identifiers
|
||||
@ -697,7 +680,6 @@ class BaseBuilder
|
||||
* @param string $qbKey 'QBWhere' or 'QBHaving'
|
||||
* @param mixed $key
|
||||
* @param mixed $value
|
||||
* @param string $type
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return $this
|
||||
@ -908,7 +890,6 @@ class BaseBuilder
|
||||
* @param string $key The field to search
|
||||
* @param array|Closure|null $values The values searched on, or anonymous function with subquery
|
||||
* @param bool $not If the statement would be IN or NOT IN
|
||||
* @param string $type
|
||||
* @param bool $escape
|
||||
* @param string $clause (Internal use only)
|
||||
*
|
||||
@ -973,11 +954,9 @@ class BaseBuilder
|
||||
* Generates a %LIKE% portion of the query.
|
||||
* Separates multiple calls with 'AND'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -992,11 +971,9 @@ class BaseBuilder
|
||||
* Generates a NOT LIKE portion of the query.
|
||||
* Separates multiple calls with 'AND'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -1011,11 +988,9 @@ class BaseBuilder
|
||||
* Generates a %LIKE% portion of the query.
|
||||
* Separates multiple calls with 'OR'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -1030,11 +1005,9 @@ class BaseBuilder
|
||||
* Generates a NOT LIKE portion of the query.
|
||||
* Separates multiple calls with 'OR'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -1049,10 +1022,8 @@ class BaseBuilder
|
||||
* Generates a %LIKE% portion of the query.
|
||||
* Separates multiple calls with 'AND'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -1067,10 +1038,8 @@ class BaseBuilder
|
||||
* Generates a NOT LIKE portion of the query.
|
||||
* Separates multiple calls with 'AND'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -1085,10 +1054,8 @@ class BaseBuilder
|
||||
* Generates a %LIKE% portion of the query.
|
||||
* Separates multiple calls with 'OR'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -1103,10 +1070,8 @@ class BaseBuilder
|
||||
* Generates a NOT LIKE portion of the query.
|
||||
* Separates multiple calls with 'OR'.
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $side
|
||||
* @param bool $escape
|
||||
* @param mixed $field
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -1128,10 +1093,6 @@ class BaseBuilder
|
||||
* @used-by orNotHavingLike()
|
||||
*
|
||||
* @param mixed $field
|
||||
* @param string $match
|
||||
* @param string $type
|
||||
* @param string $side
|
||||
* @param string $not
|
||||
* @param bool $escape
|
||||
* @param bool $insensitiveSearch IF true, will force a case-insensitive search
|
||||
* @param string $clause (Internal use only)
|
||||
@ -1185,12 +1146,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Platform independent LIKE statement builder.
|
||||
*
|
||||
* @param string|null $prefix
|
||||
* @param string $column
|
||||
* @param string|null $not
|
||||
* @param string $bind
|
||||
* @param bool $insensitiveSearch
|
||||
*
|
||||
* @return string $like_statement
|
||||
*/
|
||||
protected function _like_statement(?string $prefix, string $column, ?string $not, string $bind, bool $insensitiveSearch = false): string
|
||||
@ -1305,10 +1260,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Prepate a query group start.
|
||||
*
|
||||
* @param string $not
|
||||
* @param string $type
|
||||
* @param string $clause
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
protected function groupStartPrepare(string $not = '', string $type = 'AND ', string $clause = 'QBWhere')
|
||||
@ -1330,8 +1281,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Prepate a query group end.
|
||||
*
|
||||
* @param string $clause
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
protected function groupEndPrepare(string $clause = 'QBWhere')
|
||||
@ -1355,10 +1304,6 @@ class BaseBuilder
|
||||
* @used-by whereHaving()
|
||||
* @used-by _whereIn()
|
||||
* @used-by havingGroupStart()
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function groupGetType(string $type): string
|
||||
{
|
||||
@ -1439,7 +1384,6 @@ class BaseBuilder
|
||||
/**
|
||||
* ORDER BY
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @param string $direction ASC, DESC or RANDOM
|
||||
* @param bool $escape
|
||||
*
|
||||
@ -1538,8 +1482,6 @@ class BaseBuilder
|
||||
* Generates a platform-specific LIMIT clause.
|
||||
*
|
||||
* @param string $sql SQL Query
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _limit(string $sql, bool $offsetIgnore = false): string
|
||||
{
|
||||
@ -1582,10 +1524,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Returns the previously set() data, alternatively resetting it
|
||||
* if needed.
|
||||
*
|
||||
* @param bool $clean
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSetData(bool $clean = false): array
|
||||
{
|
||||
@ -1604,8 +1542,6 @@ class BaseBuilder
|
||||
* Compiles a SELECT query string and returns the sql.
|
||||
*
|
||||
* @param bool $reset TRUE: resets QB values; FALSE: leave QB values alone
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCompiledSelect(bool $reset = true): string
|
||||
{
|
||||
@ -1621,10 +1557,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Returns a finalized, compiled query string with the bindings
|
||||
* inserted and prefixes swapped out.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function compileFinalQuery(string $sql): string
|
||||
{
|
||||
@ -1711,8 +1643,6 @@ class BaseBuilder
|
||||
* Generates a platform-specific query string that counts all records
|
||||
* returned by an Query Builder query.
|
||||
*
|
||||
* @param bool $reset
|
||||
*
|
||||
* @return int|string when $test = true
|
||||
*/
|
||||
public function countAllResults(bool $reset = true)
|
||||
@ -1884,8 +1814,6 @@ class BaseBuilder
|
||||
* @param string $table Table name
|
||||
* @param array $keys INSERT keys
|
||||
* @param array $values INSERT values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _insertBatch(string $table, array $keys, array $values): string
|
||||
{
|
||||
@ -1895,9 +1823,8 @@ class BaseBuilder
|
||||
/**
|
||||
* The "setInsertBatch" function. Allows key/value pairs to be set for batch inserts
|
||||
*
|
||||
* @param mixed $key
|
||||
* @param string $value
|
||||
* @param bool $escape
|
||||
* @param mixed $key
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return $this|null
|
||||
*/
|
||||
@ -2033,8 +1960,6 @@ class BaseBuilder
|
||||
* has been chosen to be inserted into.
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function validateInsert(): bool
|
||||
{
|
||||
@ -2058,8 +1983,6 @@ class BaseBuilder
|
||||
* @param string $table The table name
|
||||
* @param array $keys The insert keys
|
||||
* @param array $unescapedKeys The insert values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _insert(string $table, array $keys, array $unescapedKeys): string
|
||||
{
|
||||
@ -2109,8 +2032,6 @@ class BaseBuilder
|
||||
* @param string $table The table name
|
||||
* @param array $keys The insert keys
|
||||
* @param array $values The insert values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _replace(string $table, array $keys, array $values): string
|
||||
{
|
||||
@ -2124,8 +2045,6 @@ class BaseBuilder
|
||||
* about operator precedence.
|
||||
*
|
||||
* Note: This is only used (and overridden) by MySQL and SQLSRV.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _fromTables(): string
|
||||
{
|
||||
@ -2218,8 +2137,6 @@ class BaseBuilder
|
||||
*
|
||||
* @param string $table the Table name
|
||||
* @param array $values the Update data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _update(string $table, array $values): string
|
||||
{
|
||||
@ -2243,8 +2160,6 @@ class BaseBuilder
|
||||
* chosen to be update.
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function validateUpdate(): bool
|
||||
{
|
||||
@ -2343,8 +2258,6 @@ class BaseBuilder
|
||||
* @param string $table Table name
|
||||
* @param array $values Update data
|
||||
* @param string $index WHERE key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _updateBatch(string $table, array $values, string $index): string
|
||||
{
|
||||
@ -2378,7 +2291,6 @@ class BaseBuilder
|
||||
* The "setUpdateBatch" function. Allows key/value pairs to be set for batch updating
|
||||
*
|
||||
* @param array|object $key
|
||||
* @param string $index
|
||||
* @param bool $escape
|
||||
*
|
||||
* @throws DatabaseException
|
||||
@ -2476,8 +2388,6 @@ class BaseBuilder
|
||||
* then this method maps to 'DELETE FROM table'
|
||||
*
|
||||
* @param string $table The table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _truncate(string $table): string
|
||||
{
|
||||
@ -2490,8 +2400,6 @@ class BaseBuilder
|
||||
* Compiles a delete query string and returns the sql
|
||||
*
|
||||
* @param bool $reset TRUE: reset QB values; FALSE: leave QB values alone
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCompiledDelete(bool $reset = true): string
|
||||
{
|
||||
@ -2506,9 +2414,8 @@ class BaseBuilder
|
||||
*
|
||||
* Compiles a delete string and runs the query
|
||||
*
|
||||
* @param mixed $where The where clause
|
||||
* @param int $limit The limit clause
|
||||
* @param bool $resetData
|
||||
* @param mixed $where The where clause
|
||||
* @param int $limit The limit clause
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
@ -2555,9 +2462,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Increments a numeric column by the specified value.
|
||||
*
|
||||
* @param string $column
|
||||
* @param int $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function increment(string $column, int $value = 1)
|
||||
@ -2572,9 +2476,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Decrements a numeric column by the specified value.
|
||||
*
|
||||
* @param string $column
|
||||
* @param int $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function decrement(string $column, int $value = 1)
|
||||
@ -2592,8 +2493,6 @@ class BaseBuilder
|
||||
* Generates a platform-specific delete string from the supplied data
|
||||
*
|
||||
* @param string $table The table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _delete(string $table): string
|
||||
{
|
||||
@ -2645,8 +2544,6 @@ class BaseBuilder
|
||||
* Should not be called directly.
|
||||
*
|
||||
* @param mixed $selectOverride
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function compileSelect($selectOverride = false): string
|
||||
{
|
||||
@ -2699,8 +2596,6 @@ class BaseBuilder
|
||||
* Checks if the ignore option is supported by
|
||||
* the Database Driver for the specific statement.
|
||||
*
|
||||
* @param string $statement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function compileIgnore(string $statement)
|
||||
@ -2919,10 +2814,6 @@ class BaseBuilder
|
||||
* Is literal
|
||||
*
|
||||
* Determines if a string represents a literal value or a field name
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function isLiteral(string $str): bool
|
||||
{
|
||||
@ -3022,10 +2913,6 @@ class BaseBuilder
|
||||
|
||||
/**
|
||||
* Tests whether the string has an SQL operator
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasOperator(string $str): bool
|
||||
{
|
||||
@ -3035,9 +2922,6 @@ class BaseBuilder
|
||||
/**
|
||||
* Returns the SQL string operator
|
||||
*
|
||||
* @param string $str
|
||||
* @param bool $list
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getOperator(string $str, bool $list = false)
|
||||
@ -3071,11 +2955,7 @@ class BaseBuilder
|
||||
* with PHP 7+ we get a huge memory/performance gain with indexed
|
||||
* arrays instead, so lets take advantage of that here.
|
||||
*
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return string
|
||||
* @param mixed $value
|
||||
*/
|
||||
protected function setBind(string $key, $value = null, bool $escape = true): string
|
||||
{
|
||||
|
@ -297,8 +297,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Saves our connection settings.
|
||||
*
|
||||
* @param array $params
|
||||
*/
|
||||
public function __construct(array $params)
|
||||
{
|
||||
@ -387,8 +385,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Connect to the database.
|
||||
*
|
||||
* @param bool $persistent
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function connect(bool $persistent = false);
|
||||
@ -437,8 +433,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* get that connection. If you pass either alias in and only a single
|
||||
* connection is present, it must return the sole connection.
|
||||
*
|
||||
* @param string|null $alias
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getConnection(?string $alias = null)
|
||||
@ -450,16 +444,12 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Select a specific database table to use.
|
||||
*
|
||||
* @param string $databaseName
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function setDatabase(string $databaseName);
|
||||
|
||||
/**
|
||||
* Returns the name of the current database being used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDatabase(): string
|
||||
{
|
||||
@ -472,8 +462,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* Set's the DB Prefix to something new without needing to reconnect
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function setPrefix(string $prefix = ''): string
|
||||
{
|
||||
@ -482,8 +470,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Returns the database prefix.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPrefix(): string
|
||||
{
|
||||
@ -492,8 +478,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* The name of the platform in use (MySQLi, mssql, etc)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPlatform(): string
|
||||
{
|
||||
@ -502,8 +486,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Returns a string containing the version of the database being used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function getVersion(): string;
|
||||
|
||||
@ -512,8 +494,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* collected during use of the Builder, and set here
|
||||
* so queries are built correctly.
|
||||
*
|
||||
* @param array $aliases
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAliasedTables(array $aliases)
|
||||
@ -526,8 +506,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Add a table alias to our list.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addTableAlias(string $table)
|
||||
@ -542,8 +520,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Executes the query against the database.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract protected function execute(string $sql);
|
||||
@ -556,10 +532,7 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* Should automatically handle different connections for read/write
|
||||
* queries if needed.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param mixed ...$binds
|
||||
* @param bool $setEscapeFlags
|
||||
* @param string $queryClass
|
||||
* @param mixed ...$binds
|
||||
*
|
||||
* @return BaseResult|bool|Query
|
||||
*
|
||||
@ -655,8 +628,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* is performed, nor are transactions handled. Simply takes a raw
|
||||
* query string and returns the database-specific result id.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function simpleQuery(string $sql)
|
||||
@ -703,10 +674,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Start Transaction
|
||||
*
|
||||
* @param bool $testMode
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function transStart(bool $testMode = false): bool
|
||||
{
|
||||
@ -719,8 +686,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Complete Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function transComplete(): bool
|
||||
{
|
||||
@ -748,8 +713,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Lets you retrieve the transaction flag to determine if it has failed
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function transStatus(): bool
|
||||
{
|
||||
@ -758,10 +721,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Begin Transaction
|
||||
*
|
||||
* @param bool $testMode
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function transBegin(bool $testMode = false): bool
|
||||
{
|
||||
@ -796,8 +755,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Commit Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function transCommit(): bool
|
||||
{
|
||||
@ -817,8 +774,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Rollback Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function transRollback(): bool
|
||||
{
|
||||
@ -838,22 +793,16 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Begin Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function _transBegin(): bool;
|
||||
|
||||
/**
|
||||
* Commit Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function _transCommit(): bool;
|
||||
|
||||
/**
|
||||
* Rollback Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract protected function _transRollback(): bool;
|
||||
|
||||
@ -891,8 +840,7 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* ->get();
|
||||
* })
|
||||
*
|
||||
* @param Closure $func
|
||||
* @param array $options Passed to the prepare() method
|
||||
* @param array $options Passed to the prepare() method
|
||||
*
|
||||
* @return BasePreparedQuery|null
|
||||
*/
|
||||
@ -934,8 +882,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Returns a string representation of the last query's statement object.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function showLastQuery(): string
|
||||
{
|
||||
@ -947,8 +893,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* seconds with microseconds.
|
||||
*
|
||||
* Used by the Debug Toolbar's timeline.
|
||||
*
|
||||
* @return float|null
|
||||
*/
|
||||
public function getConnectStart(): ?float
|
||||
{
|
||||
@ -960,10 +904,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* to connect to the database.
|
||||
*
|
||||
* Used by the Debug Toolbar's timeline.
|
||||
*
|
||||
* @param int $decimals
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getConnectDuration(int $decimals = 6): string
|
||||
{
|
||||
@ -991,9 +931,7 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* the correct identifiers.
|
||||
*
|
||||
* @param array|string $item
|
||||
* @param bool $prefixSingle
|
||||
* @param bool $protectIdentifiers
|
||||
* @param bool $fieldExists
|
||||
*
|
||||
* @return array|string
|
||||
*/
|
||||
@ -1196,8 +1134,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* @param string $table the table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function prefixTable(string $table = ''): string
|
||||
{
|
||||
@ -1210,8 +1146,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Returns the total number of rows affected by this query.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
abstract public function affectedRows(): int;
|
||||
|
||||
@ -1305,10 +1239,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* Platform independent string escape.
|
||||
*
|
||||
* Will likely be overridden in child classes.
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _escapeString(string $str): string
|
||||
{
|
||||
@ -1319,12 +1249,9 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* This function enables you to call PHP database functions that are not natively included
|
||||
* in CodeIgniter, in a platform independent manner.
|
||||
*
|
||||
* @param string $functionName
|
||||
* @param array ...$params
|
||||
* @param array ...$params
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function callFunction(string $functionName, ...$params): bool
|
||||
{
|
||||
@ -1405,10 +1332,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Determine if a particular table exists
|
||||
*
|
||||
* @param string $tableName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function tableExists(string $tableName): bool
|
||||
{
|
||||
@ -1467,11 +1390,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Determine if a particular field exists
|
||||
*
|
||||
* @param string $fieldName
|
||||
* @param string $tableName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function fieldExists(string $fieldName, string $tableName): bool
|
||||
{
|
||||
@ -1540,8 +1458,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
*
|
||||
* This is primarily used by the prepared query functionality.
|
||||
*
|
||||
* @param bool $pretend
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function pretend(bool $pretend = true)
|
||||
@ -1567,8 +1483,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* Determines if the statement is a write-type query or not.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isWriteType($sql): bool
|
||||
{
|
||||
@ -1581,8 +1495,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
* Must return an array with keys 'code' and 'message':
|
||||
*
|
||||
* return ['code' => null, 'message' => null);
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract public function error(): array;
|
||||
|
||||
@ -1596,8 +1508,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Generates the SQL for listing tables in a platform-dependent manner.
|
||||
*
|
||||
* @param bool $constrainByPrefix
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
abstract protected function _listTables(bool $constrainByPrefix = false);
|
||||
@ -1605,8 +1515,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Generates a platform-specific query string so that the column names can be fetched.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
abstract protected function _listColumns(string $table = '');
|
||||
@ -1614,41 +1522,27 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Platform-specific field data information.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @see getFieldData()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract protected function _fieldData(string $table): array;
|
||||
|
||||
/**
|
||||
* Platform-specific index data.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @see getIndexData()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract protected function _indexData(string $table): array;
|
||||
|
||||
/**
|
||||
* Platform-specific foreign keys data.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @see getForeignKeyData()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract protected function _foreignKeyData(string $table): array;
|
||||
|
||||
/**
|
||||
* Accessor for properties if they exist.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __get(string $key)
|
||||
@ -1662,10 +1556,6 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
|
||||
/**
|
||||
* Checker for properties existence.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset(string $key): bool
|
||||
{
|
||||
|
@ -57,8 +57,6 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param BaseConnection $db
|
||||
*/
|
||||
public function __construct(BaseConnection $db)
|
||||
{
|
||||
@ -72,9 +70,7 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
* NOTE: This version is based on SQL code. Child classes should
|
||||
* override this method.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
* @param string $queryClass
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -104,8 +100,7 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
/**
|
||||
* The database-dependent portion of the prepare statement.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -145,10 +140,6 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
|
||||
/**
|
||||
* The database dependant version of the execute method.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
abstract public function _execute(array $data): bool;
|
||||
|
||||
@ -175,8 +166,6 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
|
||||
/**
|
||||
* Returns the SQL that has been prepared.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQueryString(): string
|
||||
{
|
||||
@ -189,8 +178,6 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
|
||||
/**
|
||||
* A helper to determine if any error exists.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasError(): bool
|
||||
{
|
||||
@ -199,8 +186,6 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
|
||||
/**
|
||||
* Returns the error code created while executing this statement.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getErrorCode(): int
|
||||
{
|
||||
@ -209,8 +194,6 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
|
||||
|
||||
/**
|
||||
* Returns the error message created while executing this statement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorMessage(): string
|
||||
{
|
||||
|
@ -92,8 +92,6 @@ abstract class BaseResult implements ResultInterface
|
||||
* 'object', or a custom class name.
|
||||
*
|
||||
* @param string $type The row type. Either 'array', 'object', or a class name to use
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getResult(string $type = 'object'): array
|
||||
{
|
||||
@ -166,8 +164,6 @@ abstract class BaseResult implements ResultInterface
|
||||
* Returns the results as an array of arrays.
|
||||
*
|
||||
* If no results, an empty array is returned.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getResultArray(): array
|
||||
{
|
||||
@ -205,8 +201,6 @@ abstract class BaseResult implements ResultInterface
|
||||
* Returns the results as an array of objects.
|
||||
*
|
||||
* If no results, an empty array is returned.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getResultObject(): array
|
||||
{
|
||||
@ -288,9 +282,6 @@ abstract class BaseResult implements ResultInterface
|
||||
*
|
||||
* If row doesn't exists, returns null.
|
||||
*
|
||||
* @param int $n
|
||||
* @param string $className
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCustomRowObject(int $n, string $className)
|
||||
@ -315,8 +306,6 @@ abstract class BaseResult implements ResultInterface
|
||||
*
|
||||
* If row doesn't exist, returns null.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRowArray(int $n = 0)
|
||||
@ -338,8 +327,6 @@ abstract class BaseResult implements ResultInterface
|
||||
*
|
||||
* If row doesn't exist, returns null.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRowObject(int $n = 0)
|
||||
@ -387,8 +374,6 @@ abstract class BaseResult implements ResultInterface
|
||||
/**
|
||||
* Returns the "first" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getFirstRow(string $type = 'object')
|
||||
@ -401,8 +386,6 @@ abstract class BaseResult implements ResultInterface
|
||||
/**
|
||||
* Returns the "last" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLastRow(string $type = 'object')
|
||||
@ -415,8 +398,6 @@ abstract class BaseResult implements ResultInterface
|
||||
/**
|
||||
* Returns the "next" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getNextRow(string $type = 'object')
|
||||
@ -432,8 +413,6 @@ abstract class BaseResult implements ResultInterface
|
||||
/**
|
||||
* Returns the "previous" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPreviousRow(string $type = 'object')
|
||||
@ -453,8 +432,6 @@ abstract class BaseResult implements ResultInterface
|
||||
/**
|
||||
* Returns an unbuffered row and move the pointer to the next row.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUnbufferedRow(string $type = 'object')
|
||||
@ -474,8 +451,6 @@ abstract class BaseResult implements ResultInterface
|
||||
* Number of rows in the result set; checks for previous count, falls
|
||||
* back on counting resultArray or resultObject, finally fetching resultArray
|
||||
* if nothing was previously fetched
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getNumRows(): int
|
||||
{
|
||||
@ -494,22 +469,16 @@ abstract class BaseResult implements ResultInterface
|
||||
|
||||
/**
|
||||
* Gets the number of fields in the result set.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
abstract public function getFieldCount(): int;
|
||||
|
||||
/**
|
||||
* Generates an array of column names in the result set.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract public function getFieldNames(): array;
|
||||
|
||||
/**
|
||||
* Generates an array of objects representing field meta-data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
abstract public function getFieldData(): array;
|
||||
|
||||
@ -525,8 +494,6 @@ abstract class BaseResult implements ResultInterface
|
||||
* internally before fetching results to make sure the result set
|
||||
* starts at zero.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function dataSeek(int $n = 0);
|
||||
@ -545,8 +512,6 @@ abstract class BaseResult implements ResultInterface
|
||||
*
|
||||
* Overridden by child classes.
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
abstract protected function fetchObject(string $className = 'stdClass');
|
||||
|
@ -48,8 +48,6 @@ abstract class BaseUtils
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
* @param ConnectionInterface $db
|
||||
*/
|
||||
public function __construct(ConnectionInterface &$db)
|
||||
{
|
||||
@ -94,10 +92,6 @@ abstract class BaseUtils
|
||||
|
||||
/**
|
||||
* Determine if a particular database exists
|
||||
*
|
||||
* @param string $databaseName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function databaseExists(string $databaseName): bool
|
||||
{
|
||||
@ -107,8 +101,6 @@ abstract class BaseUtils
|
||||
/**
|
||||
* Optimize Table
|
||||
*
|
||||
* @param string $tableName
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
@ -176,8 +168,6 @@ abstract class BaseUtils
|
||||
/**
|
||||
* Repair Table
|
||||
*
|
||||
* @param string $tableName
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return mixed
|
||||
@ -241,8 +231,6 @@ abstract class BaseUtils
|
||||
*
|
||||
* @param ResultInterface $query Query result object
|
||||
* @param array $params Any preferences
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getXMLFromResult(ResultInterface $query, array $params = []): string
|
||||
{
|
||||
@ -349,8 +337,6 @@ abstract class BaseUtils
|
||||
/**
|
||||
* Platform dependent version of the backup function.
|
||||
*
|
||||
* @param array|null $prefs
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
abstract public function _backup(?array $prefs = null);
|
||||
|
@ -85,8 +85,6 @@ class Config extends BaseConfig
|
||||
|
||||
/**
|
||||
* Returns an array of all db connections currently made.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getConnections(): array
|
||||
{
|
||||
@ -125,8 +123,6 @@ class Config extends BaseConfig
|
||||
/**
|
||||
* Returns a new instance of the Database Seeder.
|
||||
*
|
||||
* @param string|null $group
|
||||
*
|
||||
* @return Seeder
|
||||
*/
|
||||
public static function seeder(?string $group = null)
|
||||
|
@ -26,8 +26,6 @@ interface ConnectionInterface
|
||||
/**
|
||||
* Connect to the database.
|
||||
*
|
||||
* @param bool $persistent
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function connect(bool $persistent = false);
|
||||
@ -53,8 +51,6 @@ interface ConnectionInterface
|
||||
* get that connection. If you pass either alias in and only a single
|
||||
* connection is present, it must return the sole connection.
|
||||
*
|
||||
* @param string|null $alias
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getConnection(?string $alias = null);
|
||||
@ -62,16 +58,12 @@ interface ConnectionInterface
|
||||
/**
|
||||
* Select a specific database table to use.
|
||||
*
|
||||
* @param string $databaseName
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function setDatabase(string $databaseName);
|
||||
|
||||
/**
|
||||
* Returns the name of the current database being used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDatabase(): string;
|
||||
|
||||
@ -80,21 +72,17 @@ interface ConnectionInterface
|
||||
* Must return this format: ['code' => string|int, 'message' => string]
|
||||
* intval(code) === 0 means "no error".
|
||||
*
|
||||
* @return array<string,int|string>
|
||||
* @return array<string, int|string>
|
||||
*/
|
||||
public function error(): array;
|
||||
|
||||
/**
|
||||
* The name of the platform in use (MySQLi, mssql, etc)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPlatform(): string;
|
||||
|
||||
/**
|
||||
* Returns a string containing the version of the database being used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string;
|
||||
|
||||
@ -106,8 +94,7 @@ interface ConnectionInterface
|
||||
* Should automatically handle different connections for read/write
|
||||
* queries if needed.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param mixed ...$binds
|
||||
* @param mixed ...$binds
|
||||
*
|
||||
* @return BaseResult|bool|Query
|
||||
*/
|
||||
@ -118,8 +105,6 @@ interface ConnectionInterface
|
||||
* is performed, nor are transactions handled. Simply takes a raw
|
||||
* query string and returns the database-specific result id.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function simpleQuery(string $sql);
|
||||
@ -156,8 +141,7 @@ interface ConnectionInterface
|
||||
* Allows for custom calls to the database engine that are not
|
||||
* supported through our database layer.
|
||||
*
|
||||
* @param string $functionName
|
||||
* @param array ...$params
|
||||
* @param array ...$params
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -167,8 +151,6 @@ interface ConnectionInterface
|
||||
* Determines if the statement is a write-type query or not.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isWriteType($sql): bool;
|
||||
}
|
||||
|
@ -35,9 +35,6 @@ class Database
|
||||
* Parses the connection binds and returns an instance of the driver
|
||||
* ready to go.
|
||||
*
|
||||
* @param array $params
|
||||
* @param string $alias
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return mixed
|
||||
@ -68,10 +65,6 @@ class Database
|
||||
|
||||
/**
|
||||
* Creates a Forge instance for the current database type.
|
||||
*
|
||||
* @param ConnectionInterface $db
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function loadForge(ConnectionInterface $db): object
|
||||
{
|
||||
@ -85,10 +78,6 @@ class Database
|
||||
|
||||
/**
|
||||
* Creates a Utils instance for the current database type.
|
||||
*
|
||||
* @param ConnectionInterface $db
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function loadUtils(ConnectionInterface $db): object
|
||||
{
|
||||
@ -103,11 +92,7 @@ class Database
|
||||
/**
|
||||
* Parse universal DSN string
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function parseDSN(array $params): array
|
||||
{
|
||||
@ -149,8 +134,6 @@ class Database
|
||||
* @param string $driver Database driver name (e.g. 'MySQLi')
|
||||
* @param string $class Database class name (e.g. 'Forge')
|
||||
* @param array|object $argument
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
protected function initDriver(string $driver, string $class, $argument): object
|
||||
{
|
||||
|
@ -21,8 +21,6 @@ class DataException extends RuntimeException implements ExceptionInterface
|
||||
/**
|
||||
* Used by the Model's trigger() method when the callback cannot be found.
|
||||
*
|
||||
* @param string $method
|
||||
*
|
||||
* @return DataException
|
||||
*/
|
||||
public static function forInvalidMethodTriggered(string $method)
|
||||
@ -34,8 +32,6 @@ class DataException extends RuntimeException implements ExceptionInterface
|
||||
* Used by Model's insert/update methods when there isn't
|
||||
* any data to actually work with.
|
||||
*
|
||||
* @param string $mode
|
||||
*
|
||||
* @return DataException
|
||||
*/
|
||||
public static function forEmptyDataset(string $mode)
|
||||
@ -48,8 +44,6 @@ class DataException extends RuntimeException implements ExceptionInterface
|
||||
* primary key defined and Model has option `useAutoIncrement`
|
||||
* set to false.
|
||||
*
|
||||
* @param string $mode
|
||||
*
|
||||
* @return DataException
|
||||
*/
|
||||
public static function forEmptyPrimaryKey(string $mode)
|
||||
@ -62,8 +56,6 @@ class DataException extends RuntimeException implements ExceptionInterface
|
||||
* were empty or otherwise invalid, and they could not be
|
||||
* to work correctly for that method.
|
||||
*
|
||||
* @param string $argument
|
||||
*
|
||||
* @return DataException
|
||||
*/
|
||||
public static function forInvalidArgument(string $argument)
|
||||
|
@ -162,8 +162,6 @@ class Forge
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param BaseConnection $db
|
||||
*/
|
||||
public function __construct(BaseConnection $db)
|
||||
{
|
||||
@ -183,12 +181,9 @@ class Forge
|
||||
/**
|
||||
* Create database
|
||||
*
|
||||
* @param string $dbName
|
||||
* @param bool $ifNotExists Whether to add IF NOT EXISTS condition
|
||||
* @param bool $ifNotExists Whether to add IF NOT EXISTS condition
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function createDatabase(string $dbName, bool $ifNotExists = false): bool
|
||||
{
|
||||
@ -237,11 +232,7 @@ class Forge
|
||||
/**
|
||||
* Determine if a database exists
|
||||
*
|
||||
* @param string $dbName
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function databaseExists(string $dbName): bool
|
||||
{
|
||||
@ -259,11 +250,7 @@ class Forge
|
||||
/**
|
||||
* Drop database
|
||||
*
|
||||
* @param string $dbName
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function dropDatabase(string $dbName): bool
|
||||
{
|
||||
@ -297,8 +284,6 @@ class Forge
|
||||
* Add Key
|
||||
*
|
||||
* @param array|string $key
|
||||
* @param bool $primary
|
||||
* @param bool $unique
|
||||
*
|
||||
* @return Forge
|
||||
*/
|
||||
@ -381,12 +366,6 @@ class Forge
|
||||
/**
|
||||
* Add Foreign Key
|
||||
*
|
||||
* @param string $fieldName
|
||||
* @param string $tableName
|
||||
* @param string $tableField
|
||||
* @param string $onUpdate
|
||||
* @param string $onDelete
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return Forge
|
||||
@ -547,8 +526,6 @@ class Forge
|
||||
* CREATE TABLE attributes
|
||||
*
|
||||
* @param array $attributes Associative array of table attributes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _createTableAttributes(array $attributes): string
|
||||
{
|
||||
@ -695,8 +672,6 @@ class Forge
|
||||
* @param array|string $field Column definition
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function addColumn(string $table, $field): bool
|
||||
{
|
||||
@ -759,8 +734,6 @@ class Forge
|
||||
* @param array|string $field Column definition
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function modifyColumn(string $table, $field): bool
|
||||
{
|
||||
@ -839,10 +812,6 @@ class Forge
|
||||
|
||||
/**
|
||||
* Process fields
|
||||
*
|
||||
* @param bool $createTable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function _processFields(bool $createTable = false): array
|
||||
{
|
||||
@ -926,10 +895,6 @@ class Forge
|
||||
|
||||
/**
|
||||
* Process column
|
||||
*
|
||||
* @param array $field
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processColumn(array $field): string
|
||||
{
|
||||
@ -947,8 +912,6 @@ class Forge
|
||||
*
|
||||
* Performs a data type mapping between different databases.
|
||||
*
|
||||
* @param array $attributes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _attributeType(array &$attributes)
|
||||
@ -968,9 +931,6 @@ class Forge
|
||||
* - array(TYPE => UTYPE) will change $field['type'],
|
||||
* from TYPE to UTYPE in case of a match
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $field
|
||||
*
|
||||
* @return void|null
|
||||
*/
|
||||
protected function _attributeUnsigned(array &$attributes, array &$field)
|
||||
@ -1006,9 +966,6 @@ class Forge
|
||||
/**
|
||||
* Field attribute DEFAULT
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $field
|
||||
*
|
||||
* @return void|null
|
||||
*/
|
||||
protected function _attributeDefault(array &$attributes, array &$field)
|
||||
@ -1033,9 +990,6 @@ class Forge
|
||||
/**
|
||||
* Field attribute UNIQUE
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $field
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _attributeUnique(array &$attributes, array &$field)
|
||||
@ -1048,9 +1002,6 @@ class Forge
|
||||
/**
|
||||
* Field attribute AUTO_INCREMENT
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $field
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _attributeAutoIncrement(array &$attributes, array &$field)
|
||||
@ -1066,8 +1017,6 @@ class Forge
|
||||
* Process primary keys
|
||||
*
|
||||
* @param string $table Table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processPrimaryKeys(string $table): string
|
||||
{
|
||||
@ -1090,8 +1039,6 @@ class Forge
|
||||
/**
|
||||
* Process indexes
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return array|string
|
||||
*/
|
||||
protected function _processIndexes(string $table)
|
||||
@ -1130,8 +1077,6 @@ class Forge
|
||||
* Process foreign keys
|
||||
*
|
||||
* @param string $table Table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processForeignKeys(string $table): string
|
||||
{
|
||||
|
@ -127,7 +127,6 @@ class MigrationRunner
|
||||
* - existing connection instance
|
||||
* - array of database configuration values
|
||||
*
|
||||
* @param MigrationsConfig $config
|
||||
* @param array|ConnectionInterface|string|null $db
|
||||
*
|
||||
* @throws ConfigException
|
||||
@ -153,8 +152,6 @@ class MigrationRunner
|
||||
/**
|
||||
* Locate and run all new migrations
|
||||
*
|
||||
* @param string|null $group
|
||||
*
|
||||
* @throws ConfigException
|
||||
* @throws RuntimeException
|
||||
*
|
||||
@ -229,8 +226,7 @@ class MigrationRunner
|
||||
*
|
||||
* Calls each migration step required to get to the provided batch
|
||||
*
|
||||
* @param int $targetBatch Target batch number, or negative for a relative batch, 0 for all
|
||||
* @param string|null $group
|
||||
* @param int $targetBatch Target batch number, or negative for a relative batch, 0 for all
|
||||
*
|
||||
* @throws ConfigException
|
||||
* @throws RuntimeException
|
||||
@ -351,9 +347,8 @@ class MigrationRunner
|
||||
* Method "up" or "down" determined by presence in history.
|
||||
* NOTE: This is not recommended and provided mostly for testing.
|
||||
*
|
||||
* @param string $path Full path to a valid migration file
|
||||
* @param string $path Namespace of the target migration
|
||||
* @param string|null $group
|
||||
* @param string $path Full path to a valid migration file
|
||||
* @param string $path Namespace of the target migration
|
||||
*/
|
||||
public function force(string $path, string $namespace, ?string $group = null)
|
||||
{
|
||||
@ -548,8 +543,6 @@ class MigrationRunner
|
||||
* Set database Group.
|
||||
* Allows other scripts to modify on the fly as needed.
|
||||
*
|
||||
* @param string $group
|
||||
*
|
||||
* @return MigrationRunner
|
||||
*/
|
||||
public function setGroup(string $group)
|
||||
@ -562,8 +555,6 @@ class MigrationRunner
|
||||
/**
|
||||
* Set migration Name.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return MigrationRunner
|
||||
*/
|
||||
public function setName(string $name)
|
||||
@ -577,8 +568,6 @@ class MigrationRunner
|
||||
* If $silent == true, then will not throw exceptions and will
|
||||
* attempt to continue gracefully.
|
||||
*
|
||||
* @param bool $silent
|
||||
*
|
||||
* @return MigrationRunner
|
||||
*/
|
||||
public function setSilent(bool $silent)
|
||||
@ -591,8 +580,6 @@ class MigrationRunner
|
||||
/**
|
||||
* Extracts the migration number from a filename
|
||||
*
|
||||
* @param string $migration
|
||||
*
|
||||
* @return string Numeric portion of a migration filename
|
||||
*/
|
||||
protected function getMigrationNumber(string $migration): string
|
||||
@ -605,8 +592,6 @@ class MigrationRunner
|
||||
/**
|
||||
* Extracts the migration class name from a filename
|
||||
*
|
||||
* @param string $migration
|
||||
*
|
||||
* @return string text portion of a migration filename
|
||||
*/
|
||||
protected function getMigrationName(string $migration): string
|
||||
@ -622,8 +607,6 @@ class MigrationRunner
|
||||
* to create a sortable unique key
|
||||
*
|
||||
* @param object $object migration or $history
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getObjectUid($object): string
|
||||
{
|
||||
@ -668,7 +651,6 @@ class MigrationRunner
|
||||
* Add a history to the table.
|
||||
*
|
||||
* @param object $migration
|
||||
* @param int $batch
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -718,10 +700,6 @@ class MigrationRunner
|
||||
|
||||
/**
|
||||
* Grabs the full migration history from the database for a group
|
||||
*
|
||||
* @param string $group
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getHistory(string $group = 'default'): array
|
||||
{
|
||||
@ -747,9 +725,7 @@ class MigrationRunner
|
||||
/**
|
||||
* Returns the migration history for a single batch.
|
||||
*
|
||||
* @param int $batch
|
||||
*
|
||||
* @return array
|
||||
* @param mixed $order
|
||||
*/
|
||||
public function getBatchHistory(int $batch, $order = 'asc'): array
|
||||
{
|
||||
@ -765,8 +741,6 @@ class MigrationRunner
|
||||
|
||||
/**
|
||||
* Returns all the batches from the database history in order
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getBatches(): array
|
||||
{
|
||||
@ -784,8 +758,6 @@ class MigrationRunner
|
||||
|
||||
/**
|
||||
* Returns the value of the last batch in the database.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLastBatch(): int
|
||||
{
|
||||
@ -806,10 +778,6 @@ class MigrationRunner
|
||||
/**
|
||||
* Returns the version number of the first migration for a batch.
|
||||
* Mostly just for tests.
|
||||
*
|
||||
* @param int $batch
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatchStart(int $batch): string
|
||||
{
|
||||
@ -832,10 +800,6 @@ class MigrationRunner
|
||||
/**
|
||||
* Returns the version number of the last migration for a batch.
|
||||
* Mostly just for tests.
|
||||
*
|
||||
* @param int $batch
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatchEnd(int $batch): string
|
||||
{
|
||||
@ -918,8 +882,6 @@ class MigrationRunner
|
||||
*
|
||||
* @param string $direction "up" or "down"
|
||||
* @param object $migration The migration to run
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function migrate($direction, $migration): bool
|
||||
{
|
||||
|
@ -39,7 +39,6 @@ class ModelFactory
|
||||
/**
|
||||
* Helper method for injecting mock instances while testing.
|
||||
*
|
||||
* @param string $name
|
||||
* @param object $instance
|
||||
*/
|
||||
public static function injectMock(string $name, $instance)
|
||||
|
@ -44,8 +44,6 @@ class Builder extends BaseBuilder
|
||||
* about operator precedence.
|
||||
*
|
||||
* Note: This is only used (and overridden) by MySQL.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _fromTables(): string
|
||||
{
|
||||
|
@ -61,8 +61,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Connect to the database.
|
||||
*
|
||||
* @param bool $persistent
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return mixed
|
||||
@ -232,10 +230,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Select a specific database table to use.
|
||||
*
|
||||
* @param string $databaseName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setDatabase(string $databaseName): bool
|
||||
{
|
||||
@ -258,8 +252,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Returns a string containing the version of the database being used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string
|
||||
{
|
||||
@ -277,8 +269,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Executes the query against the database.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute(string $sql)
|
||||
@ -309,8 +299,6 @@ class Connection extends BaseConnection
|
||||
* If needed, each database adapter can prep the query string
|
||||
*
|
||||
* @param string $sql an SQL query
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function prepQuery(string $sql): string
|
||||
{
|
||||
@ -325,8 +313,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Returns the total number of rows affected by this query.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function affectedRows(): int
|
||||
{
|
||||
@ -335,10 +321,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Platform-dependant string escape
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _escapeString(string $str): string
|
||||
{
|
||||
@ -382,10 +364,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Generates the SQL for listing tables in a platform-dependent manner.
|
||||
* Uses escapeLikeStringDirect().
|
||||
*
|
||||
* @param bool $prefixLimit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _listTables(bool $prefixLimit = false): string
|
||||
{
|
||||
@ -400,10 +378,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Generates a platform-specific query string so that the column names can be fetched.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _listColumns(string $table = ''): string
|
||||
{
|
||||
@ -413,8 +387,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -447,8 +419,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
* @throws LogicException
|
||||
*
|
||||
@ -495,8 +465,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with Foreign key data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -585,8 +553,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Insert ID
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function insertID(): int
|
||||
{
|
||||
@ -595,8 +561,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Begin Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transBegin(): bool
|
||||
{
|
||||
@ -607,8 +571,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Commit Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transCommit(): bool
|
||||
{
|
||||
@ -623,8 +585,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Rollback Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transRollback(): bool
|
||||
{
|
||||
|
@ -97,8 +97,6 @@ class Forge extends BaseForge
|
||||
* CREATE TABLE attributes
|
||||
*
|
||||
* @param array $attributes Associative array of table attributes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _createTableAttributes(array $attributes): string
|
||||
{
|
||||
@ -163,10 +161,6 @@ class Forge extends BaseForge
|
||||
|
||||
/**
|
||||
* Process column
|
||||
*
|
||||
* @param array $field
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processColumn(array $field): string
|
||||
{
|
||||
@ -192,8 +186,6 @@ class Forge extends BaseForge
|
||||
* Process indexes
|
||||
*
|
||||
* @param string $table (ignored)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processIndexes(string $table): string
|
||||
{
|
||||
|
@ -26,9 +26,8 @@ class PreparedQuery extends BasePreparedQuery
|
||||
* NOTE: This version is based on SQL code. Child classes should
|
||||
* override this method.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
* Unused in the MySQLi driver.
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
* Unused in the MySQLi driver.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -49,10 +48,6 @@ class PreparedQuery extends BasePreparedQuery
|
||||
/**
|
||||
* Takes a new set of data and runs it against the currently
|
||||
* prepared query. Upon success, will return a Results object.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function _execute(array $data): bool
|
||||
{
|
||||
|
@ -22,8 +22,6 @@ class Result extends BaseResult
|
||||
{
|
||||
/**
|
||||
* Gets the number of fields in the result set.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFieldCount(): int
|
||||
{
|
||||
@ -32,8 +30,6 @@ class Result extends BaseResult
|
||||
|
||||
/**
|
||||
* Generates an array of column names in the result set.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldNames(): array
|
||||
{
|
||||
@ -49,8 +45,6 @@ class Result extends BaseResult
|
||||
|
||||
/**
|
||||
* Generates an array of objects representing field meta-data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldData(): array
|
||||
{
|
||||
@ -121,8 +115,6 @@ class Result extends BaseResult
|
||||
* internally before fetching results to make sure the result set
|
||||
* starts at zero.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function dataSeek(int $n = 0)
|
||||
@ -147,8 +139,6 @@ class Result extends BaseResult
|
||||
*
|
||||
* Overridden by child classes.
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return bool|Entity|object
|
||||
*/
|
||||
protected function fetchObject(string $className = 'stdClass')
|
||||
|
@ -36,8 +36,6 @@ class Utils extends BaseUtils
|
||||
/**
|
||||
* Platform dependent version of the backup function.
|
||||
*
|
||||
* @param array|null $prefs
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function _backup(?array $prefs = null)
|
||||
|
@ -44,8 +44,6 @@ class Builder extends BaseBuilder
|
||||
* Checks if the ignore option is supported by
|
||||
* the Database Driver for the specific statement.
|
||||
*
|
||||
* @param string $statement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function compileIgnore(string $statement)
|
||||
@ -62,7 +60,6 @@ class Builder extends BaseBuilder
|
||||
/**
|
||||
* ORDER BY
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @param string $direction ASC, DESC or RANDOM
|
||||
* @param bool $escape
|
||||
*
|
||||
@ -91,9 +88,6 @@ class Builder extends BaseBuilder
|
||||
/**
|
||||
* Increments a numeric column by the specified value.
|
||||
*
|
||||
* @param string $column
|
||||
* @param int $value
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return mixed
|
||||
@ -110,9 +104,6 @@ class Builder extends BaseBuilder
|
||||
/**
|
||||
* Decrements a numeric column by the specified value.
|
||||
*
|
||||
* @param string $column
|
||||
* @param int $value
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return mixed
|
||||
@ -186,8 +177,6 @@ class Builder extends BaseBuilder
|
||||
* @param string $table The table name
|
||||
* @param array $keys The insert keys
|
||||
* @param array $unescapedKeys The insert values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _insert(string $table, array $keys, array $unescapedKeys): string
|
||||
{
|
||||
@ -202,8 +191,6 @@ class Builder extends BaseBuilder
|
||||
* @param string $table Table name
|
||||
* @param array $keys INSERT keys
|
||||
* @param array $values INSERT values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _insertBatch(string $table, array $keys, array $values): string
|
||||
{
|
||||
@ -217,7 +204,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* @param mixed $where
|
||||
* @param int $limit
|
||||
* @param bool $resetData
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
@ -242,8 +228,6 @@ class Builder extends BaseBuilder
|
||||
* Generates a platform-specific LIMIT clause.
|
||||
*
|
||||
* @param string $sql SQL Query
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _limit(string $sql, bool $offsetIgnore = false): string
|
||||
{
|
||||
@ -255,13 +239,8 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* Generates a platform-specific update string from the supplied data
|
||||
*
|
||||
* @param string $table
|
||||
* @param array $values
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @internal param the $array update data
|
||||
* @internal param the $string table name
|
||||
*/
|
||||
@ -284,8 +263,6 @@ class Builder extends BaseBuilder
|
||||
* @param string $table Table name
|
||||
* @param array $values Update data
|
||||
* @param string $index WHERE key
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _updateBatch(string $table, array $values, string $index): string
|
||||
{
|
||||
@ -323,8 +300,6 @@ class Builder extends BaseBuilder
|
||||
* Generates a platform-specific delete string from the supplied data
|
||||
*
|
||||
* @param string $table The table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _delete(string $table): string
|
||||
{
|
||||
@ -342,8 +317,6 @@ class Builder extends BaseBuilder
|
||||
* then this method maps to 'DELETE FROM table'
|
||||
*
|
||||
* @param string $table The table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _truncate(string $table): string
|
||||
{
|
||||
@ -358,12 +331,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* @see https://www.postgresql.org/docs/9.2/static/functions-matching.html
|
||||
*
|
||||
* @param string|null $prefix
|
||||
* @param string $column
|
||||
* @param string|null $not
|
||||
* @param string $bind
|
||||
* @param bool $insensitiveSearch
|
||||
*
|
||||
* @return string $like_statement
|
||||
*/
|
||||
public function _like_statement(?string $prefix, string $column, ?string $not, string $bind, bool $insensitiveSearch = false): string
|
||||
@ -378,7 +345,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* Generates the JOIN portion of the query
|
||||
*
|
||||
* @param string $table
|
||||
* @param string $cond The join condition
|
||||
* @param string $type The type of join
|
||||
* @param bool $escape Whether not to try to escape identifiers
|
||||
|
@ -45,8 +45,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Connect to the database.
|
||||
*
|
||||
* @param bool $persistent
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function connect(bool $persistent = false)
|
||||
@ -108,10 +106,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Select a specific database table to use.
|
||||
*
|
||||
* @param string $databaseName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setDatabase(string $databaseName): bool
|
||||
{
|
||||
@ -120,8 +114,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Returns a string containing the version of the database being used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string
|
||||
{
|
||||
@ -140,8 +132,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Executes the query against the database.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute(string $sql)
|
||||
@ -160,8 +150,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Returns the total number of rows affected by this query.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function affectedRows(): int
|
||||
{
|
||||
@ -196,10 +184,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Platform-dependant string escape
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _escapeString(string $str): string
|
||||
{
|
||||
@ -212,10 +196,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Generates the SQL for listing tables in a platform-dependent manner.
|
||||
*
|
||||
* @param bool $prefixLimit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _listTables(bool $prefixLimit = false): string
|
||||
{
|
||||
@ -232,10 +212,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Generates a platform-specific query string so that the column names can be fetched.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _listColumns(string $table = ''): string
|
||||
{
|
||||
@ -249,8 +225,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -285,8 +259,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -328,8 +300,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with Foreign key data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -499,8 +469,6 @@ class Connection extends BaseConnection
|
||||
* Set client encoding
|
||||
*
|
||||
* @param string $charset The client encoding to which the data will be converted.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function setClientEncoding(string $charset): bool
|
||||
{
|
||||
@ -509,8 +477,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Begin Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transBegin(): bool
|
||||
{
|
||||
@ -519,8 +485,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Commit Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transCommit(): bool
|
||||
{
|
||||
@ -529,8 +493,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Rollback Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transRollback(): bool
|
||||
{
|
||||
@ -543,8 +505,6 @@ class Connection extends BaseConnection
|
||||
* Overrides BaseConnection::isWriteType, adding additional read query types.
|
||||
*
|
||||
* @param string $sql An SQL query string
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isWriteType($sql): bool
|
||||
{
|
||||
|
@ -62,8 +62,6 @@ class Forge extends BaseForge
|
||||
* CREATE TABLE attributes
|
||||
*
|
||||
* @param array $attributes Associative array of table attributes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _createTableAttributes(array $attributes): string
|
||||
{
|
||||
@ -125,10 +123,6 @@ class Forge extends BaseForge
|
||||
|
||||
/**
|
||||
* Process column
|
||||
*
|
||||
* @param array $field
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processColumn(array $field): string
|
||||
{
|
||||
@ -145,8 +139,6 @@ class Forge extends BaseForge
|
||||
*
|
||||
* Performs a data type mapping between different databases.
|
||||
*
|
||||
* @param array $attributes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _attributeType(array &$attributes)
|
||||
@ -179,9 +171,6 @@ class Forge extends BaseForge
|
||||
/**
|
||||
* Field attribute AUTO_INCREMENT
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $field
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _attributeAutoIncrement(array &$attributes, array &$field)
|
||||
@ -198,9 +187,6 @@ class Forge extends BaseForge
|
||||
*
|
||||
* @param string $table Table name
|
||||
* @param bool $ifExists Whether to add an IF EXISTS condition
|
||||
* @param bool $cascade
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _dropTable(string $table, bool $ifExists, bool $cascade): string
|
||||
{
|
||||
|
@ -43,9 +43,8 @@ class PreparedQuery extends BasePreparedQuery
|
||||
* NOTE: This version is based on SQL code. Child classes should
|
||||
* override this method.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
* Unused in the MySQLi driver.
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
* Unused in the MySQLi driver.
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
@ -72,10 +71,6 @@ class PreparedQuery extends BasePreparedQuery
|
||||
/**
|
||||
* Takes a new set of data and runs it against the currently
|
||||
* prepared query. Upon success, will return a Results object.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function _execute(array $data): bool
|
||||
{
|
||||
@ -101,10 +96,6 @@ class PreparedQuery extends BasePreparedQuery
|
||||
/**
|
||||
* Replaces the ? placeholders with $1, $2, etc parameters for use
|
||||
* within the prepared query.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function parameterize(string $sql): string
|
||||
{
|
||||
|
@ -22,8 +22,6 @@ class Result extends BaseResult
|
||||
{
|
||||
/**
|
||||
* Gets the number of fields in the result set.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFieldCount(): int
|
||||
{
|
||||
@ -32,8 +30,6 @@ class Result extends BaseResult
|
||||
|
||||
/**
|
||||
* Generates an array of column names in the result set.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldNames(): array
|
||||
{
|
||||
@ -48,8 +44,6 @@ class Result extends BaseResult
|
||||
|
||||
/**
|
||||
* Generates an array of objects representing field meta-data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldData(): array
|
||||
{
|
||||
@ -87,8 +81,6 @@ class Result extends BaseResult
|
||||
* internally before fetching results to make sure the result set
|
||||
* starts at zero.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function dataSeek(int $n = 0)
|
||||
@ -113,8 +105,6 @@ class Result extends BaseResult
|
||||
*
|
||||
* Overridden by child classes.
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return bool|Entity|object
|
||||
*/
|
||||
protected function fetchObject(string $className = 'stdClass')
|
||||
|
@ -36,8 +36,6 @@ class Utils extends BaseUtils
|
||||
/**
|
||||
* Platform dependent version of the backup function.
|
||||
*
|
||||
* @param array|null $prefs
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function _backup(?array $prefs = null)
|
||||
|
@ -30,8 +30,7 @@ interface PreparedQueryInterface
|
||||
* Prepares the query against the database, and saves the connection
|
||||
* info necessary to execute the query later.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
* @param array $options Passed to the connection's prepare statement.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -44,22 +43,16 @@ interface PreparedQueryInterface
|
||||
|
||||
/**
|
||||
* Returns the SQL that has been prepared.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQueryString(): string;
|
||||
|
||||
/**
|
||||
* Returns the error code created while executing this statement.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getErrorCode(): int;
|
||||
|
||||
/**
|
||||
* Returns the error message created while executing this statement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorMessage(): string;
|
||||
}
|
||||
|
@ -86,8 +86,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* BaseQuery constructor.
|
||||
*
|
||||
* @param ConnectionInterface $db
|
||||
*/
|
||||
public function __construct(ConnectionInterface &$db)
|
||||
{
|
||||
@ -97,9 +95,7 @@ class Query implements QueryInterface
|
||||
/**
|
||||
* Sets the raw query string to use for this statement.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param mixed $binds
|
||||
* @param bool $setEscape
|
||||
* @param mixed $binds
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -129,9 +125,6 @@ class Query implements QueryInterface
|
||||
/**
|
||||
* Will store the variables to bind into the query later.
|
||||
*
|
||||
* @param array $binds
|
||||
* @param bool $setEscape
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setBinds(array $binds, bool $setEscape = true)
|
||||
@ -153,8 +146,6 @@ class Query implements QueryInterface
|
||||
/**
|
||||
* Returns the final, processed query string after binding, etal
|
||||
* has been performed.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getQuery(): string
|
||||
{
|
||||
@ -172,7 +163,6 @@ class Query implements QueryInterface
|
||||
* for it's start and end values. If no end value is present, will
|
||||
* use the current time to determine total duration.
|
||||
*
|
||||
* @param float $start
|
||||
* @param float $end
|
||||
*
|
||||
* @return $this
|
||||
@ -193,9 +183,6 @@ class Query implements QueryInterface
|
||||
/**
|
||||
* Returns the start time in seconds with microseconds.
|
||||
*
|
||||
* @param bool $returnRaw
|
||||
* @param int $decimals
|
||||
*
|
||||
* @return float|string
|
||||
*/
|
||||
public function getStartTime(bool $returnRaw = false, int $decimals = 6)
|
||||
@ -212,8 +199,6 @@ class Query implements QueryInterface
|
||||
* the query has not been executed yet.
|
||||
*
|
||||
* @param int $decimals The accuracy of the returned time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDuration(int $decimals = 6): string
|
||||
{
|
||||
@ -223,9 +208,6 @@ class Query implements QueryInterface
|
||||
/**
|
||||
* Stores the error description that happened for this query.
|
||||
*
|
||||
* @param int $code
|
||||
* @param string $error
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setError(int $code, string $error)
|
||||
@ -238,8 +220,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Reports whether this statement created an error not.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasError(): bool
|
||||
{
|
||||
@ -248,8 +228,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Returns the error code created while executing this statement.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getErrorCode(): int
|
||||
{
|
||||
@ -258,8 +236,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Returns the error message created while executing this statement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorMessage(): string
|
||||
{
|
||||
@ -268,8 +244,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Determines if the statement is a write-type query or not.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isWriteType(): bool
|
||||
{
|
||||
@ -279,9 +253,6 @@ class Query implements QueryInterface
|
||||
/**
|
||||
* Swaps out one table prefix for a new one.
|
||||
*
|
||||
* @param string $orig
|
||||
* @param string $swap
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function swapPrefix(string $orig, string $swap)
|
||||
@ -295,8 +266,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Returns the original SQL that was passed into the system.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOriginalQuery(): string
|
||||
{
|
||||
@ -347,11 +316,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Match bindings
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $binds
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function matchNamedBinds(string $sql, array $binds): string
|
||||
{
|
||||
@ -376,13 +340,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Match bindings
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $binds
|
||||
* @param int $bindCount
|
||||
* @param int $ml
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function matchSimpleBinds(string $sql, array $binds, int $bindCount, int $ml): string
|
||||
{
|
||||
@ -414,8 +371,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Returns string to display in debug toolbar
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function debugToolbarDisplay(): string
|
||||
{
|
||||
@ -469,8 +424,6 @@ class Query implements QueryInterface
|
||||
|
||||
/**
|
||||
* Return text representation of the query
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString(): string
|
||||
{
|
||||
|
@ -22,9 +22,7 @@ interface QueryInterface
|
||||
/**
|
||||
* Sets the raw query string to use for this statement.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param mixed $binds
|
||||
* @param bool $setEscape
|
||||
* @param mixed $binds
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@ -43,7 +41,6 @@ interface QueryInterface
|
||||
* for it's start and end values. If no end value is present, will
|
||||
* use the current time to determine total duration.
|
||||
*
|
||||
* @param float $start
|
||||
* @param float $end
|
||||
*
|
||||
* @return mixed
|
||||
@ -55,53 +52,37 @@ interface QueryInterface
|
||||
* the query has not been executed yet.
|
||||
*
|
||||
* @param int $decimals The accuracy of the returned time.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getDuration(int $decimals = 6): string;
|
||||
|
||||
/**
|
||||
* Stores the error description that happened for this query.
|
||||
*
|
||||
* @param int $code
|
||||
* @param string $error
|
||||
*/
|
||||
public function setError(int $code, string $error);
|
||||
|
||||
/**
|
||||
* Reports whether this statement created an error not.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function hasError(): bool;
|
||||
|
||||
/**
|
||||
* Returns the error code created while executing this statement.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getErrorCode(): int;
|
||||
|
||||
/**
|
||||
* Returns the error message created while executing this statement.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getErrorMessage(): string;
|
||||
|
||||
/**
|
||||
* Determines if the statement is a write-type query or not.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isWriteType(): bool;
|
||||
|
||||
/**
|
||||
* Swaps out one table prefix for a new one.
|
||||
*
|
||||
* @param string $orig
|
||||
* @param string $swap
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function swapPrefix(string $orig, string $swap);
|
||||
|
@ -22,8 +22,6 @@ interface ResultInterface
|
||||
* 'object', or a custom class name.
|
||||
*
|
||||
* @param string $type The row type. Either 'array', 'object', or a class name to use
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getResult(string $type = 'object'): array;
|
||||
|
||||
@ -40,8 +38,6 @@ interface ResultInterface
|
||||
* Returns the results as an array of arrays.
|
||||
*
|
||||
* If no results, an empty array is returned.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getResultArray(): array;
|
||||
|
||||
@ -49,8 +45,6 @@ interface ResultInterface
|
||||
* Returns the results as an array of objects.
|
||||
*
|
||||
* If no results, an empty array is returned.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getResultObject(): array;
|
||||
|
||||
@ -72,9 +66,6 @@ interface ResultInterface
|
||||
*
|
||||
* If row doesn't exists, returns null.
|
||||
*
|
||||
* @param int $n
|
||||
* @param string $className
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCustomRowObject(int $n, string $className);
|
||||
@ -84,8 +75,6 @@ interface ResultInterface
|
||||
*
|
||||
* If row doesn't exist, returns null.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRowArray(int $n = 0);
|
||||
@ -95,8 +84,6 @@ interface ResultInterface
|
||||
*
|
||||
* If row doesn't exist, returns null.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRowObject(int $n = 0);
|
||||
@ -114,8 +101,6 @@ interface ResultInterface
|
||||
/**
|
||||
* Returns the "first" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getFirstRow(string $type = 'object');
|
||||
@ -123,8 +108,6 @@ interface ResultInterface
|
||||
/**
|
||||
* Returns the "last" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getLastRow(string $type = 'object');
|
||||
@ -132,8 +115,6 @@ interface ResultInterface
|
||||
/**
|
||||
* Returns the "next" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getNextRow(string $type = 'object');
|
||||
@ -141,8 +122,6 @@ interface ResultInterface
|
||||
/**
|
||||
* Returns the "previous" row of the current results.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPreviousRow(string $type = 'object');
|
||||
@ -150,30 +129,22 @@ interface ResultInterface
|
||||
/**
|
||||
* Returns an unbuffered row and move the pointer to the next row.
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUnbufferedRow(string $type = 'object');
|
||||
|
||||
/**
|
||||
* Gets the number of fields in the result set.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFieldCount(): int;
|
||||
|
||||
/**
|
||||
* Generates an array of column names in the result set.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldNames(): array;
|
||||
|
||||
/**
|
||||
* Generates an array of objects representing field meta-data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldData(): array;
|
||||
|
||||
@ -189,8 +160,6 @@ interface ResultInterface
|
||||
* internally before fetching results to make sure the result set
|
||||
* starts at zero.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function dataSeek(int $n = 0);
|
||||
|
@ -65,8 +65,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* Groups tables in FROM clauses if needed, so there is no confusion
|
||||
* about operator precedence.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _fromTables(): string
|
||||
{
|
||||
@ -88,8 +86,6 @@ class Builder extends BaseBuilder
|
||||
* then this method maps to 'DELETE FROM table'
|
||||
*
|
||||
* @param string $table The table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _truncate(string $table): string
|
||||
{
|
||||
@ -101,7 +97,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* Generates the JOIN portion of the query
|
||||
*
|
||||
* @param string $table
|
||||
* @param string $cond The join condition
|
||||
* @param string $type The type of join
|
||||
* @param bool $escape Whether not to try to escape identifiers
|
||||
@ -184,8 +179,6 @@ class Builder extends BaseBuilder
|
||||
* @param string $table The table name
|
||||
* @param array $keys The insert keys
|
||||
* @param array $unescapedKeys The insert values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _insert(string $table, array $keys, array $unescapedKeys): string
|
||||
{
|
||||
@ -204,8 +197,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* @param string $table the Table name
|
||||
* @param array $values the Update data
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _update(string $table, array $values): string
|
||||
{
|
||||
@ -226,9 +217,6 @@ class Builder extends BaseBuilder
|
||||
/**
|
||||
* Increments a numeric column by the specified value.
|
||||
*
|
||||
* @param string $column
|
||||
* @param int $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function increment(string $column, int $value = 1)
|
||||
@ -248,9 +236,6 @@ class Builder extends BaseBuilder
|
||||
/**
|
||||
* Decrements a numeric column by the specified value.
|
||||
*
|
||||
* @param string $column
|
||||
* @param int $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function decrement(string $column, int $value = 1)
|
||||
@ -269,10 +254,6 @@ class Builder extends BaseBuilder
|
||||
|
||||
/**
|
||||
* Get full name of the table
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function getFullName(string $table): string
|
||||
{
|
||||
@ -296,8 +277,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* @param string $fullTable full table name
|
||||
* @param string $insert statement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function addIdentity(string $fullTable, string $insert): string
|
||||
{
|
||||
@ -306,11 +285,6 @@ class Builder extends BaseBuilder
|
||||
|
||||
/**
|
||||
* Local implementation of limit
|
||||
*
|
||||
* @param string $sql
|
||||
* @param bool $offsetIgnore
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _limit(string $sql, bool $offsetIgnore = false): string
|
||||
{
|
||||
@ -379,8 +353,6 @@ class Builder extends BaseBuilder
|
||||
* @param string $table The table name
|
||||
* @param array $keys The insert keys
|
||||
* @param array $values The insert values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _replace(string $table, array $keys, array $values): string
|
||||
{
|
||||
@ -449,8 +421,6 @@ class Builder extends BaseBuilder
|
||||
* Handle float return value
|
||||
*
|
||||
* @param string $select Field name
|
||||
* @param string $alias
|
||||
* @param string $type
|
||||
*
|
||||
* @return BaseBuilder
|
||||
*/
|
||||
@ -485,8 +455,6 @@ class Builder extends BaseBuilder
|
||||
* Delete statement
|
||||
*
|
||||
* @param string $table The table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _delete(string $table): string
|
||||
{
|
||||
@ -498,9 +466,8 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* Compiles a delete string and runs the query
|
||||
*
|
||||
* @param mixed $where The where clause
|
||||
* @param int $limit The limit clause
|
||||
* @param bool $resetData
|
||||
* @param mixed $where The where clause
|
||||
* @param int $limit The limit clause
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
@ -541,8 +508,6 @@ class Builder extends BaseBuilder
|
||||
* Generates a query string based on which functions were used.
|
||||
*
|
||||
* @param mixed $selectOverride
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function compileSelect($selectOverride = false): string
|
||||
{
|
||||
@ -602,7 +567,6 @@ class Builder extends BaseBuilder
|
||||
* @param string $qbKey 'QBWhere' or 'QBHaving'
|
||||
* @param mixed $key
|
||||
* @param mixed $value
|
||||
* @param string $type
|
||||
* @param bool $escape
|
||||
*
|
||||
* @return $this
|
||||
|
@ -100,8 +100,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Connect to the database.
|
||||
*
|
||||
* @param bool $persistent
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return mixed
|
||||
@ -173,10 +171,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Platform-dependant string escape
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _escapeString(string $str): string
|
||||
{
|
||||
@ -185,8 +179,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Insert ID
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function insertID(): int
|
||||
{
|
||||
@ -195,10 +187,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Generates the SQL for listing tables in a platform-dependent manner.
|
||||
*
|
||||
* @param bool $prefixLimit
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _listTables(bool $prefixLimit = false): string
|
||||
{
|
||||
@ -217,10 +205,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Generates a platform-specific query string so that the column names can be fetched.
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _listColumns(string $table = ''): string
|
||||
{
|
||||
@ -233,8 +217,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -275,8 +257,6 @@ class Connection extends BaseConnection
|
||||
* Returns an array of objects with Foreign key data
|
||||
* referenced_object_id parent_object_id
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -345,8 +325,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*
|
||||
* @return stdClass[]
|
||||
@ -381,8 +359,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Begin Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transBegin(): bool
|
||||
{
|
||||
@ -391,8 +367,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Commit Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transCommit(): bool
|
||||
{
|
||||
@ -401,8 +375,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Rollback Transaction
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function _transRollback(): bool
|
||||
{
|
||||
@ -445,8 +417,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Returns the total number of rows affected by this query.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function affectedRows(): int
|
||||
{
|
||||
@ -456,8 +426,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Select a specific database table to use.
|
||||
*
|
||||
* @param string|null $databaseName
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function setDatabase(?string $databaseName = null)
|
||||
@ -483,8 +451,6 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Executes the query against the database.
|
||||
*
|
||||
* @param string $sql
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function execute(string $sql)
|
||||
@ -539,8 +505,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* The name of the platform in use (MySQLi, mssql, etc)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPlatform(): string
|
||||
{
|
||||
@ -549,8 +513,6 @@ class Connection extends BaseConnection
|
||||
|
||||
/**
|
||||
* Returns a string containing the version of the database being used.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion(): string
|
||||
{
|
||||
@ -571,8 +533,6 @@ class Connection extends BaseConnection
|
||||
* Overrides BaseConnection::isWriteType, adding additional read query types.
|
||||
*
|
||||
* @param string $sql An SQL query string
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isWriteType($sql): bool
|
||||
{
|
||||
|
@ -100,8 +100,6 @@ class Forge extends BaseForge
|
||||
* CREATE TABLE attributes
|
||||
*
|
||||
* @param array $attributes Associative array of table attributes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _createTableAttributes(array $attributes): string
|
||||
{
|
||||
@ -194,9 +192,6 @@ class Forge extends BaseForge
|
||||
/**
|
||||
* Drop index for table
|
||||
*
|
||||
* @param string $table
|
||||
* @param object $indexData
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _dropIndex(string $table, object $indexData)
|
||||
@ -212,10 +207,6 @@ class Forge extends BaseForge
|
||||
|
||||
/**
|
||||
* Process column
|
||||
*
|
||||
* @param array $field
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processColumn(array $field): string
|
||||
{
|
||||
@ -233,8 +224,6 @@ class Forge extends BaseForge
|
||||
* Process foreign keys
|
||||
*
|
||||
* @param string $table Table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processForeignKeys(string $table): string
|
||||
{
|
||||
@ -273,8 +262,6 @@ class Forge extends BaseForge
|
||||
* Process primary keys
|
||||
*
|
||||
* @param string $table Table name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _processPrimaryKeys(string $table): string
|
||||
{
|
||||
@ -297,8 +284,6 @@ class Forge extends BaseForge
|
||||
*
|
||||
* Performs a data type mapping between different databases.
|
||||
*
|
||||
* @param array $attributes
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _attributeType(array &$attributes)
|
||||
@ -339,9 +324,6 @@ class Forge extends BaseForge
|
||||
/**
|
||||
* Field attribute AUTO_INCREMENT
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $field
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function _attributeAutoIncrement(array &$attributes, array &$field)
|
||||
@ -360,9 +342,6 @@ class Forge extends BaseForge
|
||||
*
|
||||
* @param string $table Table name
|
||||
* @param bool $ifExists Whether to add an IF EXISTS condition
|
||||
* @param bool $cascade
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _dropTable(string $table, bool $ifExists, bool $cascade): string
|
||||
{
|
||||
|
@ -41,8 +41,7 @@ class PreparedQuery extends BasePreparedQuery
|
||||
* NOTE: This version is based on SQL code. Child classes should
|
||||
* override this method.
|
||||
*
|
||||
* @param string $sql
|
||||
* @param array $options Options takes an associative array;
|
||||
* @param array $options Options takes an associative array;
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
@ -70,10 +69,6 @@ class PreparedQuery extends BasePreparedQuery
|
||||
/**
|
||||
* Takes a new set of data and runs it against the currently
|
||||
* prepared query. Upon success, will return a Results object.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function _execute(array $data): bool
|
||||
{
|
||||
@ -102,10 +97,6 @@ class PreparedQuery extends BasePreparedQuery
|
||||
|
||||
/**
|
||||
* Handle parameters
|
||||
*
|
||||
* @param string $queryString
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function parameterize(string $queryString): array
|
||||
{
|
||||
|
@ -22,8 +22,6 @@ class Result extends BaseResult
|
||||
{
|
||||
/**
|
||||
* Gets the number of fields in the result set.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getFieldCount(): int
|
||||
{
|
||||
@ -32,8 +30,6 @@ class Result extends BaseResult
|
||||
|
||||
/**
|
||||
* Generates an array of column names in the result set.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldNames(): array
|
||||
{
|
||||
@ -48,8 +44,6 @@ class Result extends BaseResult
|
||||
|
||||
/**
|
||||
* Generates an array of objects representing field meta-data.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldData(): array
|
||||
{
|
||||
@ -123,8 +117,6 @@ class Result extends BaseResult
|
||||
* internally before fetching results to make sure the result set
|
||||
* starts at zero.
|
||||
*
|
||||
* @param int $n
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function dataSeek(int $n = 0)
|
||||
@ -157,8 +149,6 @@ class Result extends BaseResult
|
||||
*
|
||||
* Overridden by child classes.
|
||||
*
|
||||
* @param string $className
|
||||
*
|
||||
* @return bool|Entity|object
|
||||
*/
|
||||
protected function fetchObject(string $className = 'stdClass')
|
||||
|
@ -36,8 +36,6 @@ class Utils extends BaseUtils
|
||||
/**
|
||||
* Platform dependent version of the backup function.
|
||||
*
|
||||
* @param array|null $prefs
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function _backup(?array $prefs = null)
|
||||
|
@ -58,8 +58,6 @@ class Builder extends BaseBuilder
|
||||
* @param string $table the table name
|
||||
* @param array $keys the insert keys
|
||||
* @param array $values the insert values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _replace(string $table, array $keys, array $values): string
|
||||
{
|
||||
@ -73,10 +71,6 @@ class Builder extends BaseBuilder
|
||||
*
|
||||
* If the database does not support the TRUNCATE statement,
|
||||
* then this method maps to 'DELETE FROM table'
|
||||
*
|
||||
* @param string $table
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function _truncate(string $table): string
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user