Run a match comparison on the provided code and the expected code

@param $code
@param $expectedCode

@return bool
349361
protected function compare($code, $expectedCode)
    {
        return ($expectedCode !== null && is_string($expectedCode) && $this->niceize($code) == $this->niceize($expectedCode));
    }
1018323
public function dontSeeResponseCodeIs($code)
    {
        $failureMessage = sprintf(
            'Expected HTTP status code other than %s',
            HttpCode::getDescription($code)
        );
        $this->assertNotEquals($code, $this->getResponseStatusCode(), $failureMessage);
    }
317863
protected function adaptCodeToEval($code) {
		$code = $this->trimPhpTags($code);
		$code = $this->forceEndingSemicolon($code);
		return $code;
	}
584387
private function optimizeScriptCode($code)
	{
		if (YII_DEBUG)
			return $code;
		require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'JSMin.php';
		$minified = JSMin::minify($code);

		return ($minified === false ? $code : $minified);
	}
295903
public function hasExceptionOfCode($code)
    {
        $code = (int) $code;
        foreach ($this->_exceptions as $e) {
            if ($code == $e->getCode()) {
                return true;
            }
        }

        return false;
    }
1213676
public function offsetExists($langcode)
    {
        return (isset($this->lang[$langcode][$this->category])
            or $this->isFileExistsInSubDir($langcode)
            or $this->isFileExistsWithSuffix($langcode)
            or $this->isFileExistsWithoutSuffix($langcode));
    }
513967
public function postFilter($code)
    {
        // run post filter if on code
        if (!empty($code) &&
            (isset($this->smarty->autoload_filters[ 'post' ]) || isset($this->smarty->registered_filters[ 'post' ]))
        ) {
            return $this->smarty->ext->_filterHandler->runFilter('post', $code, $this->template);
        } else {
            return $code;
        }
    }
49404
public static function match($actual, $expected)
    {
        $length = static::actual($actual);
        static::_buildDescription($actual, $length, $expected);

        return $length === $expected;
    }
487995
private function parse($code)
    {
        try {
            return $this->parser->parse($code);
        } catch (\PhpParser\Error $e) {
            if (\strpos($e->getMessage(), 'unexpected EOF') === false) {
                throw $e;
            }

            // If we got an unexpected EOF, let's try it again with a semicolon.
            return $this->parser->parse($code . ';');
        }
    }
893328
public function theResponseCodeShouldBe($code)
    {
        $expected = intval($code);
        $actual = intval($this->response->getStatusCode());
        Assertions::assertSame($expected, $actual);
    }
280015
protected function validate($code)
    {
        $color = str_replace('#', '', DefinedColor::find($code));
        if (strlen($color) === 3) {
            $color = $color[0] . $color[0] . $color[1] . $color[1] . $color[2] . $color[2];
        }
        return preg_match('/^[a-f0-9]{6}$/i', $color) ? $color : false;
    }
77158
protected function detect_plugin_component_from_versionphp($code) {

        $result = preg_match_all('#^\s*\$plugin\->component\s*=\s*([\'"])(.+?_.+?)\1\s*;#m', $code, $matches);

        // Return if and only if the single match was detected.
        if ($result === 1 and !empty($matches[2][0])) {
            return $matches[2][0];
        }

        return false;
    }
794697
protected function checkEval($code)
    {
        $error = error_get_last();

        if (isset($error['message'])
            && isset($error['line'])
            && $error['message'] === 'parse error'
        ) {
            $code = explode("\n", $code);
            $start = $error['line'] - 25;
            if ($start < 0) {
                $start = 0;
            }

            $code = array_splice($code, $start, 50);

            foreach ($code as $i => $line) {
                $code[$i] = (++$start) . ': ' . $line;
            }

            throw HandlebarsException::forCompileError($error, $code);
        }

        return $this;
    }
115687
public function getByCode($code)
    {
        if (\is_scalar($code) && ! empty($code = trim($this->uppercaseAndSafeTransliterate($code)))) {
            foreach ($this->items as $auto_category) {
                if ($auto_category->getCode() === $code) {
                    return $auto_category;
                }
            }
        }
    }
76902
public function item($code) : Bool
    {
        if( empty(Properties::$items) )
        {
            return false;
        }

        $i = 0;

        foreach( Properties::$items as $row )
        {
            if( is_array($code) )
            {
                if( isset($row[key($code)]) && $row[key($code)] == current($code) )
                {
                    $code = $row[key($code)];
                }
            }

            $key = array_search($code, $row);

            if( ! empty($key) )
            {
                array_splice(Properties::$items, $i--, 1);
            }

            $i++;
        }

        return $this->driver->insert($this->key, Properties::$items);
    }
846535
public function getAction(string $code): Action
    {
        if (!$this->hasAction($code)) {
            throw new \UnexpectedValueException("No action with code: '{$code}' for admin '{$this->getCode()}'");
        }

        return $this->actions[$code];
    }
779851
protected function __isValueMatchAsExpected($value, $expectedString)
    {
        $match = false;

        if ($expectedString === null)
            ## undefined expected values must not be NULL
            ## except when it write down on docblock "@return void"
            return $value === null;

        $valueType = strtolower(gettype($value));

        /**
         * @return string|null|object|\Stdclass|void
         */
        $expectedString = explode('|', $expectedString);
        foreach($expectedString as $ext) {
            $ext = strtolower(trim($ext));
            if ($ext == '') continue;

            if ($value === VOID && $ext == 'void')
                $match = true;
            elseif ($valueType === $ext && $value != null)
                $match = true;
            elseif ($valueType === 'object') {
                if (is_a($value, $ext))
                    $match = true;
            }

            if ($match) break;
        }

        return $match;
    }