| Conditions | 1 |
| Paths | 1 |
| Total Lines | 61 |
| Code Lines | 48 |
| Lines | 0 |
| Ratio | 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 |
||
| 30 | public function snaksProvider() { |
||
| 31 | $argLists = array(); |
||
| 32 | |||
| 33 | $p23 = new PropertyId( 'p23' ); |
||
| 34 | $p42 = new PropertyId( 'p42' ); |
||
| 35 | $p44 = new PropertyId( 'p44' ); |
||
| 36 | $p404 = new PropertyId( 'P404' ); |
||
| 37 | |||
| 38 | $argLists['empty'] = array( |
||
| 39 | array(), |
||
| 40 | 'url', |
||
| 41 | array() ); |
||
| 42 | |||
| 43 | $argLists['PropertyNoValueSnak'] = array( |
||
| 44 | array( new PropertyNoValueSnak( $p42 ) ), |
||
| 45 | 'url', |
||
| 46 | array() ); |
||
| 47 | |||
| 48 | $argLists['PropertySomeValueSnak'] = array( |
||
| 49 | array( new PropertySomeValueSnak( $p42 ) ), |
||
| 50 | 'url', |
||
| 51 | array() ); |
||
| 52 | |||
| 53 | $argLists['PropertyValueSnak with string value and unknown data type'] = array( |
||
| 54 | array( new PropertyValueSnak( $p404, new StringValue( 'not an url' ) ) ), |
||
| 55 | 'url', |
||
| 56 | array() ); |
||
| 57 | |||
| 58 | $argLists['PropertyValueSnak with string value and wrong data type'] = array( |
||
| 59 | array( new PropertyValueSnak( $p23, new StringValue( 'not an url' ) ) ), |
||
| 60 | 'url', |
||
| 61 | array() ); |
||
| 62 | |||
| 63 | $argLists['PropertyValueSnak with string value and correct data type'] = array( |
||
| 64 | array( new PropertyValueSnak( $p42, new StringValue( 'http://acme.com/test' ) ) ), |
||
| 65 | 'url', |
||
| 66 | array( 'http://acme.com/test' ) ); |
||
| 67 | |||
| 68 | $argLists['PropertyValueSnak with boolean value'] = array( |
||
| 69 | array( new PropertyValueSnak( $p42, new BooleanValue( true ) ) ), |
||
| 70 | 'url', |
||
| 71 | array( true ) ); |
||
| 72 | |||
| 73 | $argLists['PropertyValueSnak with string values and correct data type'] = array( |
||
| 74 | array( new PropertyValueSnak( $p42, new StringValue( 'http://acme.com/test' ) ), |
||
| 75 | new PropertyValueSnak( $p42, new StringValue( 'http://foo.bar/' ) ) ), |
||
| 76 | 'url', |
||
| 77 | array( 'http://acme.com/test', 'http://foo.bar/' ) ); |
||
| 78 | |||
| 79 | $argLists['PropertyValueSnak with boolean value and correct data type'] = array( |
||
| 80 | array( new PropertyValueSnak( $p44, new BooleanValue( false ) ) ), |
||
| 81 | 'boolean', |
||
| 82 | array( false ) ); |
||
| 83 | |||
| 84 | $argLists['PropertyValueSnak with boolean value and wrong data type'] = array( |
||
| 85 | array( new PropertyValueSnak( $p44, new BooleanValue( false ) ) ), |
||
| 86 | 'url', |
||
| 87 | array() ); |
||
| 88 | |||
| 89 | return $argLists; |
||
| 90 | } |
||
| 91 | |||
| 165 |