Skip to content

Commit

Permalink
Small grammar fix
Browse files Browse the repository at this point in the history
The exception was reading 

```
A detached entity was found during {removed|persisted} [entityName] 
```

I changed the verbs to infinitive now. Alternatively, the text in ``ORMInvalidArgumentException::detachedEntityCannot`` could also be changed to read 


```
Detached entity [entityName] cannot be {removed|persisted}  
```
  • Loading branch information
flack authored and Ocramius committed Jul 14, 2014
1 parent 5361676 commit b8ef3af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ private function doPersist($entity, array &$visited)

case self::STATE_DETACHED:
// Can actually not happen right now since we assume STATE_NEW.
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persist");

default:
throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
Expand Down Expand Up @@ -1726,7 +1726,7 @@ private function doRemove($entity, array &$visited)
break;

case self::STATE_DETACHED:
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
throw ORMInvalidArgumentException::detachedEntityCannot($entity, "remove");
default:
throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
}
Expand Down

0 comments on commit b8ef3af

Please sign in to comment.