original_string: private function getPropertyPath($propertyPath): PropertyPath
      {
          if ($propertyPath instanceof PropertyPathInterface) {
              // Don't call the copy constructor has it is not needed here
              return $propertyPath;
          }
  
          if (isset($this->propertyPathCache[$propertyPath])) {
              return $this->propertyPathCache[$propertyPath];
          }
  
          if ($this->cacheItemPool) {
              $item = $this->cacheItemPool->getItem(self::CACHE_PREFIX_PROPERTY_PATH.rawurlencode($propertyPath));
              if ($item->isHit()) {
                  return $this->propertyPathCache[$propertyPath] = $item->get();
              }
          }
  
          $propertyPathInstance = new PropertyPath($propertyPath);
          if (isset($item)) {
              $item->set($propertyPathInstance);
              $this->cacheItemPool->save($item);
          }
  
          return $this->propertyPathCache[$propertyPath] = $propertyPathInstance;
      }
code: private function getPropertyPath($propertyPath): PropertyPath
      {
          if ($propertyPath instanceof PropertyPathInterface) {
              // Don't call the copy constructor has it is not needed here
              return $propertyPath;
          }
  
          if (isset($this->propertyPathCache[$propertyPath])) {
              return $this->propertyPathCache[$propertyPath];
          }
  
          if ($this->cacheItemPool) {
              $item = $this->cacheItemPool->getItem(self::CACHE_PREFIX_PROPERTY_PATH.rawurlencode($propertyPath));
              if ($item->isHit()) {
                  return $this->propertyPathCache[$propertyPath] = $item->get();
              }
          }
  
          $propertyPathInstance = new PropertyPath($propertyPath);
          if (isset($item)) {
              $item->set($propertyPathInstance);
              $this->cacheItemPool->save($item);
          }
  
          return $this->propertyPathCache[$propertyPath] = $propertyPathInstance;
      }
code_tokens: private function getPropertyPath ( $ propertyPath ) : PropertyPath { if ( $ propertyPath instanceof PropertyPathInterface ) { // Don't call the copy constructor has it is not needed here return $ propertyPath ; } if ( isset ( $ this -> propertyPathCache [ $ propertyPath ] ) ) { return $ this -> propertyPathCache [ $ propertyPath ] ; } if ( $ this -> cacheItemPool ) { $ item = $ this -> cacheItemPool -> getItem ( self :: CACHE_PREFIX_PROPERTY_PATH . rawurlencode ( $ propertyPath ) ) ; if ( $ item -> isHit ( ) ) { return $ this -> propertyPathCache [ $ propertyPath ] = $ item -> get ( ) ; } } $ propertyPathInstance = new PropertyPath ( $ propertyPath ) ; if ( isset ( $ item ) ) { $ item -> set ( $ propertyPathInstance ) ; $ this -> cacheItemPool -> save ( $ item ) ; } return $ this -> propertyPathCache [ $ propertyPath ] = $ propertyPathInstance ; }
docstring: Gets a PropertyPath instance and caches it.
  
  @param string|PropertyPath $propertyPath
docstring_tokens: Gets a PropertyPath instance and caches it .