Completed
Push — master ( c1f25f...b3d94f )
by Aimeos
02:05
created

lib/custom/setup/default/schema/customer.php (35 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2016-2018
6
 */
7
8
9
return array(
10
	'table' => array(
11
		'users' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
12
13
			$table = $schema->createTable( 'users' );
14
15
			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
16
			$table->addColumn( 'superuser', 'smallint', array( 'default' => 0 ) );
17
			$table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) );
18
			$table->addColumn( 'label', 'string', array( 'length' => 255, 'default' => '' ) );
19
			$table->addColumn( 'name', 'string', array( 'length' => 255 ) );
20
			$table->addColumn( 'remember_token', 'string', array( 'length' => 100, 'notnull' => false ) );
21
			$table->addColumn( 'salutation', 'string', array( 'length' => 8, 'default' => '' ) );
22
			$table->addColumn( 'company', 'string', array( 'length' => 100, 'default' => '' ) );
23
			$table->addColumn( 'vatid', 'string', array( 'length' => 32, 'default' => '' ) );
24
			$table->addColumn( 'title', 'string', array( 'length' => 64, 'default' => '' ) );
25
			$table->addColumn( 'firstname', 'string', array( 'length' => 64, 'default' => '' ) );
26
			$table->addColumn( 'lastname', 'string', array( 'length' => 64, 'default' => '' ) );
27
			$table->addColumn( 'address1', 'string', array( 'length' => 200, 'default' => '' ) );
28
			$table->addColumn( 'address2', 'string', array( 'length' => 200, 'default' => '' ) );
29
			$table->addColumn( 'address3', 'string', array( 'length' => 200, 'default' => '' ) );
30
			$table->addColumn( 'postal', 'string', array( 'length' => 16, 'default' => '' ) );
31
			$table->addColumn( 'city', 'string', array( 'length' => 200, 'default' => '' ) );
32
			$table->addColumn( 'state', 'string', array( 'length' => 200, 'default' => '' ) );
33
			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
34
			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
35
			$table->addColumn( 'telephone', 'string', array( 'length' => 32, 'default' => '' ) );
36
			$table->addColumn( 'telefax', 'string', array( 'length' => 32, 'default' => '' ) );
37
			$table->addColumn( 'website', 'string', array( 'length' => 255, 'default' => '' ) );
38
			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
39
			$table->addColumn( 'password', 'string', array( 'length' => 255 ) );
40
			$table->addColumn( 'longitude', 'float', array( 'notnull' => false ) );
41
			$table->addColumn( 'latitude', 'float', array( 'notnull' => false ) );
42
			$table->addColumn( 'birthday', 'date', array( 'notnull' => false ) );
43
			$table->addColumn( 'vdate', 'date', array( 'notnull' => false ) );
44
			$table->addColumn( 'status', 'smallint', array( 'default' => 1 ) );
45
			$table->addColumn( 'updated_at', 'datetime', [] );
46
			$table->addColumn( 'created_at', 'datetime', [] );
47
			$table->addColumn( 'editor', 'string', array('length' => 255, 'default' => '' ) );
48
49
			$table->setPrimaryKey( array( 'id' ), 'pk_lvusr_id' );
0 ignored issues
show
array('id') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
50
			$table->addUniqueIndex( array( 'email' ), 'unq_lvusr_email' );
0 ignored issues
show
array('email') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
51
			$table->addIndex( array( 'langid' ), 'idx_lvusr_langid' );
0 ignored issues
show
array('langid') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
52
			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvusr_last_first' );
0 ignored issues
show
array('lastname', 'firstname') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
53
			$table->addIndex( array( 'postal', 'address1' ), 'idx_lvusr_post_addr1' );
0 ignored issues
show
array('postal', 'address1') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
54
			$table->addIndex( array( 'postal', 'city' ), 'idx_lvusr_post_city' );
0 ignored issues
show
array('postal', 'city') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
55
			$table->addIndex( array( 'lastname' ), 'idx_lvusr_lastname' );
0 ignored issues
show
array('lastname') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
56
			$table->addIndex( array( 'address1' ), 'idx_lvusr_address1' );
0 ignored issues
show
array('address1') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
57
			$table->addIndex( array( 'city' ), 'idx_lvusr_city' );
0 ignored issues
show
array('city') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
58
59
			return $schema;
60
		},
61
62
		'users_address' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
63
64
			$table = $schema->createTable( 'users_address' );
65
66
			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
67
			$table->addColumn( 'siteid', 'integer', [] );
68
			$table->addColumn( 'parentid', 'integer', [] );
69
			$table->addColumn( 'pos', 'smallint', [] );
70
			$table->addColumn( 'company', 'string', array( 'length' => 100 ) );
71
			$table->addColumn( 'vatid', 'string', array( 'length' => 32 ) );
