Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2107

Debug::dump lists the wrong access level for some attributes

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Invalid
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Tools
    • Labels:
      None
    • Environment:
      Linux

      Description

      \Doctrine\Common\Util\Debug::dump() shows the wrong access level for some attributes. The below code reproduces the bug:

      \Doctrine\Common\Util\Debug::dump(
          new \Doctrine\ORM\Query\Expr\Select()
      );
      

      \Doctrine\ORM\Query\Expr\Select and \Doctrine\ORM\Query\Expr\Base define a bunch of protected class attributes, however, the Dump method fails to indicate their correct access level.

      Expected result:

      object(stdClass)[740]
        public '__CLASS__' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
        protected 'preSeparator' => string '' (length=0)
        protected 'postSeparator' => string '' (length=0)
        protected 'allowedClasses' => 
          array (size=1)
            0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
        protected 'separator' => string ', ' (length=2)
        protected 'parts' => 
          array (size=0)
            empty
      

      Actual result:

      object(stdClass)[740]
        public '__CLASS__' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
        public 'preSeparator' => string '' (length=0)
        public 'postSeparator' => string '' (length=0)
        public 'allowedClasses' => 
          array (size=1)
            0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
        public 'separator' => string ', ' (length=2)
        public 'parts' => 
          array (size=0)
            empty
      

        Activity

        George Zankevich created issue -
        Marco Pivetta made changes -
        Field Original Value New Value
        Description \Doctrine\Common\Util\Debug::dump() shows the wrong access level for some attributes. The below code reproduces the bug:

        \Doctrine\Common\Util\Debug::dump(
            new \Doctrine\ORM\Query\Expr\Select()
        );

        \Doctrine\ORM\Query\Expr\Select and \Doctrine\ORM\Query\Expr\Base define a bunch of protected class attributes, however, the Dump method fails to indicate their correct access level.

        Expected result:

        object(stdClass)[740]
          public '__CLASS__' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
          protected 'preSeparator' => string '' (length=0)
          protected 'postSeparator' => string '' (length=0)
          protected 'allowedClasses' =>
            array (size=1)
              0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
          protected 'separator' => string ', ' (length=2)
          protected 'parts' =>
            array (size=0)
              empty

        Actual result:


        object(stdClass)[740]
          public '__CLASS__' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
          public 'preSeparator' => string '' (length=0)
          public 'postSeparator' => string '' (length=0)
          public 'allowedClasses' =>
            array (size=1)
              0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
          public 'separator' => string ', ' (length=2)
          public 'parts' =>
            array (size=0)
              empty
        \Doctrine\Common\Util\Debug::dump() shows the wrong access level for some attributes. The below code reproduces the bug:

        {code}
        \Doctrine\Common\Util\Debug::dump(
            new \Doctrine\ORM\Query\Expr\Select()
        );
        {code}

        \Doctrine\ORM\Query\Expr\Select and \Doctrine\ORM\Query\Expr\Base define a bunch of protected class attributes, however, the Dump method fails to indicate their correct access level.

        Expected result:

        {code}
        object(stdClass)[740]
          public '__CLASS__' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
          protected 'preSeparator' => string '' (length=0)
          protected 'postSeparator' => string '' (length=0)
          protected 'allowedClasses' =>
            array (size=1)
              0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
          protected 'separator' => string ', ' (length=2)
          protected 'parts' =>
            array (size=0)
              empty
        {code}

        Actual result:

        {code}
        object(stdClass)[740]
          public '__CLASS__' => string 'Doctrine\ORM\Query\Expr\Select' (length=30)
          public 'preSeparator' => string '' (length=0)
          public 'postSeparator' => string '' (length=0)
          public 'allowedClasses' =>
            array (size=1)
              0 => string 'Doctrine\ORM\Query\Expr\Func' (length=28)
          public 'separator' => string ', ' (length=2)
          public 'parts' =>
            array (size=0)
              empty
        {code}
        Alexander made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Benjamin Eberlei [ beberlei ] Alexander [ asm89 ]
        Resolution Invalid [ 6 ]
        Marco Pivetta made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Assignee Alexander [ asm89 ] Benjamin Eberlei [ beberlei ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            George Zankevich
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: