code: protected function getProperty($name, $legend)
      {
          foreach ($legend->getProperties() as $property) {
              if ($property->getName() === $name) {
                  return $property;
              }
          }
  
          $property = new Property($name);
          $legend->addProperty($property);
  
          return $property;
      }
docs: Retrieve a property from a legend or create a new one.
  
  @param string          $name   The legend name.
  
  @param LegendInterface $legend The legend instance.
  
  @return PropertyInterface