72
			$table->addColumn( 'salutation', 'string', array( 'length' => 8 ) );
73
			$table->addColumn( 'title', 'string', array( 'length' => 64 ) );
74
			$table->addColumn( 'firstname', 'string', array( 'length' => 64 ) );
75
			$table->addColumn( 'lastname', 'string', array( 'length' => 64 ) );
76
			$table->addColumn( 'address1', 'string', array( 'length' => 200 ) );
77
			$table->addColumn( 'address2', 'string', array( 'length' => 200 ) );
78
			$table->addColumn( 'address3', 'string', array( 'length' => 200 ) );
79
			$table->addColumn( 'postal', 'string', array( 'length' => 16 ) );
80
			$table->addColumn( 'city', 'string', array( 'length' => 200 ) );
81
			$table->addColumn( 'state', 'string', array( 'length' => 200 ) );
82
			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
83
			$table->addColumn( 'countryid', 'string', array( 'length' => 2, 'notnull' => false, 'fixed' => true ) );
84
			$table->addColumn( 'telephone', 'string', array( 'length' => 32 ) );
85
			$table->addColumn( 'email', 'string', array( 'length' => 255 ) );
86
			$table->addColumn( 'telefax', 'string', array( 'length' => 255 ) );
87
			$table->addColumn( 'website', 'string', array( 'length' => 255 ) );
88
			$table->addColumn( 'longitude', 'float', array( 'notnull' => false ) );
89
			$table->addColumn( 'latitude', 'float', array( 'notnull' => false ) );
90
			$table->addColumn( 'mtime', 'datetime', [] );
91
			$table->addColumn( 'ctime', 'datetime', [] );
92
			$table->addColumn( 'editor', 'string', array('length' => 255 ) );
93
94
			$table->setPrimaryKey( array( 'id' ), 'pk_lvuad_id' );
0 ignored issues
show
array('id') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
95
			$table->addIndex( array( 'parentid' ), 'idx_lvuad_pid' );
0 ignored issues
show
array('parentid') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
96
			$table->addIndex( array( 'lastname', 'firstname' ), 'idx_lvuad_last_first' );
0 ignored issues
show
array('lastname', 'firstname') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
97
			$table->addIndex( array( 'postal', 'address1' ), 'idx_lvuad_post_addr1' );
0 ignored issues
show
array('postal', 'address1') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
98
			$table->addIndex( array( 'postal', 'city' ), 'idx_lvuad_post_city' );
0 ignored issues
show
array('postal', 'city') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
99
			$table->addIndex( array( 'address1' ), 'idx_lvuad_address1' );
0 ignored issues
show
array('address1') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
100
			$table->addIndex( array( 'city' ), 'idx_lvuad_city' );
0 ignored issues
show
array('city') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
101
			$table->addIndex( array( 'email' ), 'idx_lvuad_email' );
0 ignored issues
show
array('email') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
102
103
			$table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ),
104
				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuad_pid' );
105
106
			return $schema;
107
		},
108
109 View Code Duplication
		'users_list_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
110
111
			$table = $schema->createTable( 'users_list_type' );
112
113
			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
114
			$table->addColumn( 'siteid', 'integer', [] );
115
			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
116
			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
117
			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
118
			$table->addColumn( 'pos', 'integer', ['default' => 0] );
119
			$table->addColumn( 'status', 'smallint', [] );
120
			$table->addColumn( 'mtime', 'datetime', [] );
121
			$table->addColumn( 'ctime', 'datetime', [] );
122
			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
123
124
			$table->setPrimaryKey( array( 'id' ), 'pk_lvulity_id' );
0 ignored issues
show
array('id') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
125
			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvulity_sid_dom_code' );
