@@ -53,10 +53,10 @@ public function it_generates_method_without_doc_block_if_typed(): void
53
53
$ method ->setReturnType ('void ' );
54
54
55
55
$ expectedOutput = <<<'EOF'
56
- <?php
57
-
58
- public function setType(?string $type) : void;
59
- EOF;
56
+ <?php
57
+
58
+ public function setType(?string $type) : void;
59
+ EOF;
60
60
61
61
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
62
62
}
@@ -71,13 +71,13 @@ public function it_generates_method_with_doc_block_if_typed(): void
71
71
$ method ->setReturnType ('array ' );
72
72
73
73
$ expectedOutput = <<<'EOF'
74
- <?php
75
-
76
- /**
77
- * @return Items[]
78
- */
79
- public function getItems() : array;
80
- EOF;
74
+ <?php
75
+
76
+ /**
77
+ * @return Items[]
78
+ */
79
+ public function getItems() : array;
80
+ EOF;
81
81
82
82
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
83
83
}
@@ -93,13 +93,13 @@ public function it_generates_method_with_overridden_doc_block(): void
93
93
$ method ->overrideDocBlock (new DocBlock ('Awesome ' ));
94
94
95
95
$ expectedOutput = <<<'EOF'
96
- <?php
97
-
98
- /**
99
- * Awesome
100
- */
101
- public function getItems() : array;
102
- EOF;
96
+ <?php
97
+
98
+ /**
99
+ * Awesome
100
+ */
101
+ public function getItems() : array;
102
+ EOF;
103
103
104
104
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
105
105
}
@@ -119,15 +119,15 @@ public function it_generates_method_with_doc_block_comment_if_typed(): void
119
119
$ method ->setDocBlockComment ('Sets an awesome type ' );
120
120
121
121
$ expectedOutput = <<<'EOF'
122
- <?php
123
-
124
- /**
125
- * Sets an awesome type
126
- *
127
- * @param string|null $type
128
- */
129
- public function setType(?string $type);
130
- EOF;
122
+ <?php
123
+
124
+ /**
125
+ * Sets an awesome type
126
+ *
127
+ * @param string|null $type
128
+ */
129
+ public function setType(?string $type);
130
+ EOF;
131
131
132
132
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
133
133
}
@@ -149,16 +149,16 @@ public function it_generates_method_with_doc_block_comment(): void
149
149
$ method ->setTyped (true );
150
150
151
151
$ expectedOutput = <<<'EOF'
152
- <?php
153
-
154
- /**
155
- * Sets an awesome type
156
- *
157
- * @param string|null $type
158
- * @return void
159
- */
160
- public function setType(?string $type) : void;
161
- EOF;
152
+ <?php
153
+
154
+ /**
155
+ * Sets an awesome type
156
+ *
157
+ * @param string|null $type
158
+ * @return void
159
+ */
160
+ public function setType(?string $type) : void;
161
+ EOF;
162
162
163
163
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
164
164
}
@@ -177,14 +177,14 @@ public function it_generates_method_with_mixed_type_doc_block(): void
177
177
$ method ->setReturnTypeDocBlockHint ('mixed ' );
178
178
179
179
$ expectedOutput = <<<'EOF'
180
- <?php
181
-
182
- /**
183
- * @param mixed $type
184
- * @return mixed
185
- */
186
- public function setType($type);
187
- EOF;
180
+ <?php
181
+
182
+ /**
183
+ * @param mixed $type
184
+ * @return mixed
185
+ */
186
+ public function setType($type);
187
+ EOF;
188
188
189
189
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
190
190
}
@@ -208,16 +208,16 @@ public function it_generates_method_with_array_type_doc_block(): void
208
208
$ method ->setDocBlockComment ('Sets awesome items ' );
209
209
210
210
$ expectedOutput = <<<'EOF'
211
- <?php
212
-
213
- /**
214
- * Sets awesome items
215
- *
216
- * @param array<string, \stdClass> $items
217
- * @return void
218
- */
219
- public function setItems(array $items) : void;
220
- EOF;
211
+ <?php
212
+
213
+ /**
214
+ * Sets awesome items
215
+ *
216
+ * @param array<string, \stdClass> $items
217
+ * @return void
218
+ */
219
+ public function setItems(array $items) : void;
220
+ EOF;
221
221
222
222
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
223
223
}
@@ -228,14 +228,14 @@ public function setItems(array $items) : void;
228
228
public function it_generates_method_with_long_doc_block (): void
229
229
{
230
230
$ docBlockComment = <<<'EOF'
231
- Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
232
- standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
233
- type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
234
- remaining essentially unchanged.
235
-
236
- It is a long established fact that a reader will be distracted by the readable content of a page when looking at
237
- its layout.
238
- EOF;
231
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
232
+ standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
233
+ type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
234
+ remaining essentially unchanged.
235
+
236
+ It is a long established fact that a reader will be distracted by the readable content of a page when looking at
237
+ its layout.
238
+ EOF;
239
239
240
240
$ method = new MethodGenerator (
241
241
'setType ' ,
@@ -247,22 +247,22 @@ public function it_generates_method_with_long_doc_block(): void
247
247
$ method ->setDocBlockComment ($ docBlockComment );
248
248
249
249
$ expectedOutput = <<<'EOF'
250
- <?php
251
-
252
- /**
253
- * Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
254
- * standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
255
- * type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
256
- * remaining essentially unchanged.
257
- *
258
- * It is a long established fact that a reader will be distracted by the readable content of a page when looking at
259
- * its layout.
260
- *
261
- * @param string $type
262
- * @param int|null $value
263
- */
264
- public function setType(string $type, ?int $value);
265
- EOF;
250
+ <?php
251
+
252
+ /**
253
+ * Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
254
+ * standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a
255
+ * type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
256
+ * remaining essentially unchanged.
257
+ *
258
+ * It is a long established fact that a reader will be distracted by the readable content of a page when looking at
259
+ * its layout.
260
+ *
261
+ * @param string $type
262
+ * @param int|null $value
263
+ */
264
+ public function setType(string $type, ?int $value);
265
+ EOF;
266
266
267
267
$ this ->assertSame ($ expectedOutput , $ this ->printer ->prettyPrintFile ([$ method ->generate ()]));
268
268
}
0 commit comments