PropertyAccess.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\PropertyAccess;
  11. /**
  12. * Entry point of the PropertyAccess component.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. final class PropertyAccess
  17. {
  18. /**
  19. * Creates a property accessor with the default configuration.
  20. *
  21. * @return PropertyAccessor
  22. */
  23. public static function createPropertyAccessor()
  24. {
  25. return self::createPropertyAccessorBuilder()->getPropertyAccessor();
  26. }
  27. /**
  28. * Creates a property accessor builder.
  29. *
  30. * @return PropertyAccessorBuilder
  31. */
  32. public static function createPropertyAccessorBuilder()
  33. {
  34. return new PropertyAccessorBuilder();
  35. }
  36. /**
  37. * Alias of {@link createPropertyAccessor}.
  38. *
  39. * @return PropertyAccessor
  40. *
  41. * @deprecated since version 2.3, to be removed in 3.0.
  42. * Use {@link createPropertyAccessor()} instead.
  43. */
  44. public static function getPropertyAccessor()
  45. {
  46. @trigger_error('The '.__METHOD__.' method is deprecated since Symfony 2.3 and will be removed in 3.0. Use the createPropertyAccessor() method instead.', E_USER_DEPRECATED);
  47. return self::createPropertyAccessor();
  48. }
  49. /**
  50. * This class cannot be instantiated.
  51. */
  52. private function __construct()
  53. {
  54. }
  55. }