0 ignored issues
show
array('siteid', 'domain', 'code') is of type array<integer,string,{"0..."string","2":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
126
			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvulity_sid_status_pos' );
0 ignored issues
show
array('siteid', 'status', 'pos') is of type array<integer,string,{"0..."string","2":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
127
			$table->addIndex( array( 'siteid', 'label' ), 'idx_lvulity_sid_label' );
0 ignored issues
show
array('siteid', 'label') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
128
			$table->addIndex( array( 'siteid', 'code' ), 'idx_lvulity_sid_code' );
0 ignored issues
show
array('siteid', 'code') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
129
130
			return $schema;
131
		},
132
133
		'users_list' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
134
135
			$table = $schema->createTable( 'users_list' );
136
137
			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
138
			$table->addColumn( 'parentid', 'integer', [] );
139
			$table->addColumn( 'siteid', 'integer', [] );
140
			$table->addColumn( 'type', 'string', array( 'length' => 32 ) );
141
			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
142
			$table->addColumn( 'refid', 'string', array( 'length' => 32 ) );
143
			$table->addColumn( 'start', 'datetime', array( 'notnull' => false ) );
144
			$table->addColumn( 'end', 'datetime', array( 'notnull' => false ) );
145
			$table->addColumn( 'config', 'text', array( 'length' => 0xffff ) );
146
			$table->addColumn( 'pos', 'integer', [] );
147
			$table->addColumn( 'status', 'smallint', [] );
148
			$table->addColumn( 'mtime', 'datetime', [] );
149
			$table->addColumn( 'ctime', 'datetime', [] );
150
			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
151
152
			$table->setPrimaryKey( array( 'id' ), 'pk_lvuli_id' );
0 ignored issues
show
array('id') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
153
			$table->addUniqueIndex( array( 'parentid', 'siteid', 'domain', 'type', 'refid' ), 'unq_lvuli_pid_sid_dm_ty_rid' );
0 ignored issues
show
array('parentid', 'sitei...main', 'type', 'refid') is of type array<integer,string,{"0..."string","4":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
154
			$table->addIndex( array( 'parentid' ), 'fk_lvuli_pid' );
0 ignored issues
show
array('parentid') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
155
156
			$table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ),
157
				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvuli_pid' );
158
159
			return $schema;
160
		},
161
162 View Code Duplication
		'users_property_type' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
163
164
			$table = $schema->createTable( 'users_property_type' );
165
166
			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
167
			$table->addColumn( 'siteid', 'integer', [] );
168
			$table->addColumn( 'domain', 'string', array( 'length' => 32 ) );
169
			$table->addColumn( 'code', 'string', array( 'length' => 32 ) );
170
			$table->addColumn( 'label', 'string', array( 'length' => 255 ) );
171
			$table->addColumn( 'pos', 'integer', ['default' => 0] );
172
			$table->addColumn( 'status', 'smallint', [] );
173
			$table->addColumn( 'mtime', 'datetime', [] );
174
			$table->addColumn( 'ctime', 'datetime', [] );
175
			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
176
177
			$table->setPrimaryKey( array( 'id' ), 'pk_lvuprty_id' );
0 ignored issues
show
array('id') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
178
			$table->addUniqueIndex( array( 'siteid', 'domain', 'code' ), 'unq_lvuprty_sid_dom_code' );
0 ignored issues
show
array('siteid', 'domain', 'code') is of type array<integer,string,{"0..."string","2":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
179
			$table->addIndex( array( 'siteid', 'status', 'pos' ), 'idx_lvuprty_sid_status_pos' );
0 ignored issues
show
array('siteid', 'status', 'pos') is of type array<integer,string,{"0..."string","2":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
180
			$table->addIndex( array( 'siteid', 'label' ), 'idx_lvuprty_sid_label' );
0 ignored issues
show
array('siteid', 'label') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
181
			$table->addIndex( array( 'siteid', 'code' ), 'idx_lvuprty_sid_code' );
0 ignored issues
show
array('siteid', 'code') is of type array<integer,string,{"0":"string","1":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
182
183
			return $schema;
184
		},
185
186
		'users_property' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
187
188
			$table = $schema->createTable( 'users_property' );
189
190
			$table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
191
			$table->addColumn( 'siteid', 'integer', [] );
192
			$table->addColumn( 'parentid', 'integer', [] );
193
			$table->addColumn( 'type', 'string', array( 'length' => 32 ) );
194
			$table->addColumn( 'langid', 'string', array( 'length' => 5, 'notnull' => false ) );
195
			$table->addColumn( 'value', 'string', array( 'length' => 255 ) );
196
			$table->addColumn( 'mtime', 'datetime', [] );
197
			$table->addColumn( 'ctime', 'datetime', [] );
198
			$table->addColumn( 'editor', 'string', array( 'length' => 255 ) );
199
200
			$table->setPrimaryKey( array( 'id' ), 'pk_lvupr_id' );
0 ignored issues
show
array('id') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
201
			$table->addUniqueIndex( array( 'parentid', 'siteid', 'type', 'langid', 'value' ), 'unq_lvupr_sid_ty_lid_value' );
0 ignored issues
show
array('parentid', 'sitei...pe', 'langid', 'value') is of type array<integer,string,{"0..."string","4":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
202
			$table->addIndex( array( 'parentid' ), 'fk_lvupr_pid' );
0 ignored issues
show
array('parentid') is of type array<integer,string,{"0":"string"}>, but the function expects a array<integer,array<integer,*>>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
203
204
			$table->addForeignKeyConstraint( 'users', array( 'parentid' ), array( 'id' ),
205
				array( 'onUpdate' => 'CASCADE', 'onDelete' => 'CASCADE' ), 'fk_lvupr_pid' );
206
207
			return $schema;
208
		},
209
	),
210
);
211