These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | use Illuminate\Support\Facades\Schema; |
||
6 | use Illuminate\Database\Schema\Blueprint; |
||
7 | use Illuminate\Database\Migrations\Migration; |
||
8 | |||
9 | class CreateAddressesTable extends Migration |
||
10 | { |
||
11 | public function up() |
||
12 | { |
||
13 | Schema::create(config('rinvex.addresses.tables.addresses'), function (Blueprint $table) { |
||
14 | // Columns |
||
15 | $table->increments('id'); |
||
16 | $table->morphs('addressable'); |
||
17 | $table->string('given_name'); |
||
18 | $table->string('family_name'); |
||
19 | $table->string('label')->nullable(); |
||
20 | $table->string('organization')->nullable(); |
||
21 | $table->string('country_code', 2)->nullable(); |
||
22 | $table->string('street')->nullable(); |
||
23 | $table->string('state')->nullable(); |
||
24 | $table->string('city')->nullable(); |
||
25 | $table->string('postal_code')->nullable(); |
||
26 | $table->decimal('latitude', 10, 7)->nullable(); |
||
27 | $table->decimal('longitude', 10, 7)->nullable(); |
||
28 | $table->boolean('is_primary')->default(false); |
||
0 ignored issues
–
show
|
|||
29 | $table->boolean('is_billing')->default(false); |
||
0 ignored issues
–
show
false is of type boolean , but the function expects a string .
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...
|
|||
30 | $table->boolean('is_shipping')->default(false); |
||
0 ignored issues
–
show
false is of type boolean , but the function expects a string .
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...
|
|||
31 | $table->timestamps(); |
||
32 | $table->softDeletes(); |
||
33 | }); |
||
34 | } |
||
35 | |||
36 | public function down() |
||
37 | { |
||
38 | Schema::dropIfExists(config('rinvex.addresses.tables.addresses')); |
||
39 | } |
||
40 | } |
||
41 |
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: