Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-536

Remove the _ prefix from private and protected members

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      The reasoning is simple: The prefix "_" is usually either used for easier distinction of instance variables from other, i.e. local variables, instead of always using "this." (often seen in C#), or it is used to signal that a member is not meant to be accessed from outside of the class when the language does not have visibility modifiers (PHP4).

      Since you always have to use "$this->" in PHP5+ when accessing instance members and there are visibility modifiers, the "_" is largely superfluous and just makes the verbose OO code even more verbose.

      Maybe the following find/replace steps will do the job almost completely:

      "private $_" => "private $"
      "protected $_" => "protected $"
      "$this->_" => "$this->"
      

        Activity

        Roman S. Borschel created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Workflow jira [ 11261 ] jira-feedback [ 13848 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 13848 ] jira-feedback2 [ 15712 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 15712 ] jira-feedback3 [ 17969 ]
        Guilherme Blanco made changes -
        Assignee Roman S. Borschel [ romanb ] Guilherme Blanco [ guilhermeblanco ]
        Fix Version/s 3.0 [ 10129 ]
        Fix Version/s 2.0 [ 10021 ]
        Guilherme Blanco made changes -
        Issue Type Task [ 3 ] Improvement [ 4 ]

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Roman S. Borschel
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: