Doctrine Common
  1. Doctrine Common
  2. DCOM-212

[GH-296] Proxies shouldn't serialize static properties in __sleep()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4, 2.4.1
    • Fix Version/s: 2.5.0
    • Component/s: None
    • Labels:

      Description

      This issue is created automatically through a Github pull request on behalf of mnapoli:

      Url: https://github.com/doctrine/common/pull/296

      Message:

      This PR contains a test and a fix for the following bug: Proxies did serialize static properties.

      I believe this is a regression in 2.4 since I've never met this bug before.

      Given the class:

      class StaticPropertyClass
      {
          protected static $protectedStaticProperty;
      }
      

      Before the fix, proxies would contain the following `__sleep` method:

          public function __sleep()
          {
              if ($this->__isInitialized__) {
                  return array('__isInitialized__', 'protectedStaticProperty');
              }
      
              return array('__isInitialized__', 'protectedStaticProperty');
          }
      

      With the fix:

          public function __sleep()
          {
              if ($this->__isInitialized__) {
                  return array('__isInitialized__');
              }
      
              return array('__isInitialized__');
          }
      

        Activity

        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-296] was closed:
        https://github.com/doctrine/common/pull/296

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-296] was closed: https://github.com/doctrine/common/pull/296
        Show
        Marco Pivetta added a comment - Merged: https://github.com/doctrine/common/commit/4233262c8a94b2f22189ce3e5972dae25aa6764b

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Doctrine Bot
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: