diff --git a/components/property_access/introduction.rst b/components/property_access/introduction.rst index 2fabbf2119b..dfd457f7d4d 100644 --- a/components/property_access/introduction.rst +++ b/components/property_access/introduction.rst @@ -314,12 +314,13 @@ Checking Property Paths .. versionadded:: 2.5 The methods - :method:`PropertyAccessor::isReadable` + :method:`PropertyAccessor::isReadable ` and - :method:`PropertyAccessor::isWritable` - methods were added in Symfony 2.5. + :method:`PropertyAccessor::isWritable ` + methods were introduced in Symfony 2.5. -When you want to check whether :method:`PropertyAccessor::getValue` +When you want to check whether +:method:`PropertyAccessor::getValue` can safely be called without actually calling that method, you can use :method:`PropertyAccessor::isReadable` instead:: @@ -333,12 +334,11 @@ instead:: The same is possible for :method:`PropertyAccessor::setValue`: Call the :method:`PropertyAccessor::isWritable` -method to find out whether a property path can be updated. In the third -argument, you should pass the value that you want to write:: +method to find out whether a property path can be updated:: $person = new Person(); - if ($accessor->isWritable($person, 'firstName', 'Wouter') { + if ($accessor->isWritable($person, 'firstName') { // ... }