| 1 | <?php  | 
            ||
| 17 | class CdbXmlCreatedByToUserIdResolver implements LoggerAwareInterface, CreatedByToUserIdResolverInterface  | 
            ||
| 18 | { | 
            ||
| 19 | use LoggerAwareTrait;  | 
            ||
| 20 | |||
| 21 | /**  | 
            ||
| 22 | * @var UsersInterface  | 
            ||
| 23 | */  | 
            ||
| 24 | private $users;  | 
            ||
| 25 | |||
| 26 | /**  | 
            ||
| 27 | * @param UsersInterface $users  | 
            ||
| 28 | */  | 
            ||
| 29 | public function __construct(UsersInterface $users)  | 
            ||
| 34 | |||
| 35 | /**  | 
            ||
| 36 | * @inheritdoc  | 
            ||
| 37 | */  | 
            ||
| 38 | public function resolveCreatedByToUserId(String $createdByIdentifier)  | 
            ||
| 64 | |||
| 65 | /**  | 
            ||
| 66 | * @param String $createdByIdentifier  | 
            ||
| 67 | * @return String  | 
            ||
| 68 | */  | 
            ||
| 69 | private function resolveByEmailOrByNick(String $createdByIdentifier)  | 
            ||
| 80 | }  | 
            ||
| 81 | 
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: