Skip to content

Commit b67d768

Browse files
author
Amrouche Hamza
committed
[PropertyAccess] add more information to NoSuchPropertyException Message
1 parent e64cbe1 commit b67d768

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
//FIXME
34

45
/*
@@ -541,7 +542,7 @@ private function writeProperty($zval, $property, $value)
541542
} elseif (self::ACCESS_TYPE_MAGIC === $access[self::ACCESS_TYPE]) {
542543
$object->{$access[self::ACCESS_NAME]}($value);
543544
} elseif (self::ACCESS_TYPE_NOT_FOUND === $access[self::ACCESS_TYPE]) {
544-
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s".', $property, get_class($object)));
545+
throw new NoSuchPropertyException(sprintf('Could not determine access type for property "%s" in class "%s"%s.', $property, get_class($object), isset($access[self::ACCESS_NAME]) ? ': '.$access[self::ACCESS_NAME] : ''));
545546
} else {
546547
throw new NoSuchPropertyException($access[self::ACCESS_NAME]);
547548
}
@@ -589,7 +590,7 @@ private function writeCollection($zval, $property, $collection, $addMethod, $rem
589590
/**
590591
* Guesses how to write the property value.
591592
*
592-
* @param mixed $value
593+
* @param mixed $value
593594
*/
594595
private function getWriteAccessInfo(string $class, string $property, $value): array
595596
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy