src/Phinx/Db/Table/Column.php
public function setEncoding($encoding)
    {
        $allowedTypes = [
            AdapterInterface::PHINX_TYPE_CHAR,
            AdapterInterface::PHINX_TYPE_STRING,
            AdapterInterface::PHINX_TYPE_TEXT,
        ];
        if (!in_array($this->getType(), $allowedTypes)) {
            throw new \UnexpectedValueException('Character set may be set only for types: ' . implode(', ', $allowedTypes));
        }

        $this->encoding = $encoding;

        return $this;
    }
public function setEncoding($encoding)
    {
        $allowedTypes = [
            AdapterInterface::PHINX_TYPE_CHAR,
            AdapterInterface::PHINX_TYPE_STRING,
            AdapterInterface::PHINX_TYPE_TEXT,
        ];
        if (!in_array($this->getType(), $allowedTypes)) {
            throw new \UnexpectedValueException('Character set may be set only for types: ' . implode(', ', $allowedTypes));
        }

        $this->encoding = $encoding;

        return $this;
    }
public function setEncoding ( $ encoding ) { $ allowedTypes = [ AdapterInterface :: PHINX_TYPE_CHAR , AdapterInterface :: PHINX_TYPE_STRING , AdapterInterface :: PHINX_TYPE_TEXT , ] ; if ( ! in_array ( $ this -> getType ( ) , $ allowedTypes ) ) { throw new \ UnexpectedValueException ( 'Character set may be set only for types: ' . implode ( ', ' , $ allowedTypes ) ) ; } $ this -> encoding = $ encoding ; return $ this ; }
Sets the column character set.

@param string $encoding

@throws \UnexpectedValueException If character set not allowed for type
@return $this
Sets the column character set .