| Conditions | 93 |
| Paths | > 20000 |
| Total Lines | 427 |
| Code Lines | 268 |
| Lines | 29 |
| Ratio | 6.79 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 39 | public function execute() { |
||
| 40 | // The data is hot but user-dependent, like page views, so we set vary cookies |
||
| 41 | $this->getMain()->setCacheMode( 'anon-public-user-private' ); |
||
| 42 | |||
| 43 | // Get parameters |
||
| 44 | $params = $this->extractRequestParams(); |
||
| 45 | $text = $params['text']; |
||
| 46 | $title = $params['title']; |
||
| 47 | if ( $title === null ) { |
||
| 48 | $titleProvided = false; |
||
| 49 | // A title is needed for parsing, so arbitrarily choose one |
||
| 50 | $title = 'API'; |
||
| 51 | } else { |
||
| 52 | $titleProvided = true; |
||
| 53 | } |
||
| 54 | |||
| 55 | $page = $params['page']; |
||
| 56 | $pageid = $params['pageid']; |
||
| 57 | $oldid = $params['oldid']; |
||
| 58 | |||
| 59 | $model = $params['contentmodel']; |
||
| 60 | $format = $params['contentformat']; |
||
| 61 | |||
| 62 | if ( !is_null( $page ) && ( !is_null( $text ) || $titleProvided ) ) { |
||
| 63 | $this->dieUsage( |
||
| 64 | 'The page parameter cannot be used together with the text and title parameters', |
||
| 65 | 'params' |
||
| 66 | ); |
||
| 67 | } |
||
| 68 | |||
| 69 | $prop = array_flip( $params['prop'] ); |
||
| 70 | |||
| 71 | if ( isset( $params['section'] ) ) { |
||
| 72 | $this->section = $params['section']; |
||
| 73 | if ( !preg_match( '/^((T-)?\d+|new)$/', $this->section ) ) { |
||
| 74 | $this->dieUsage( |
||
| 75 | 'The section parameter must be a valid section id or "new"', 'invalidsection' |
||
| 76 | ); |
||
| 77 | } |
||
| 78 | } else { |
||
| 79 | $this->section = false; |
||
|
|
|||
| 80 | } |
||
| 81 | |||
| 82 | // The parser needs $wgTitle to be set, apparently the |
||
| 83 | // $title parameter in Parser::parse isn't enough *sigh* |
||
| 84 | // TODO: Does this still need $wgTitle? |
||
| 85 | global $wgParser, $wgTitle; |
||
| 86 | |||
| 87 | $redirValues = null; |
||
| 88 | |||
| 89 | // Return result |
||
| 90 | $result = $this->getResult(); |
||
| 91 | |||
| 92 | if ( !is_null( $oldid ) || !is_null( $pageid ) || !is_null( $page ) ) { |
||
| 93 | if ( $this->section === 'new' ) { |
||
| 94 | $this->dieUsage( |
||
| 95 | 'section=new cannot be combined with oldid, pageid or page parameters. ' . |
||
| 96 | 'Please use text', 'params' |
||
| 97 | ); |
||
| 98 | } |
||
| 99 | if ( !is_null( $oldid ) ) { |
||
| 100 | // Don't use the parser cache |
||
| 101 | $rev = Revision::newFromId( $oldid ); |
||
| 102 | if ( !$rev ) { |
||
| 103 | $this->dieUsage( "There is no revision ID $oldid", 'missingrev' ); |
||
| 104 | } |
||
| 105 | if ( !$rev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) { |
||
| 106 | $this->dieUsage( "You don't have permission to view deleted revisions", 'permissiondenied' ); |
||
| 107 | } |
||
| 108 | |||
| 109 | $titleObj = $rev->getTitle(); |
||
| 110 | $wgTitle = $titleObj; |
||
| 111 | $pageObj = WikiPage::factory( $titleObj ); |
||
| 112 | $popts = $this->makeParserOptions( $pageObj, $params ); |
||
| 113 | |||
| 114 | // If for some reason the "oldid" is actually the current revision, it may be cached |
||
| 115 | // Deliberately comparing $pageObj->getLatest() with $rev->getId(), rather than |
||
| 116 | // checking $rev->isCurrent(), because $pageObj is what actually ends up being used, |
||
| 117 | // and if its ->getLatest() is outdated, $rev->isCurrent() won't tell us that. |
||
| 118 | if ( $rev->getId() == $pageObj->getLatest() ) { |
||
| 119 | // May get from/save to parser cache |
||
| 120 | $p_result = $this->getParsedContent( $pageObj, $popts, |
||
| 121 | $pageid, isset( $prop['wikitext'] ) ); |
||
| 122 | } else { // This is an old revision, so get the text differently |
||
| 123 | $this->content = $rev->getContent( Revision::FOR_THIS_USER, $this->getUser() ); |
||
| 124 | |||
| 125 | if ( $this->section !== false ) { |
||
| 126 | $this->content = $this->getSectionContent( $this->content, 'r' . $rev->getId() ); |
||
| 127 | } |
||
| 128 | |||
| 129 | // Should we save old revision parses to the parser cache? |
||
| 130 | $p_result = $this->content->getParserOutput( $titleObj, $rev->getId(), $popts ); |
||
| 131 | } |
||
| 132 | } else { // Not $oldid, but $pageid or $page |
||
| 133 | if ( $params['redirects'] ) { |
||
| 134 | $reqParams = [ |
||
| 135 | 'redirects' => '', |
||
| 136 | ]; |
||
| 137 | if ( !is_null( $pageid ) ) { |
||
| 138 | $reqParams['pageids'] = $pageid; |
||
| 139 | } else { // $page |
||
| 140 | $reqParams['titles'] = $page; |
||
| 141 | } |
||
| 142 | $req = new FauxRequest( $reqParams ); |
||
| 143 | $main = new ApiMain( $req ); |
||
| 144 | $pageSet = new ApiPageSet( $main ); |
||
| 145 | $pageSet->execute(); |
||
| 146 | $redirValues = $pageSet->getRedirectTitlesAsResult( $this->getResult() ); |
||
| 147 | |||
| 148 | $to = $page; |
||
| 149 | foreach ( $pageSet->getRedirectTitles() as $title ) { |
||
| 150 | $to = $title->getFullText(); |
||
| 151 | } |
||
| 152 | $pageParams = [ 'title' => $to ]; |
||
| 153 | } elseif ( !is_null( $pageid ) ) { |
||
| 154 | $pageParams = [ 'pageid' => $pageid ]; |
||
| 155 | } else { // $page |
||
| 156 | $pageParams = [ 'title' => $page ]; |
||
| 157 | } |
||
| 158 | |||
| 159 | $pageObj = $this->getTitleOrPageId( $pageParams, 'fromdb' ); |
||
| 160 | $titleObj = $pageObj->getTitle(); |
||
| 161 | if ( !$titleObj || !$titleObj->exists() ) { |
||
| 162 | $this->dieUsage( "The page you specified doesn't exist", 'missingtitle' ); |
||
| 163 | } |
||
| 164 | $wgTitle = $titleObj; |
||
| 165 | |||
| 166 | if ( isset( $prop['revid'] ) ) { |
||
| 167 | $oldid = $pageObj->getLatest(); |
||
| 168 | } |
||
| 169 | |||
| 170 | $popts = $this->makeParserOptions( $pageObj, $params ); |
||
| 171 | |||
| 172 | // Don't pollute the parser cache when setting options that aren't |
||
| 173 | // in ParserOptions::optionsHash() |
||
| 174 | /// @todo: This should be handled closer to the actual cache instead of here, see T110269 |
||
| 175 | $suppressCache = |
||
| 176 | $params['disablepp'] || |
||
| 177 | $params['disablelimitreport'] || |
||
| 178 | $params['preview'] || |
||
| 179 | $params['sectionpreview'] || |
||
| 180 | $params['disabletidy']; |
||
| 181 | |||
| 182 | if ( $suppressCache ) { |
||
| 183 | $this->content = $this->getContent( $pageObj, $pageid ); |
||
| 184 | $p_result = $this->content->getParserOutput( $titleObj, null, $popts ); |
||
| 185 | } else { |
||
| 186 | // Potentially cached |
||
| 187 | $p_result = $this->getParsedContent( $pageObj, $popts, $pageid, |
||
| 188 | isset( $prop['wikitext'] ) ); |
||
| 189 | } |
||
| 190 | } |
||
| 191 | } else { // Not $oldid, $pageid, $page. Hence based on $text |
||
| 192 | $titleObj = Title::newFromText( $title ); |
||
| 193 | if ( !$titleObj || $titleObj->isExternal() ) { |
||
| 194 | $this->dieUsageMsg( [ 'invalidtitle', $title ] ); |
||
| 195 | } |
||
| 196 | $wgTitle = $titleObj; |
||
| 197 | if ( $titleObj->canExist() ) { |
||
| 198 | $pageObj = WikiPage::factory( $titleObj ); |
||
| 199 | } else { |
||
| 200 | // Do like MediaWiki::initializeArticle() |
||
| 201 | $article = Article::newFromTitle( $titleObj, $this->getContext() ); |
||
| 202 | $pageObj = $article->getPage(); |
||
| 203 | } |
||
| 204 | |||
| 205 | $popts = $this->makeParserOptions( $pageObj, $params ); |
||
| 206 | $textProvided = !is_null( $text ); |
||
| 207 | |||
| 208 | if ( !$textProvided ) { |
||
| 209 | if ( $titleProvided && ( $prop || $params['generatexml'] ) ) { |
||
| 210 | $this->setWarning( |
||
| 211 | "'title' used without 'text', and parsed page properties were requested " . |
||
| 212 | "(did you mean to use 'page' instead of 'title'?)" |
||
| 213 | ); |
||
| 214 | } |
||
| 215 | // Prevent warning from ContentHandler::makeContent() |
||
| 216 | $text = ''; |
||
| 217 | } |
||
| 218 | |||
| 219 | // If we are parsing text, do not use the content model of the default |
||
| 220 | // API title, but default to wikitext to keep BC. |
||
| 221 | if ( $textProvided && !$titleProvided && is_null( $model ) ) { |
||
| 222 | $model = CONTENT_MODEL_WIKITEXT; |
||
| 223 | $this->setWarning( "No 'title' or 'contentmodel' was given, assuming $model." ); |
||
| 224 | } |
||
| 225 | |||
| 226 | try { |
||
| 227 | $this->content = ContentHandler::makeContent( $text, $titleObj, $model, $format ); |
||
| 228 | } catch ( MWContentSerializationException $ex ) { |
||
| 229 | $this->dieUsage( $ex->getMessage(), 'parseerror' ); |
||
| 230 | } |
||
| 231 | |||
| 232 | if ( $this->section !== false ) { |
||
| 233 | if ( $this->section === 'new' ) { |
||
| 234 | // Insert the section title above the content. |
||
| 235 | if ( !is_null( $params['sectiontitle'] ) && $params['sectiontitle'] !== '' ) { |
||
| 236 | $this->content = $this->content->addSectionHeader( $params['sectiontitle'] ); |
||
| 237 | } |
||
| 238 | } else { |
||
| 239 | $this->content = $this->getSectionContent( $this->content, $titleObj->getPrefixedText() ); |
||
| 240 | } |
||
| 241 | } |
||
| 242 | |||
| 243 | if ( $params['pst'] || $params['onlypst'] ) { |
||
| 244 | $this->pstContent = $this->content->preSaveTransform( $titleObj, $this->getUser(), $popts ); |
||
| 245 | } |
||
| 246 | if ( $params['onlypst'] ) { |
||
| 247 | // Build a result and bail out |
||
| 248 | $result_array = []; |
||
| 249 | $result_array['text'] = $this->pstContent->serialize( $format ); |
||
| 250 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'text'; |
||
| 251 | if ( isset( $prop['wikitext'] ) ) { |
||
| 252 | $result_array['wikitext'] = $this->content->serialize( $format ); |
||
| 253 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'wikitext'; |
||
| 254 | } |
||
| 255 | View Code Duplication | if ( !is_null( $params['summary'] ) || |
|
| 256 | ( !is_null( $params['sectiontitle'] ) && $this->section === 'new' ) |
||
| 257 | ) { |
||
| 258 | $result_array['parsedsummary'] = $this->formatSummary( $titleObj, $params ); |
||
| 259 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsedsummary'; |
||
| 260 | } |
||
| 261 | |||
| 262 | $result->addValue( null, $this->getModuleName(), $result_array ); |
||
| 263 | |||
| 264 | return; |
||
| 265 | } |
||
| 266 | |||
| 267 | // Not cached (save or load) |
||
| 268 | if ( $params['pst'] ) { |
||
| 269 | $p_result = $this->pstContent->getParserOutput( $titleObj, null, $popts ); |
||
| 270 | } else { |
||
| 271 | $p_result = $this->content->getParserOutput( $titleObj, null, $popts ); |
||
| 272 | } |
||
| 273 | } |
||
| 274 | |||
| 275 | $result_array = []; |
||
| 276 | |||
| 277 | $result_array['title'] = $titleObj->getPrefixedText(); |
||
| 278 | $result_array['pageid'] = $pageid ?: $pageObj->getId(); |
||
| 279 | |||
| 280 | if ( !is_null( $oldid ) ) { |
||
| 281 | $result_array['revid'] = intval( $oldid ); |
||
| 282 | } |
||
| 283 | |||
| 284 | if ( $params['redirects'] && !is_null( $redirValues ) ) { |
||
| 285 | $result_array['redirects'] = $redirValues; |
||
| 286 | } |
||
| 287 | |||
| 288 | if ( $params['disabletoc'] ) { |
||
| 289 | $p_result->setTOCEnabled( false ); |
||
| 290 | } |
||
| 291 | |||
| 292 | if ( isset( $prop['text'] ) ) { |
||
| 293 | $result_array['text'] = $p_result->getText(); |
||
| 294 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'text'; |
||
| 295 | } |
||
| 296 | |||
| 297 | View Code Duplication | if ( !is_null( $params['summary'] ) || |
|
| 298 | ( !is_null( $params['sectiontitle'] ) && $this->section === 'new' ) |
||
| 299 | ) { |
||
| 300 | $result_array['parsedsummary'] = $this->formatSummary( $titleObj, $params ); |
||
| 301 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsedsummary'; |
||
| 302 | } |
||
| 303 | |||
| 304 | if ( isset( $prop['langlinks'] ) ) { |
||
| 305 | $langlinks = $p_result->getLanguageLinks(); |
||
| 306 | |||
| 307 | if ( $params['effectivelanglinks'] ) { |
||
| 308 | // Link flags are ignored for now, but may in the future be |
||
| 309 | // included in the result. |
||
| 310 | $linkFlags = []; |
||
| 311 | Hooks::run( 'LanguageLinks', [ $titleObj, &$langlinks, &$linkFlags ] ); |
||
| 312 | } |
||
| 313 | } else { |
||
| 314 | $langlinks = false; |
||
| 315 | } |
||
| 316 | |||
| 317 | if ( isset( $prop['langlinks'] ) ) { |
||
| 318 | $result_array['langlinks'] = $this->formatLangLinks( $langlinks ); |
||
| 319 | } |
||
| 320 | if ( isset( $prop['categories'] ) ) { |
||
| 321 | $result_array['categories'] = $this->formatCategoryLinks( $p_result->getCategories() ); |
||
| 322 | } |
||
| 323 | if ( isset( $prop['categorieshtml'] ) ) { |
||
| 324 | $result_array['categorieshtml'] = $this->categoriesHtml( $p_result->getCategories() ); |
||
| 325 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'categorieshtml'; |
||
| 326 | } |
||
| 327 | if ( isset( $prop['links'] ) ) { |
||
| 328 | $result_array['links'] = $this->formatLinks( $p_result->getLinks() ); |
||
| 329 | } |
||
| 330 | if ( isset( $prop['templates'] ) ) { |
||
| 331 | $result_array['templates'] = $this->formatLinks( $p_result->getTemplates() ); |
||
| 332 | } |
||
| 333 | if ( isset( $prop['images'] ) ) { |
||
| 334 | $result_array['images'] = array_keys( $p_result->getImages() ); |
||
| 335 | } |
||
| 336 | if ( isset( $prop['externallinks'] ) ) { |
||
| 337 | $result_array['externallinks'] = array_keys( $p_result->getExternalLinks() ); |
||
| 338 | } |
||
| 339 | if ( isset( $prop['sections'] ) ) { |
||
| 340 | $result_array['sections'] = $p_result->getSections(); |
||
| 341 | } |
||
| 342 | |||
| 343 | if ( isset( $prop['displaytitle'] ) ) { |
||
| 344 | $result_array['displaytitle'] = $p_result->getDisplayTitle() ?: |
||
| 345 | $titleObj->getPrefixedText(); |
||
| 346 | } |
||
| 347 | |||
| 348 | if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) { |
||
| 349 | $context = $this->getContext(); |
||
| 350 | $context->setTitle( $titleObj ); |
||
| 351 | $context->getOutput()->addParserOutputMetadata( $p_result ); |
||
| 352 | |||
| 353 | if ( isset( $prop['headitems'] ) ) { |
||
| 354 | $headItems = $this->formatHeadItems( $p_result->getHeadItems() ); |
||
| 355 | |||
| 356 | $css = $this->formatCss( $context->getOutput()->buildCssLinksArray() ); |
||
| 357 | |||
| 358 | $scripts = [ $context->getOutput()->getHeadScripts() ]; |
||
| 359 | |||
| 360 | $result_array['headitems'] = array_merge( $headItems, $css, $scripts ); |
||
| 361 | } |
||
| 362 | |||
| 363 | if ( isset( $prop['headhtml'] ) ) { |
||
| 364 | $result_array['headhtml'] = $context->getOutput()->headElement( $context->getSkin() ); |
||
| 365 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'headhtml'; |
||
| 366 | } |
||
| 367 | } |
||
| 368 | |||
| 369 | if ( isset( $prop['modules'] ) ) { |
||
| 370 | $result_array['modules'] = array_values( array_unique( $p_result->getModules() ) ); |
||
| 371 | $result_array['modulescripts'] = array_values( array_unique( $p_result->getModuleScripts() ) ); |
||
| 372 | $result_array['modulestyles'] = array_values( array_unique( $p_result->getModuleStyles() ) ); |
||
| 373 | // To be removed in 1.27 |
||
| 374 | $result_array['modulemessages'] = []; |
||
| 375 | $this->setWarning( 'modulemessages is deprecated since MediaWiki 1.26' ); |
||
| 376 | } |
||
| 377 | |||
| 378 | if ( isset( $prop['jsconfigvars'] ) ) { |
||
| 379 | $result_array['jsconfigvars'] = |
||
| 380 | ApiResult::addMetadataToResultVars( $p_result->getJsConfigVars() ); |
||
| 381 | } |
||
| 382 | |||
| 383 | View Code Duplication | if ( isset( $prop['encodedjsconfigvars'] ) ) { |
|
| 384 | $result_array['encodedjsconfigvars'] = FormatJson::encode( |
||
| 385 | $p_result->getJsConfigVars(), false, FormatJson::ALL_OK |
||
| 386 | ); |
||
| 387 | $result_array[ApiResult::META_SUBELEMENTS][] = 'encodedjsconfigvars'; |
||
| 388 | } |
||
| 389 | |||
| 390 | View Code Duplication | if ( isset( $prop['modules'] ) && |
|
| 391 | !isset( $prop['jsconfigvars'] ) && !isset( $prop['encodedjsconfigvars'] ) ) { |
||
| 392 | $this->setWarning( 'Property "modules" was set but not "jsconfigvars" ' . |
||
| 393 | 'or "encodedjsconfigvars". Configuration variables are necessary ' . |
||
| 394 | 'for proper module usage.' ); |
||
| 395 | } |
||
| 396 | |||
| 397 | if ( isset( $prop['indicators'] ) ) { |
||
| 398 | $result_array['indicators'] = (array)$p_result->getIndicators(); |
||
| 399 | ApiResult::setArrayType( $result_array['indicators'], 'BCkvp', 'name' ); |
||
| 400 | } |
||
| 401 | |||
| 402 | if ( isset( $prop['iwlinks'] ) ) { |
||
| 403 | $result_array['iwlinks'] = $this->formatIWLinks( $p_result->getInterwikiLinks() ); |
||
| 404 | } |
||
| 405 | |||
| 406 | if ( isset( $prop['wikitext'] ) ) { |
||
| 407 | $result_array['wikitext'] = $this->content->serialize( $format ); |
||
| 408 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'wikitext'; |
||
| 409 | if ( !is_null( $this->pstContent ) ) { |
||
| 410 | $result_array['psttext'] = $this->pstContent->serialize( $format ); |
||
| 411 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'psttext'; |
||
| 412 | } |
||
| 413 | } |
||
| 414 | if ( isset( $prop['properties'] ) ) { |
||
| 415 | $result_array['properties'] = (array)$p_result->getProperties(); |
||
| 416 | ApiResult::setArrayType( $result_array['properties'], 'BCkvp', 'name' ); |
||
| 417 | } |
||
| 418 | |||
| 419 | if ( isset( $prop['limitreportdata'] ) ) { |
||
| 420 | $result_array['limitreportdata'] = |
||
| 421 | $this->formatLimitReportData( $p_result->getLimitReportData() ); |
||
| 422 | } |
||
| 423 | if ( isset( $prop['limitreporthtml'] ) ) { |
||
| 424 | $result_array['limitreporthtml'] = EditPage::getPreviewLimitReport( $p_result ); |
||
| 425 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'limitreporthtml'; |
||
| 426 | } |
||
| 427 | |||
| 428 | if ( isset( $prop['parsetree'] ) || $params['generatexml'] ) { |
||
| 429 | if ( $this->content->getModel() != CONTENT_MODEL_WIKITEXT ) { |
||
| 430 | $this->dieUsage( 'parsetree is only supported for wikitext content', 'notwikitext' ); |
||
| 431 | } |
||
| 432 | |||
| 433 | $wgParser->startExternalParse( $titleObj, $popts, Parser::OT_PREPROCESS ); |
||
| 434 | $dom = $wgParser->preprocessToDom( $this->content->getNativeData() ); |
||
| 435 | View Code Duplication | if ( is_callable( [ $dom, 'saveXML' ] ) ) { |
|
| 436 | $xml = $dom->saveXML(); |
||
| 437 | } else { |
||
| 438 | $xml = $dom->__toString(); |
||
| 439 | } |
||
| 440 | $result_array['parsetree'] = $xml; |
||
| 441 | $result_array[ApiResult::META_BC_SUBELEMENTS][] = 'parsetree'; |
||
| 442 | } |
||
| 443 | |||
| 444 | $result_mapping = [ |
||
| 445 | 'redirects' => 'r', |
||
| 446 | 'langlinks' => 'll', |
||
| 447 | 'categories' => 'cl', |
||
| 448 | 'links' => 'pl', |
||
| 449 | 'templates' => 'tl', |
||
| 450 | 'images' => 'img', |
||
| 451 | 'externallinks' => 'el', |
||
| 452 | 'iwlinks' => 'iw', |
||
| 453 | 'sections' => 's', |
||
| 454 | 'headitems' => 'hi', |
||
| 455 | 'modules' => 'm', |
||
| 456 | 'indicators' => 'ind', |
||
| 457 | 'modulescripts' => 'm', |
||
| 458 | 'modulestyles' => 'm', |
||
| 459 | 'modulemessages' => 'm', |
||
| 460 | 'properties' => 'pp', |
||
| 461 | 'limitreportdata' => 'lr', |
||
| 462 | ]; |
||
| 463 | $this->setIndexedTagNames( $result_array, $result_mapping ); |
||
| 464 | $result->addValue( null, $this->getModuleName(), $result_array ); |
||
| 465 | } |
||
| 466 | |||
| 838 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.