for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Roman Varkuta <[email protected]>
* @license MIT
* @see https://github.com/myclabs/php-enum PHP enum implementation
* @version 1.0
*/
declare(strict_types=1);
namespace Kartavik\Yii2\Database\Mysql;
use Kartavik\Yii2\Database\EnumTrait;
use MyCLabs\Enum\Enum;
use yii\db;
* Trait SchemaBuilderTrait
* @package Kartavik\Yii2\Database\Mysql
*
* @mixin \yii\db\Migration
trait SchemaBuilderTrait
{
use EnumTrait;
* @param array|string|Enum $values
* @return db\ColumnSchemaBuilder
* @throws \yii\base\NotSupportedException
public function enum($values): db\ColumnSchemaBuilder
return $this->getDb()
->getSchema()
->createColumnSchemaBuilder(
$this->formatEnumValues(
$this->fetchEnums($values)
array
object<Kartavik\Yii2\Database\iterable>
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);
)
);
}
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: