| Conditions | 1 |
| Paths | 1 |
| Total Lines | 66 |
| Lines | 0 |
| Ratio | 0 % |
| 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 namespace XoopsModules\Smartobject; |
||
| 42 | public function __construct(\XoopsDatabase $db) |
||
| 43 | { |
||
| 44 | parent::__construct($db, Adsense::class, 'adsenseid', 'description', '', 'smartobject'); |
||
| 45 | $this->adFormats = []; |
||
| 46 | $this->adFormatsList = []; |
||
| 47 | |||
| 48 | $this->adFormats['728x90_as']['caption'] = '728 X 90 Leaderboard'; |
||
| 49 | $this->adFormats['728x90_as']['width'] = 728; |
||
| 50 | $this->adFormats['728x90_as']['height'] = 90; |
||
| 51 | $this->adFormatsList['728x90_as'] = $this->adFormats['728x90_as']['caption']; |
||
| 52 | |||
| 53 | $this->adFormats['468x60_as']['caption'] = '468 X 60 Banner'; |
||
| 54 | $this->adFormats['468x60_as']['width'] = 468; |
||
| 55 | $this->adFormats['468x60_as']['height'] = 60; |
||
| 56 | $this->adFormatsList['468x60_as'] = $this->adFormats['468x60_as']['caption']; |
||
| 57 | |||
| 58 | $this->adFormats['234x60_as']['caption'] = '234 X 60 Half Banner'; |
||
| 59 | $this->adFormats['234x60_as']['width'] = 234; |
||
| 60 | $this->adFormats['234x60_as']['height'] = 60; |
||
| 61 | $this->adFormatsList['234x60_as'] = $this->adFormats['234x60_as']['caption']; |
||
| 62 | |||
| 63 | $this->adFormats['120x600_as']['caption'] = '120 X 600 Skyscraper'; |
||
| 64 | $this->adFormats['120x600_as']['width'] = 120; |
||
| 65 | $this->adFormats['120x600_as']['height'] = 600; |
||
| 66 | $this->adFormatsList['120x600_as'] = $this->adFormats['120x600_as']['caption']; |
||
| 67 | |||
| 68 | $this->adFormats['160x600_as']['caption'] = '160 X 600 Wide Skyscraper'; |
||
| 69 | $this->adFormats['160x600_as']['width'] = 160; |
||
| 70 | $this->adFormats['160x600_as']['height'] = 600; |
||
| 71 | $this->adFormatsList['160x600_as'] = $this->adFormats['160x600_as']['caption']; |
||
| 72 | |||
| 73 | $this->adFormats['120x240_as']['caption'] = '120 X 240 Vertical Banner'; |
||
| 74 | $this->adFormats['120x240_as']['width'] = 120; |
||
| 75 | $this->adFormats['120x240_as']['height'] = 240; |
||
| 76 | $this->adFormatsList['120x240_as'] = $this->adFormats['120x240_as']['caption']; |
||
| 77 | |||
| 78 | $this->adFormats['336x280_as']['caption'] = '336 X 280 Large Rectangle'; |
||
| 79 | $this->adFormats['336x280_as']['width'] = 136; |
||
| 80 | $this->adFormats['336x280_as']['height'] = 280; |
||
| 81 | $this->adFormatsList['336x280_as'] = $this->adFormats['336x280_as']['caption']; |
||
| 82 | |||
| 83 | $this->adFormats['300x250_as']['caption'] = '300 X 250 Medium Rectangle'; |
||
| 84 | $this->adFormats['300x250_as']['width'] = 300; |
||
| 85 | $this->adFormats['300x250_as']['height'] = 250; |
||
| 86 | $this->adFormatsList['300x250_as'] = $this->adFormats['300x250_as']['caption']; |
||
| 87 | |||
| 88 | $this->adFormats['250x250_as']['caption'] = '250 X 250 Square'; |
||
| 89 | $this->adFormats['250x250_as']['width'] = 250; |
||
| 90 | $this->adFormats['250x250_as']['height'] = 250; |
||
| 91 | $this->adFormatsList['250x250_as'] = $this->adFormats['250x250_as']['caption']; |
||
| 92 | |||
| 93 | $this->adFormats['200x200_as']['caption'] = '200 X 200 Small Square'; |
||
| 94 | $this->adFormats['200x200_as']['width'] = 200; |
||
| 95 | $this->adFormats['200x200_as']['height'] = 200; |
||
| 96 | $this->adFormatsList['200x200_as'] = $this->adFormats['200x200_as']['caption']; |
||
| 97 | |||
| 98 | $this->adFormats['180x150_as']['caption'] = '180 X 150 Small Rectangle'; |
||
| 99 | $this->adFormats['180x150_as']['width'] = 180; |
||
| 100 | $this->adFormats['180x150_as']['height'] = 150; |
||
| 101 | $this->adFormatsList['180x150_as'] = $this->adFormats['180x150_as']['caption']; |
||
| 102 | |||
| 103 | $this->adFormats['125x125_as']['caption'] = '125 X 125 Button'; |
||
| 104 | $this->adFormats['125x125_as']['width'] = 125; |
||
| 105 | $this->adFormats['125x125_as']['height'] = 125; |
||
| 106 | $this->adFormatsList['125x125_as'] = $this->adFormats['125x125_as']['caption']; |
||
| 107 | } |
||
| 108 | |||
| 147 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..