Skip to content

Commit

Permalink
array long => short
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Jan 24, 2024
1 parent 8750d09 commit 3f537c2
Show file tree
Hide file tree
Showing 706 changed files with 4,681 additions and 4,681 deletions.
10 changes: 5 additions & 5 deletions lib/Doctrine/Adapter/Mock.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class Doctrine_Adapter_Mock implements Doctrine_Adapter_Interface, Countable
*
* @var array
*/
private $_queries = array();
private $_queries = [];

/**
* Array of exceptions thrown.
*
* @var array
*/
private $_exception = array();
private $_exception = [];

/**
* Bool true/false variable for whether or not the last insert failed.
Expand Down Expand Up @@ -99,7 +99,7 @@ public function pop()
*/
public function forceException($name, $message = '', $code = 0): void
{
$this->_exception = array($name, $message, $code);
$this->_exception = [$name, $message, $code];
}

/**
Expand Down Expand Up @@ -141,7 +141,7 @@ public function query($query)
if (!empty($e)) {
$name = $e[0];

$this->_exception = array();
$this->_exception = [];

throw new $name($e[1], $e[2]);
}
Expand Down Expand Up @@ -187,7 +187,7 @@ public function exec($statement)
if (!empty($e)) {
$name = $e[0];

$this->_exception = array();
$this->_exception = [];

throw new $name($e[1], $e[2]);
}
Expand Down
10 changes: 5 additions & 5 deletions lib/Doctrine/Adapter/Oracle.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class Doctrine_Adapter_Oracle implements Doctrine_Adapter_Interface
*/
protected $connection = false;

protected $attributes = array(Doctrine_Core::ATTR_DRIVER_NAME => 'oci8',
Doctrine_Core::ATTR_ERRMODE => Doctrine_Core::ERRMODE_SILENT);
protected $attributes = [Doctrine_Core::ATTR_DRIVER_NAME => 'oci8',
Doctrine_Core::ATTR_ERRMODE => Doctrine_Core::ERRMODE_SILENT];

/**
* User-provided configuration.
Expand All @@ -55,13 +55,13 @@ class Doctrine_Adapter_Oracle implements Doctrine_Adapter_Interface
*
* @var array
*/
protected $config = array(
protected $config = [
'dbname' => null,
'username' => null,
'password' => null,
'charset' => null,
'persistent' => false,
);
];

/**
* Doctrine Oracle adapter constructor.
Expand All @@ -79,7 +79,7 @@ class Doctrine_Adapter_Oracle implements Doctrine_Adapter_Interface
* @param mixed|null $username
* @param mixed|null $password
*/
public function __construct($config = array(), $username = null, $password = null)
public function __construct($config = [], $username = null, $password = null)
{
if (is_string($config)) {
$config = str_replace('oracle:', '', $config);
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Adapter/Statement/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function bindValue($param, $value, $type = null);
* from a stored procedure, you must explicitly set the length.
* @return bool returns TRUE on success or FALSE on failure
*/
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array());
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = []);

/**
* Closes the cursor, enabling the statement to be executed again.
Expand Down Expand Up @@ -185,7 +185,7 @@ public function fetchColumn($columnIndex = 0);
* @return mixed an instance of the required class with property names that correspond
* to the column names or FALSE in case of an error
*/
public function fetchObject($className = 'stdClass', $args = array());
public function fetchObject($className = 'stdClass', $args = []);

/**
* Retrieve a statement attribute.
Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/Adapter/Statement/Mock.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function bindValue($param, $value, $type = null)
* from a stored procedure, you must explicitly set the length.
* @return bool returns TRUE on success or FALSE on failure
*/
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array())
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = [])
{
}

Expand Down Expand Up @@ -147,7 +147,7 @@ public function columnCount()
*/
public function errorCode()
{
return array();
return [];
}

/**
Expand All @@ -161,7 +161,7 @@ public function errorCode()
*/
public function errorInfo()
{
return array();
return [];
}

/**
Expand Down Expand Up @@ -193,7 +193,7 @@ public function fetch(
$cursorOrientation = Doctrine_Core::FETCH_ORI_NEXT,
$cursorOffset = null
) {
return array();
return [];
}

/**
Expand All @@ -205,7 +205,7 @@ public function fetch(
*/
public function fetchAll($fetchMode = Doctrine_Core::FETCH_BOTH)
{
return array();
return [];
}

/**
Expand Down Expand Up @@ -261,7 +261,7 @@ public function fetchColumn($columnIndex = 0)
* @return mixed an instance of the required class with property names that correspond
* to the column names or FALSE in case of an error
*/
public function fetchObject($className = 'stdClass', $args = array())
public function fetchObject($className = 'stdClass', $args = [])
{
return new $className();
}
Expand Down
20 changes: 10 additions & 10 deletions lib/Doctrine/Adapter/Statement/Oracle.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ class Doctrine_Adapter_Statement_Oracle implements Doctrine_Adapter_Statement_In
/**
* @var array Array of parameters bounded to a statement
*/
protected $bindParams = array();
protected $bindParams = [];

/**
* @var array Array of attributes
*/
protected $attributes = array();
protected $attributes = [];

/**
* @var array Array of errors
*/
protected $ociErrors = array();
protected $ociErrors = [];

