| Conditions | 1 |
| Paths | 1 |
| Total Lines | 134 |
| Code Lines | 125 |
| 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 |
||
| 19 | public function getExpectedColumns() |
||
| 20 | { |
||
| 21 | $columns = parent::getExpectedColumns(); |
||
| 22 | unset($columns['enum_col']); |
||
| 23 | $columns['int_col']['dbType'] = 'int4'; |
||
| 24 | $columns['int_col']['size'] = null; |
||
| 25 | $columns['int_col']['precision'] = 32; |
||
| 26 | $columns['int_col']['scale'] = 0; |
||
| 27 | $columns['int_col2']['dbType'] = 'int4'; |
||
| 28 | $columns['int_col2']['size'] = null; |
||
| 29 | $columns['int_col2']['precision'] = 32; |
||
| 30 | $columns['int_col2']['scale'] = 0; |
||
| 31 | $columns['tinyint_col']['type'] = 'smallint'; |
||
| 32 | $columns['tinyint_col']['dbType'] = 'int2'; |
||
| 33 | $columns['tinyint_col']['size'] = null; |
||
| 34 | $columns['tinyint_col']['precision'] = 16; |
||
| 35 | $columns['tinyint_col']['scale'] = 0; |
||
| 36 | $columns['smallint_col']['dbType'] = 'int2'; |
||
| 37 | $columns['smallint_col']['size'] = null; |
||
| 38 | $columns['smallint_col']['precision'] = 16; |
||
| 39 | $columns['smallint_col']['scale'] = 0; |
||
| 40 | $columns['char_col']['dbType'] = 'bpchar'; |
||
| 41 | $columns['char_col']['precision'] = null; |
||
| 42 | $columns['char_col2']['dbType'] = 'varchar'; |
||
| 43 | $columns['char_col2']['precision'] = null; |
||
| 44 | $columns['float_col']['dbType'] = 'float8'; |
||
| 45 | $columns['float_col']['precision'] = 53; |
||
| 46 | $columns['float_col']['scale'] = null; |
||
| 47 | $columns['float_col']['size'] = null; |
||
| 48 | $columns['float_col2']['dbType'] = 'float8'; |
||
| 49 | $columns['float_col2']['precision'] = 53; |
||
| 50 | $columns['float_col2']['scale'] = null; |
||
| 51 | $columns['float_col2']['size'] = null; |
||
| 52 | $columns['blob_col']['dbType'] = 'bytea'; |
||
| 53 | $columns['blob_col']['phpType'] = 'resource'; |
||
| 54 | $columns['blob_col']['type'] = 'binary'; |
||
| 55 | $columns['numeric_col']['dbType'] = 'numeric'; |
||
| 56 | $columns['numeric_col']['size'] = null; |
||
| 57 | $columns['bool_col']['type'] = 'boolean'; |
||
| 58 | $columns['bool_col']['phpType'] = 'boolean'; |
||
| 59 | $columns['bool_col']['dbType'] = 'bool'; |
||
| 60 | $columns['bool_col']['size'] = null; |
||
| 61 | $columns['bool_col']['precision'] = null; |
||
| 62 | $columns['bool_col']['scale'] = null; |
||
| 63 | $columns['bool_col2']['type'] = 'boolean'; |
||
| 64 | $columns['bool_col2']['phpType'] = 'boolean'; |
||
| 65 | $columns['bool_col2']['dbType'] = 'bool'; |
||
| 66 | $columns['bool_col2']['size'] = null; |
||
| 67 | $columns['bool_col2']['precision'] = null; |
||
| 68 | $columns['bool_col2']['scale'] = null; |
||
| 69 | $columns['bool_col2']['defaultValue'] = true; |
||
| 70 | $columns['ts_default']['defaultValue'] = new Expression('now()'); |
||
| 71 | $columns['bit_col']['dbType'] = 'bit'; |
||
| 72 | $columns['bit_col']['size'] = 8; |
||
| 73 | $columns['bit_col']['precision'] = null; |
||
| 74 | $columns['bigint_col'] = [ |
||
| 75 | 'type' => 'bigint', |
||
| 76 | 'dbType' => 'int8', |
||
| 77 | 'phpType' => 'integer', |
||
| 78 | 'allowNull' => true, |
||
| 79 | 'autoIncrement' => false, |
||
| 80 | 'enumValues' => null, |
||
| 81 | 'size' => null, |
||
| 82 | 'precision' => 64, |
||
| 83 | 'scale' => 0, |
||
| 84 | 'defaultValue' => null, |
||
| 85 | ]; |
||
| 86 | $columns['intarray_col'] = [ |
||
| 87 | 'type' => 'integer', |
||
| 88 | 'dbType' => 'int4', |
||
| 89 | 'phpType' => 'integer', |
||
| 90 | 'allowNull' => true, |
||
| 91 | 'autoIncrement' => false, |
||
| 92 | 'enumValues' => null, |
||
| 93 | 'size' => null, |
||
| 94 | 'precision' => null, |
||
| 95 | 'scale' => null, |
||
| 96 | 'defaultValue' => null, |
||
| 97 | 'dimension' => 1 |
||
| 98 | ]; |
||
| 99 | $columns['textarray2_col'] = [ |
||
| 100 | 'type' => 'text', |
||
| 101 | 'dbType' => 'text', |
||
| 102 | 'phpType' => 'string', |
||
| 103 | 'allowNull' => true, |
||
| 104 | 'autoIncrement' => false, |
||
| 105 | 'enumValues' => null, |
||
| 106 | 'size' => null, |
||
| 107 | 'precision' => null, |
||
| 108 | 'scale' => null, |
||
| 109 | 'defaultValue' => null, |
||
| 110 | 'dimension' => 2 |
||
| 111 | ]; |
||
| 112 | $columns['json_col'] = [ |
||
| 113 | 'type' => 'json', |
||
| 114 | 'dbType' => 'json', |
||
| 115 | 'phpType' => 'array', |
||
| 116 | 'allowNull' => true, |
||
| 117 | 'autoIncrement' => false, |
||
| 118 | 'enumValues' => null, |
||
| 119 | 'size' => null, |
||
| 120 | 'precision' => null, |
||
| 121 | 'scale' => null, |
||
| 122 | 'defaultValue' => ["a" => 1], |
||
| 123 | 'dimension' => 0 |
||
| 124 | ]; |
||
| 125 | $columns['jsonb_col'] = [ |
||
| 126 | 'type' => 'json', |
||
| 127 | 'dbType' => 'jsonb', |
||
| 128 | 'phpType' => 'array', |
||
| 129 | 'allowNull' => true, |
||
| 130 | 'autoIncrement' => false, |
||
| 131 | 'enumValues' => null, |
||
| 132 | 'size' => null, |
||
| 133 | 'precision' => null, |
||
| 134 | 'scale' => null, |
||
| 135 | 'defaultValue' => null, |
||
| 136 | 'dimension' => 0 |
||
| 137 | ]; |
||
| 138 | $columns['jsonarray_col'] = [ |
||
| 139 | 'type' => 'json', |
||
| 140 | 'dbType' => 'json', |
||
| 141 | 'phpType' => 'array', |
||
| 142 | 'allowNull' => true, |
||
| 143 | 'autoIncrement' => false, |
||
| 144 | 'enumValues' => null, |
||
| 145 | 'size' => null, |
||
| 146 | 'precision' => null, |
||
| 147 | 'scale' => null, |
||
| 148 | 'defaultValue' => null, |
||
| 149 | 'dimension' => 1 |
||
| 150 | ]; |
||
| 151 | |||
| 152 | return $columns; |
||
| 153 | } |
||
| 326 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths