| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class EntityAddNotification extends Model |
||
| 13 | { |
||
| 14 | const MSG_DEFAULT = 'New notification event: «%snippet%»'; |
||
| 15 | const MSG_ADD_WALLPOST = 'New post on the wall: «%snippet%»'; |
||
| 16 | const MSG_ADD_WALLANSWER = 'New answer «%snippet%» for wall post «%post%»'; |
||
| 17 | const MSG_ADD_COMMENTANSWER = 'New answer «%snippet%» to your comment «%post%»'; |
||
| 18 | const MSG_ADD_FEEDBACKANSWER = 'New answer «%snippet%» to your feedback request «%post%»'; |
||
| 19 | |||
| 20 | private $_targetId; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * EntityAddNotification constructor. Pass target user_id inside the model |
||
| 24 | * @param bool $targetId |
||
| 25 | */ |
||
| 26 | public function __construct($targetId) |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Add notification for user |
||
| 34 | * @param string $uri |
||
| 35 | * @param string $msg |
||
| 36 | * @param array|null $vars |
||
| 37 | */ |
||
| 38 | public function add($uri, $msg = self::MSG_DEFAULT, array $vars = null) |
||
| 52 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.