Check if body of function has changed.

@param Function_ $old
@param Function_ $new

@return bool
321415
public function handle($old, $new)
    {
        if ( ! $this->canHandle($old) || ! $this->canHandle($new)) {
            return null;
        }

        if ($this->equals($old, $new)) {
            return false;
        }

        $this->lastException = new FailedConstraint(
            sprintf(
                '%s() body changed',
                $new->name
            )
        );

        return true;
    }
484104
public function compare(Column $oldColumn, Column $newColumn)
    {
        $differences = array();

        if ($oldColumn->getType() !== $newColumn->getType()) {
            $differences[] = 'type';
        }

        if ($oldColumn->getLength() !== $newColumn->getLength()) {
            $differences[] = 'length';
        }

        if ($oldColumn->getPrecision() !== $newColumn->getPrecision()) {
            $differences[] = 'precision';
        }

        if ($oldColumn->getScale() !== $newColumn->getScale()) {
            $differences[] = 'scale';
        }

        if ($oldColumn->isUnsigned() !== $newColumn->isUnsigned()) {
            $differences[] = 'unsigned';
        }

        if ($oldColumn->isFixed() !== $newColumn->isFixed()) {
            $differences[] = 'fixed';
        }

        if ($oldColumn->isNotNull() !== $newColumn->isNotNull()) {
            $differences[] = 'not_null';
        }

        if ($oldColumn->getDefault() !== $newColumn->getDefault()) {
            $differences[] = 'default';
        }

        if ($oldColumn->isAutoIncrement() !== $newColumn->isAutoIncrement()) {
            $differences[] = 'auto_increment';
        }

        if ($oldColumn->getComment() !== $newColumn->getComment()) {
            $differences[] = 'comment';
        }

        return new ColumnDiff($oldColumn, $newColumn, $differences);
    }
670327
public function change_password($old_password, $new_password, $username = null)
	{
		try
		{
			return (bool) $this->update_user(array('old_password' => $old_password, 'password' => $new_password), $username);
		}
		// Only catch the wrong password exception
		catch (SimpleUserWrongPassword $e)
		{
			return false;
		}
	}
542120
public function replace($old, $new): self
    {
        Assert::typeOf(['string', __CLASS__], $old, $new);

        return new static(str_replace((string) $old, (string) $new, $this->data), $this->encoding);
    }
383482
protected function getTableMigrationNewTables($output, $new, $old)
    {
        if (empty($new['tables'])) {
            return $output;
        }
        foreach ($new['tables'] as $tableName => $table) {
            if ($tableName === $this->options['default_migration_table']) {
                continue;
            }

            if (!isset($old['tables'][$tableName])) {
                // create the table
                $table['has_table_variable'] = true;
                $output = $this->getCreateTable($output, $table, $tableName);
            }

            $output = $this->getTableMigrationNewTablesColumns($output, $table, $tableName, $new, $old);
            $output = $this->getTableMigrationOldTablesColumns($output, $tableName, $new, $old);
            $output = $this->getTableMigrationIndexes($output, $table, $tableName, $new, $old);
        }

        return $output;
    }
857186
public function lines(array $old, array $new)
    {
        $diff = parent::lines($old, $new);

        $len = count($new);
        for ($i = 0; $i < $len; $i++) {
            if (isset($diff[$i]) && !is_null($new[$i]) && $diff[$i]['col'] > 0) {
                $styling = $this->cursor->getCurrentFormatting(mb_substr($new[$i], 0, $diff[$i]['col']));
                $diff[$i]['col'] = mb_strlen($this->cursor->filter(mb_substr($new[$i], 0, $diff[$i]['col'])));
                if (mb_strlen($styling) > 0) {
                    $diff[$i]['str'] = $styling . $diff[$i]['str'];
                }
            }
        }

        return $diff;
    }
