Skip to content

Commit c78c01b

Browse files
committed
deprecated setDocuments(), getDocuments() and addDocument() trigger E_USER_DEPRECATED
1 parent 436453b commit c78c01b

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,20 +367,23 @@ public function addComment($val)
367367
/** @deprecated */
368368
public function setDocuments(array $s)
369369
{
370+
trigger_error(__METHOD__ . '() is deprecated, use similar setComment()', E_USER_DEPRECATED);
370371
return $this->setComment(implode("\n", $s));
371372
}
372373

373374

374375
/** @deprecated */
375376
public function getDocuments()
376377
{
378+
trigger_error(__METHOD__ . '() is deprecated, use similar getComment()', E_USER_DEPRECATED);
377379
return $this->comment ? [$this->comment] : [];
378380
}
379381

380382

381383
/** @deprecated */
382384
public function addDocument($s)
383385
{
386+
trigger_error(__METHOD__ . '() is deprecated, use addComment()', E_USER_DEPRECATED);
384387
return $this->addComment($s);
385388
}
386389

src/PhpGenerator/Method.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,20 +409,23 @@ public function addComment($val)
409409
/** @deprecated */
410410
public function setDocuments(array $s)
411411
{
412+
trigger_error(__METHOD__ . '() is deprecated, use similar setComment()', E_USER_DEPRECATED);
412413
return $this->setComment(implode("\n", $s));
413414
}
414415

415416

416417
/** @deprecated */
417418
public function getDocuments()
418419
{
420+
trigger_error(__METHOD__ . '() is deprecated, use similar getComment()', E_USER_DEPRECATED);
419421
return $this->comment ? [$this->comment] : [];
420422
}
421423

422424

423425
/** @deprecated */
424426
public function addDocument($s)
425427
{
428+
trigger_error(__METHOD__ . '() is deprecated, use addComment()', E_USER_DEPRECATED);
426429
return $this->addComment($s);
427430
}
428431

src/PhpGenerator/PhpFile.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,23 @@ public function addComment($val)
6464
/** @deprecated */
6565
public function setDocuments(array $s)
6666
{
67+
trigger_error(__METHOD__ . '() is deprecated, use similar setComment()', E_USER_DEPRECATED);
6768
return $this->setComment(implode("\n", $s));
6869
}
6970

7071

7172
/** @deprecated */
7273
public function getDocuments()
7374
{
75+
trigger_error(__METHOD__ . '() is deprecated, use similar getComment()', E_USER_DEPRECATED);
7476
return $this->comment ? [$this->comment] : [];
7577
}
7678

7779

7880
/** @deprecated */
7981
public function addDocument($s)
8082
{
83+
trigger_error(__METHOD__ . '() is deprecated, use addComment()', E_USER_DEPRECATED);
8184
return $this->addComment($s);
8285
}
8386

src/PhpGenerator/Property.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,23 @@ public function addComment($val)
170170
/** @deprecated */
171171
public function setDocuments(array $s)
172172
{
173+
trigger_error(__METHOD__ . '() is deprecated, use similar setComment()', E_USER_DEPRECATED);
173174
return $this->setComment(implode("\n", $s));
174-
}
175+
}
175176

176177

177178
/** @deprecated */
178179
public function getDocuments()
179180
{
181+
trigger_error(__METHOD__ . '() is deprecated, use similar getComment()', E_USER_DEPRECATED);
180182
return $this->comment ? [$this->comment] : [];
181183
}
182184

183185

184186
/** @deprecated */
185187
public function addDocument($s)
186188
{
189+
trigger_error(__METHOD__ . '() is deprecated, use addComment()', E_USER_DEPRECATED);
187190
return $this->addComment($s);
188191
}
189192

0 commit comments

Comments
 (0)