/**
* the constructor.
Expand Down Expand Up @@ -135,7 +135,7 @@ public function bindValue($param, $value, $type = null)
* from a stored procedure, you must explicitly set the length.
* @return bool returns TRUE on success or FALSE on failure
*/
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = array())
public function bindParam($column, &$variable, $type = null, $length = null, $driverOptions = [])
{
if ($driverOptions || $length) {
throw new Doctrine_Adapter_Exception('Unsupported parameters:$length, $driverOptions');
Expand Down Expand Up @@ -173,7 +173,7 @@ public function bindParam($column, &$variable, $type = null, $length = null, $dr
*/
public function closeCursor()
{
$this->bindParams = array();
$this->bindParams = [];
if (is_resource($this->statement)) {
return oci_free_statement($this->statement);
}
Expand Down Expand Up @@ -347,7 +347,7 @@ public function fetchAll($fetchStyle = Doctrine_Core::FETCH_BOTH, $colnum = 0)
$fetchColumn = false;
$skip = 0;
$maxrows = -1;
$data = array();
$data = [];
$flags = OCI_FETCHSTATEMENT_BY_ROW + OCI_ASSOC;

$int = $fetchStyle & Doctrine_Core::FETCH_COLUMN;
Expand Down Expand Up @@ -382,7 +382,7 @@ public function fetchAll($fetchStyle = Doctrine_Core::FETCH_BOTH, $colnum = 0)
public function fetchColumn($columnIndex = 0)
{
if (!is_int($columnIndex)) {
$this->handleError(array('message' => 'columnIndex parameter should be numeric'));
$this->handleError(['message' => 'columnIndex parameter should be numeric']);

return false;
}
Expand All @@ -402,7 +402,7 @@ public function fetchColumn($columnIndex = 0)
* @return mixed an instance of the required class with property names that correspond
* to the column names or FALSE in case of an error
*/
public function fetchObject($className = 'stdClass', $args = array())
public function fetchObject($className = 'stdClass', $args = [])
{
$row = $this->fetch(Doctrine_Core::FETCH_ASSOC);
if (false === $row) {
Expand Down Expand Up @@ -458,7 +458,7 @@ public function getColumnMeta($column)
$internal_column = $column;
}

$data = array();
$data = [];
$data['native_type'] = oci_field_type($this->statement, $internal_column);
$data['flags'] = '';
$data['len'] = oci_field_size($this->statement, $internal_column);
Expand Down Expand Up @@ -544,7 +544,7 @@ public function setFetchMode($mode, $arg1 = null, $arg2 = null)
throw new Doctrine_Adapter_Exception('Unsupported');
}

private function handleError($params = array()): void
private function handleError($params = []): void
{
switch ($this->attributes[Doctrine_Core::ATTR_ERRMODE]) {
case Doctrine_Core::ERRMODE_EXCEPTION:
Expand Down
16 changes: 8 additions & 8 deletions lib/Doctrine/AuditLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ class Doctrine_AuditLog extends Doctrine_Record_Generator
*
* @var array
*/
protected $_options = array('className' => '%CLASS%Version',
'version' => array('name' => 'version',
protected $_options = ['className' => '%CLASS%Version',
'version' => ['name' => 'version',
'alias' => null,
'type' => 'integer',
'length' => 8,
'options' => array('primary' => true)),
'options' => ['primary' => true]],
'tableName' => false,
'generateFiles' => false,
'table' => false,
'pluginTable' => false,
'children' => array(),
'children' => [],
'auditLog' => true,
'deleteVersions' => true,
'cascadeDelete' => true,
'excludeFields' => array(),
'appLevelDelete' => false);
'excludeFields' => [],
'appLevelDelete' => false];

/**
* Accepts array of options to configure the AuditLog.
*
* @param array $options An array of options
*/
public function __construct(array $options = array())
public function __construct(array $options = [])
{
$this->_options = Doctrine_Lib::arrayDeepMerge($this->_options, $options);
}
Expand Down Expand Up @@ -119,7 +119,7 @@ public function getVersion(Doctrine_Record $record, $version, $hydrationMode = D
->createQuery()
;

$values = array();
$values = [];
foreach ((array) $this->_options['table']->getIdentifier() as $id) {
$conditions[] = $className.'.'.$id.' = ?';
$values[] = $record->get($id);
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/Cache/Apc.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Doctrine_Cache_Apc extends Doctrine_Cache_Driver
*
* @param array $options associative array of cache driver options
*/
public function __construct($options = array())
public function __construct($options = [])
{
if (!extension_loaded('apc')) {
throw new Doctrine_Cache_Exception('The apc extension must be loaded for using this backend !');
Expand Down Expand Up @@ -102,7 +102,7 @@ protected function _doDelete($id)
protected function _getCacheKeys()
{
$ci = apc_cache_info('user');
$keys = array();
$keys = [];

foreach ($ci['cache_list'] as $entry) {
$keys[] = $entry['info'];
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/Cache/Array.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Doctrine_Cache_Array extends Doctrine_Cache_Driver
/**
* @var array an array of cached data
*/
protected $data = array();
protected $data = [];

/**
* Fetch a cache record from this cache driver instance.
Expand Down
Loading

0 comments on commit 3f537c2

Please sign in to comment.