286694
public function compare($old, $new, $mode = 'normal')
	{
		// Mixed
		if ( $mode === 'mixed')
		{
			// Insert characters
			$ins_begin 	= '<ins>+ ';
			$ins_end 	= '</ins>' . PHP_EOL;

			// Delete characters
			$del_begin 		= '<del>- ';
			$del_end		= '</del>' . PHP_EOL;
		}
		// HTML mode
		elseif ( $mode === 'html' )
		{
			// Insert characters
			$ins_begin 	= '<ins>';
			$ins_end 	= '</ins>' . PHP_EOL;

			// Delete characters
			$del_begin 		= '<del>';
			$del_end		= '</del>' . PHP_EOL;
		}
		// Normal mode
		else
		{
			// Insert characters
			$ins_begin 	= '+ ';
			$ins_end 	= PHP_EOL;

			// Delete characters
			$del_begin 		= '- ';
			$del_end		= PHP_EOL;
		}

		// Turn the strings into an array so it's a bit easier to parse them
		$diff	= $this->diff(explode(PHP_EOL, $old), explode(PHP_EOL, $new));
		$result	= '';
      
      if ($mode == 'raw')
         return $diff;

		foreach($diff as $line)
		{
			if(is_array($line))
			{
				$result .= !empty($line['del']) ? $del_begin . implode(PHP_EOL, $line['del']) . $del_end : '';
				$result .= !empty($line['ins']) ? $ins_begin . implode(PHP_EOL, $line['ins']) . $ins_end : '';
			}
			else
			{
				$result .= $line . PHP_EOL;
			}
		}

		// Return the result
		return $result;
	}
1305496
protected function updateEnabled( $new, $old )
    {
        $result     = array();
        $service    = $this->getServiceLocator()
                           ->get( 'Locale' );

        foreach ( $service->getAvailableFlags() as $locale => $enabled )
        {
            $result[$locale] = (string) (
                ! empty( $new[$locale] ) ||
                in_array( $locale, $new )
            );
        }

        return $result;
    }
941490
private function findDiff($new)
    {
        $old = $this->oldValues;
        $diff = [];

        foreach ($new as $key => $value) {
            if (!isset($old[$key]) || $old[$key] !== $new[$key]) {
                $diff[$key] = $value;
            }
        }

        return $diff;
    }
606657
function is_mandatory($new = null)
    {
        if (isset($new) && ($this->_attributes['is_mandatory'] != $new)){
            $this->change('is_mandatory', (bool)$new);
        }
        return $this->_attributes['is_mandatory'];
    }
94402
public function move(string $old, string $new){
    if (
      !empty($old) &&
      !empty($new) &&
      ($old = $this->checkFilePath($old)) &&
      ftp_rename($this->cn, $old, $new)
    ){
      return true;
    }
    return false;
  }
264989
public function updateMeta($key, $newValue, $oldValue = false)
    {
        $meta = $this->getMeta($key, null, true);

        if ($meta == null) {
            return $this->addMeta($key, $newValue);
        }

        $obj = $this->getEditableItem($meta, $oldValue);

        if ($obj !== false) {
            $isSaved = $obj->update([
                'value' => $newValue
            ]);

            return $isSaved ? $obj : $obj->getErrors();
        }

        return null;
    }
251469
public function update($new_instance, $old_instance)
    {
        $instance = [];
        $instance['title'] = ( ! empty($new_instance['title']) ) ? \strip_tags($new_instance['title']) : '';
        $instance['show_parent'] = ( ! empty($new_instance['show_parent']) ) ? true : false;
        return $instance;
    }
1258377
public function replace($old, $new)
    {
        $this->str = $this->str->replace((string)$old, (string)$new);

        return $this;
    }
679097
public function renameTable($old, $new)
    {
        $this->replaceText("`$old`", "`$new`");
        $this->replaceText("\"$old\"", "\"$new\"");
        $this->replaceText(Convert::symbol2sql($old), Convert::symbol2sql($new));
    }
1105726
public function rename($new, $old = null)
    {
        $this->arguments[] = 'rename';
        if ($old) {
            $this->arguments[] = $old;
        }
        $this->arguments[] = $new;
        return $this;
    }
1348703
function is_default_logic($new = null, $return_entity = false)
    {
        if (isset($new) && ($this->_attributes['is_default_logic'] != $new)){
            $this->change('is_default_logic', (bool)$new);
        }
        if ($return_entity){
            if (!isset($this->_def_logic)){
                if (empty($this->_attributes['is_default_logic'])){
                    $this->_def_logic = false;
                }else
                if (($this->_def_logic = $this->proto(null, true))){
                    if ($p = $this->_def_logic->is_default_logic(null, true)) $this->_def_logic = $p;
                }
            }
            return $this->_def_logic;
        }
        return $this->_attributes['is_default_logic'];
    }