Conditions | 1 |
Paths | 1 |
Total Lines | 98 |
Code Lines | 71 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 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 |
||
54 | public function getActorsWithDifferingInverseFunctionalIdentifiers() |
||
55 | { |
||
56 | return array( |
||
57 | 'agent-and-group' => array( |
||
58 | new Agent(), |
||
59 | new Group(), |
||
60 | ), |
||
61 | 'group-and-agent' => array( |
||
62 | new Group(), |
||
63 | new Agent(), |
||
64 | ), |
||
65 | 'agents-with-different-mboxes' => array( |
||
66 | new Agent('[email protected]'), |
||
67 | new Agent('[email protected]'), |
||
68 | ), |
||
69 | 'groups-with-different-mboxes' => array( |
||
70 | new Group('[email protected]'), |
||
71 | new Group('[email protected]'), |
||
72 | ), |
||
73 | 'agents-with-different-mbox-hashsums' => array( |
||
74 | new Agent(null, 'foo'), |
||
75 | new Agent(null, 'bar'), |
||
76 | ), |
||
77 | 'groups-with-different-mbox-hashsums' => array( |
||
78 | new Group(null, 'foo'), |
||
79 | new Group(null, 'bar'), |
||
80 | ), |
||
81 | 'agents-with-different-openids' => array( |
||
82 | new Agent(null, null, 'aaron.openid.example.org'), |
||
83 | new Agent(null, null, 'bob.openid.example.org'), |
||
84 | ), |
||
85 | 'groups-with-different-openids' => array( |
||
86 | new Group(null, null, 'aaron.openid.example.org'), |
||
87 | new Group(null, null, 'bob.openid.example.org'), |
||
88 | ), |
||
89 | 'agents-with-first-account-null' => array( |
||
90 | new Agent(null, null, null, null), |
||
91 | new Agent(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
92 | ), |
||
93 | 'agents-with-other-account-null' => array( |
||
94 | new Agent(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
95 | new Agent(null, null, null, null), |
||
96 | ), |
||
97 | 'groups-with-first-account-null' => array( |
||
98 | new Group(null, null, null, null), |
||
99 | new Group(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
100 | ), |
||
101 | 'groups-with-other-account-null' => array( |
||
102 | new Group(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
103 | new Group(null, null, null, null), |
||
104 | ), |
||
105 | 'agents-with-different-account-names' => array( |
||
106 | new Agent(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
107 | new Agent(null, null, null, new Account('another user account', 'http://example.com/bob')), |
||
108 | ), |
||
109 | 'agents-with-different-account-home-pages' => array( |
||
110 | new Agent(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
111 | new Agent(null, null, null, new Account('user account', 'http://example.com/christian')), |
||
112 | ), |
||
113 | 'groups-with-different-account-names' => array( |
||
114 | new Group(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
115 | new Group(null, null, null, new Account('another user account', 'http://example.com/bob')), |
||
116 | ), |
||
117 | 'groups-with-different-account-home-pages' => array( |
||
118 | new Group(null, null, null, new Account('user account', 'http://example.com/bob')), |
||
119 | new Group(null, null, null, new Account('user account', 'http://example.com/christian')), |
||
120 | ), |
||
121 | 'agents-with-different-names' => array( |
||
122 | new Agent(null, null, null, null, 'Christian'), |
||
123 | new Agent(null, null, null, null, 'Bob'), |
||
124 | ), |
||
125 | 'groups-with-different-names' => array( |
||
126 | new Group(null, null, null, null, 'Christian'), |
||
127 | new Group(null, null, null, null, 'Bob'), |
||
128 | ), |
||
129 | 'groups-with-different-number-of-members' => array( |
||
130 | new Group(null, null, null, null, null, array( |
||
131 | $this->createAgent1(), |
||
132 | $this->createAgent2(), |
||
133 | $this->createAgent3(), |
||
134 | )), |
||
135 | new Group(null, null, null, null, null, array( |
||
136 | $this->createAgent1(), |
||
137 | $this->createAgent3(), |
||
138 | )), |
||
139 | ), |
||
140 | 'groups-with-different-members' => array( |
||
141 | new Group(null, null, null, null, null, array( |
||
142 | $this->createAgent1(), |
||
143 | $this->createAgent2(), |
||
144 | )), |
||
145 | new Group(null, null, null, null, null, array( |
||
146 | $this->createAgent1(), |
||
147 | $this->createAgent3(), |
||
148 | )), |
||
149 | ), |
||
150 | ); |
||
151 | } |
||
152 | |||
178 |