no_php4_constructor.rst 774 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ============================
  2. Rule ``no_php4_constructor``
  3. ============================
  4. Convert PHP4-style constructors to ``__construct``.
  5. Warning
  6. -------
  7. Using this rule is risky
  8. ~~~~~~~~~~~~~~~~~~~~~~~~
  9. Risky when old style constructor being fixed is overridden or overrides parent
  10. one.
  11. Examples
  12. --------
  13. Example #1
  14. ~~~~~~~~~~
  15. .. code-block:: diff
  16. --- Original
  17. +++ New
  18. <?php
  19. class Foo
  20. {
  21. - public function Foo($bar)
  22. + public function __construct($bar)
  23. {
  24. }
  25. }
  26. Rule sets
  27. ---------
  28. The rule is part of the following rule sets:
  29. - `@PHP80Migration:risky <./../../ruleSets/PHP80MigrationRisky.rst>`_
  30. - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_
  31. - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_