@@ -33,7 +33,7 @@ public function read(BeforeNodeReadEvent $event): void {
3333 try {
3434 $ node = $ event ->getNode ();
3535 $ params = [
36- 'id ' => $ node instanceof NonExistingFile ? null : $ node ->getId (),
36+ 'id ' => $ node instanceof NonExistingFile ? ' not-yet-assigned ' : $ node ->getId (),
3737 'path ' => $ node ->getPath (),
3838 ];
3939 } catch (InvalidPathException |NotFoundException $ e ) {
@@ -80,9 +80,10 @@ public function afterRename(NodeRenamedEvent $event): void {
8080 */
8181 public function create (NodeCreatedEvent $ event ): void {
8282 try {
83+ $ node = $ event ->getNode ();
8384 $ params = [
84- 'id ' => $ event -> getNode () ->getId (),
85- 'path ' => $ event -> getNode () ->getPath (),
85+ 'id ' => $ node ->getId (),
86+ 'path ' => $ node ->getPath (),
8687 ];
8788 } catch (InvalidPathException |NotFoundException $ e ) {
8889 Server::get (LoggerInterface::class)->error (
@@ -105,11 +106,13 @@ public function create(NodeCreatedEvent $event): void {
105106 */
106107 public function copy (NodeCopiedEvent $ event ): void {
107108 try {
109+ $ source = $ event ->getSource ();
110+ $ target = $ event ->getTarget ();
108111 $ params = [
109- 'oldid ' => $ event -> getSource () ->getId (),
110- 'newid ' => $ event -> getTarget () ->getId (),
111- 'oldpath ' => $ event -> getSource () ->getPath (),
112- 'newpath ' => $ event -> getTarget () ->getPath (),
112+ 'oldid ' => $ source ->getId (),
113+ 'newid ' => $ target ->getId (),
114+ 'oldpath ' => $ source ->getPath (),
115+ 'newpath ' => $ target ->getPath (),
113116 ];
114117 } catch (InvalidPathException |NotFoundException $ e ) {
115118 Server::get (LoggerInterface::class)->error (
@@ -128,8 +131,8 @@ public function copy(NodeCopiedEvent $event): void {
128131 * Logs writing of files
129132 */
130133 public function write (NodeWrittenEvent $ event ): void {
131- $ node = $ event ->getNode ();
132134 try {
135+ $ node = $ event ->getNode ();
133136 $ params = [
134137 'id ' => $ node ->getId (),
135138 'path ' => $ node ->getPath (),
@@ -156,9 +159,10 @@ public function write(NodeWrittenEvent $event): void {
156159 */
157160 public function delete (BeforeNodeDeletedEvent $ event ): void {
158161 try {
162+ $ node = $ event ->getNode ();
159163 $ params = [
160- 'id ' => $ event -> getNode () ->getId (),
161- 'path ' => $ event -> getNode () ->getPath (),
164+ 'id ' => $ node ->getId (),
165+ 'path ' => $ node ->getPath (),
162166 ];
163167 } catch (InvalidPathException |NotFoundException $ e ) {
164168 Server::get (LoggerInterface::class)->error (
0 commit comments