Skip to content

Commit 29c66ca

Browse files
committed
Trying rector refactor with 8.0 php set.
1 parent 789a752 commit 29c66ca

File tree

574 files changed

+41727
-41946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

574 files changed

+41727
-41946
lines changed

app/Config/Schema/db_acl.php

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class DbAclSchema extends CakeSchema {
3030
* @param array $event The event data.
3131
* @return bool Success
3232
*/
33-
public function before($event = array()) {
33+
public function before($event = []) {
3434
return true;
3535
}
3636

@@ -40,62 +40,62 @@ public function before($event = array()) {
4040
* @param array $event The event data.
4141
* @return void
4242
*/
43-
public function after($event = array()) {
43+
public function after($event = []) {
4444
}
4545

4646
/**
4747
* ACO - Access Control Object - Something that is wanted
4848
*/
49-
public $acos = array(
50-
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
51-
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
52-
'model' => array('type' => 'string', 'null' => true),
53-
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
54-
'alias' => array('type' => 'string', 'null' => true),
55-
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
56-
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
57-
'indexes' => array(
58-
'PRIMARY' => array('column' => 'id', 'unique' => 1),
59-
'idx_acos_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
60-
'idx_acos_alias' => array('column' => 'alias', 'unique' => 0)
61-
)
62-
);
49+
public $acos = [
50+
'id' => ['type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'],
51+
'parent_id' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
52+
'model' => ['type' => 'string', 'null' => true],
53+
'foreign_key' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
54+
'alias' => ['type' => 'string', 'null' => true],
55+
'lft' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
56+
'rght' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
57+
'indexes' => [
58+
'PRIMARY' => ['column' => 'id', 'unique' => 1],
59+
'idx_acos_lft_rght' => ['column' => ['lft', 'rght'], 'unique' => 0],
60+
'idx_acos_alias' => ['column' => 'alias', 'unique' => 0]
61+
]
62+
];
6363

6464
/**
6565
* ARO - Access Request Object - Something that wants something
6666
*/
67-
public $aros = array(
68-
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
69-
'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
70-
'model' => array('type' => 'string', 'null' => true),
71-
'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
72-
'alias' => array('type' => 'string', 'null' => true),
73-
'lft' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
74-
'rght' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
75-
'indexes' => array(
76-
'PRIMARY' => array('column' => 'id', 'unique' => 1),
77-
'idx_aros_lft_rght' => array('column' => array('lft', 'rght'), 'unique' => 0),
78-
'idx_aros_alias' => array('column' => 'alias', 'unique' => 0)
79-
)
80-
);
67+
public $aros = [
68+
'id' => ['type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'],
69+
'parent_id' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
70+
'model' => ['type' => 'string', 'null' => true],
71+
'foreign_key' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
72+
'alias' => ['type' => 'string', 'null' => true],
73+
'lft' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
74+
'rght' => ['type' => 'integer', 'null' => true, 'default' => null, 'length' => 10],
75+
'indexes' => [
76+
'PRIMARY' => ['column' => 'id', 'unique' => 1],
77+
'idx_aros_lft_rght' => ['column' => ['lft', 'rght'], 'unique' => 0],
78+
'idx_aros_alias' => ['column' => 'alias', 'unique' => 0]
79+
]
80+
];
8181

8282
/**
8383
* Used by the Cake::Model:Permission class.
8484
* Checks if the given $aro has access to action $action in $aco.
8585
*/
86-
public $aros_acos = array(
87-
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
88-
'aro_id' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
89-
'aco_id' => array('type' => 'integer', 'null' => false, 'length' => 10),
90-
'_create' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
91-
'_read' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
92-
'_update' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
93-
'_delete' => array('type' => 'string', 'null' => false, 'default' => '0', 'length' => 2),
94-
'indexes' => array(
95-
'PRIMARY' => array('column' => 'id', 'unique' => 1),
96-
'ARO_ACO_KEY' => array('column' => array('aro_id', 'aco_id'), 'unique' => 1),
97-
'idx_aco_id' => array('column' => 'aco_id', 'unique' => 0)
98-
)
99-
);
86+
public $aros_acos = [
87+
'id' => ['type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'],
88+
'aro_id' => ['type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'],
89+
'aco_id' => ['type' => 'integer', 'null' => false, 'length' => 10],
90+
'_create' => ['type' => 'string', 'null' => false, 'default' => '0', 'length' => 2],
91+
'_read' => ['type' => 'string', 'null' => false, 'default' => '0', 'length' => 2],
92+
'_update' => ['type' => 'string', 'null' => false, 'default' => '0', 'length' => 2],
93+
'_delete' => ['type' => 'string', 'null' => false, 'default' => '0', 'length' => 2],
94+
'indexes' => [
95+
'PRIMARY' => ['column' => 'id', 'unique' => 1],
96+
'ARO_ACO_KEY' => ['column' => ['aro_id', 'aco_id'], 'unique' => 1],
97+
'idx_aco_id' => ['column' => 'aco_id', 'unique' => 0]
98+
]
99+
];
100100

101101
}

app/Config/Schema/i18n.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class I18nSchema extends CakeSchema {
4040
* @param array $event Schema object properties
4141
* @return bool Should process continue
4242
*/
43-
public function before($event = array()) {
43+
public function before($event = []) {
4444
return true;
4545
}
4646

@@ -50,22 +50,22 @@ public function before($event = array()) {
5050
* @param array $event Schema object properties
5151
* @return void
5252
*/
53-
public function after($event = array()) {
53+
public function after($event = []) {
5454
}
5555

5656
/**
5757
* The i18n table definition
5858
*
5959
* @var array
6060
*/
61-
public $i18n = array(
62-
'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
63-
'locale' => array('type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'),
64-
'model' => array('type' => 'string', 'null' => false, 'key' => 'index'),
65-
'foreign_key' => array('type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'),
66-
'field' => array('type' => 'string', 'null' => false, 'key' => 'index'),
67-
'content' => array('type' => 'text', 'null' => true, 'default' => null),
68-
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'locale' => array('column' => 'locale', 'unique' => 0), 'model' => array('column' => 'model', 'unique' => 0), 'row_id' => array('column' => 'foreign_key', 'unique' => 0), 'field' => array('column' => 'field', 'unique' => 0))
69-
);
61+
public $i18n = [
62+
'id' => ['type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'],
63+
'locale' => ['type' => 'string', 'null' => false, 'length' => 6, 'key' => 'index'],
64+
'model' => ['type' => 'string', 'null' => false, 'key' => 'index'],
65+
'foreign_key' => ['type' => 'integer', 'null' => false, 'length' => 10, 'key' => 'index'],
66+
'field' => ['type' => 'string', 'null' => false, 'key' => 'index'],
67+
'content' => ['type' => 'text', 'null' => true, 'default' => null],
68+
'indexes' => ['PRIMARY' => ['column' => 'id', 'unique' => 1], 'locale' => ['column' => 'locale', 'unique' => 0], 'model' => ['column' => 'model', 'unique' => 0], 'row_id' => ['column' => 'foreign_key', 'unique' => 0], 'field' => ['column' => 'field', 'unique' => 0]]
69+
];
7070

7171
}

app/Config/Schema/sessions.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class SessionsSchema extends CakeSchema {
3737
* @param array $event Schema object properties
3838
* @return bool Should process continue
3939
*/
40-
public function before($event = array()) {
40+
public function before($event = []) {
4141
return true;
4242
}
4343

@@ -47,19 +47,19 @@ public function before($event = array()) {
4747
* @param array $event Schema object properties
4848
* @return void
4949
*/
50-
public function after($event = array()) {
50+
public function after($event = []) {
5151
}
5252

5353
/**
5454
* The cake_sessions table definition
5555
*
5656
* @var array
5757
*/
58-
public $cake_sessions = array(
59-
'id' => array('type' => 'string', 'null' => false, 'key' => 'primary'),
60-
'data' => array('type' => 'text', 'null' => true, 'default' => null),
61-
'expires' => array('type' => 'integer', 'null' => true, 'default' => null),
62-
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1))
63-
);
58+
public $cake_sessions = [
59+
'id' => ['type' => 'string', 'null' => false, 'key' => 'primary'],
60+
'data' => ['type' => 'text', 'null' => true, 'default' => null],
61+
'expires' => ['type' => 'integer', 'null' => true, 'default' => null],
62+
'indexes' => ['PRIMARY' => ['column' => 'id', 'unique' => 1]]
63+
];
6464

6565
}

app/Config/acl.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,32 +114,32 @@
114114
* The role map defines how to resolve the user record from your application
115115
* to the roles you defined in the roles configuration.
116116
*/
117-
$config['map'] = array(
117+
$config['map'] = [
118118
'User' => 'User/username',
119119
'Role' => 'User/group_id',
120-
);
120+
];
121121

122122
/**
123123
* define aliases to map your model information to
124124
* the roles defined in your role configuration.
125125
*/
126-
$config['alias'] = array(
126+
$config['alias'] = [
127127
'Role/4' => 'Role/editor',
128-
);
128+
];
129129

130130
/**
131131
* role configuration
132132
*/
133-
$config['roles'] = array(
133+
$config['roles'] = [
134134
'Role/admin' => null,
135-
);
135+
];
136136

137137
/**
138138
* rule configuration
139139
*/
140-
$config['rules'] = array(
141-
'allow' => array(
140+
$config['rules'] = [
141+
'allow' => [
142142
'*' => 'Role/admin',
143-
),
144-
'deny' => array(),
145-
);
143+
],
144+
'deny' => [],
145+
];

app/Config/bootstrap.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424

2525
// Setup a 'default' cache configuration for use in the application.
26-
Cache::config('default', array('engine' => 'File'));
26+
Cache::config('default', ['engine' => 'File']);
2727

2828
/**
2929
* The settings below can be used to set additional paths to models, views and controllers.
@@ -90,22 +90,22 @@
9090
*
9191
* ));
9292
*/
93-
Configure::write('Dispatcher.filters', array(
93+
Configure::write('Dispatcher.filters', [
9494
'AssetDispatcher',
9595
'CacheDispatcher'
96-
));
96+
]);
9797

9898
/**
9999
* Configures default file logging options
100100
*/
101101
App::uses('CakeLog', 'Log');
102-
CakeLog::config('debug', array(
102+
CakeLog::config('debug', [
103103
'engine' => 'File',
104-
'types' => array('notice', 'info', 'debug'),
104+
'types' => ['notice', 'info', 'debug'],
105105
'file' => 'debug',
106-
));
107-
CakeLog::config('error', array(
106+
]);
107+
CakeLog::config('error', [
108108
'engine' => 'File',
109-
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
109+
'types' => ['warning', 'error', 'critical', 'alert', 'emergency'],
110110
'file' => 'error',
111-
));
111+
]);

app/Config/core.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151
*
5252
* @see ErrorHandler for more information on error handling and configuration.
5353
*/
54-
Configure::write('Error', array(
54+
Configure::write('Error', [
5555
'handler' => 'ErrorHandler::handleError',
5656
'level' => E_ALL & ~E_DEPRECATED,
5757
'trace' => true
58-
));
58+
]);
5959

6060
/**
6161
* Configure the Exception handler used for uncaught exceptions. By default,
@@ -79,11 +79,11 @@
7979
*
8080
* @see ErrorHandler for more information on exception handling and configuration.
8181
*/
82-
Configure::write('Exception', array(
82+
Configure::write('Exception', [
8383
'handler' => 'ErrorHandler::handleException',
8484
'renderer' => 'ExceptionRenderer',
8585
'log' => true
86-
));
86+
]);
8787

8888
/**
8989
* Application wide charset encoding
@@ -226,9 +226,9 @@
226226
* To use database sessions, run the app/Config/Schema/sessions.php schema using
227227
* the cake shell command: cake schema create Sessions
228228
*/
229-
Configure::write('Session', array(
229+
Configure::write('Session', [
230230
'defaults' => 'php'
231-
));
231+
]);
232232

233233
/**
234234
* A random string used in security hashing methods.
@@ -376,22 +376,22 @@
376376
* Configure the cache used for general framework caching. Path information,
377377
* object listings, and translation cache files are stored with this configuration.
378378
*/
379-
Cache::config('_cake_core_', array(
379+
Cache::config('_cake_core_', [
380380
'engine' => $engine,
381381
'prefix' => $prefix . 'cake_core_',
382382
'path' => CACHE . 'persistent' . DS,
383383
'serialize' => ($engine === 'File'),
384384
'duration' => $duration
385-
));
385+
]);
386386

387387
/**
388388
* Configure the cache for model and datasource caches. This cache configuration
389389
* is used to store schema descriptions, and table listings in connections.
390390
*/
391-
Cache::config('_cake_model_', array(
391+
Cache::config('_cake_model_', [
392392
'engine' => $engine,
393393
'prefix' => $prefix . 'cake_model_',
394394
'path' => CACHE . 'models' . DS,
395395
'serialize' => ($engine === 'File'),
396396
'duration' => $duration
397-
));
397+
]);

app/Config/routes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
* its action called 'display', and we pass a param to select the view file
2626
* to use (in this case, /app/View/Pages/home.ctp)...
2727
*/
28-
Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
28+
Router::connect('/', ['controller' => 'pages', 'action' => 'display', 'home']);
2929
/**
3030
* ...and connect the rest of 'Pages' controller's URLs.
3131
*/
32-
Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
32+
Router::connect('/pages/*', ['controller' => 'pages', 'action' => 'display']);
3333

3434
/**
3535
* Load all plugin routes. See the CakePlugin documentation on

app/Console/cake.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
$dispatcher = 'Cake' . DS . 'Console' . DS . 'ShellDispatcher.php';
2525

2626
if (function_exists('ini_set')) {
27-
$root = dirname(dirname(dirname(__FILE__)));
28-
$appDir = basename(dirname(dirname(__FILE__)));
27+
$root = dirname(__FILE__, 3);
28+
$appDir = basename(dirname(__FILE__, 2));
2929
$install = $root . DS . 'lib';
3030
$composerInstall = $root . DS . $appDir . DS . 'Vendor' . DS . 'cakephp' . DS . 'cakephp' . DS . 'lib';
3131

app/Controller/PagesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PagesController extends AppController {
3535
*
3636
* @var array
3737
*/
38-
public $uses = array();
38+
public $uses = [];
3939

4040
/**
4141
* Displays a view

0 commit comments

Comments
 (0)