2424class Plugin extends ServerPlugin {
2525 private Server $ server ;
2626
27+ public const LABEL = 'label ' ;
28+
29+ public const AUTHOR = 'author ' ;
30+
2731 public const VERSION_LABEL = '{http://nextcloud.org/ns}version-label ' ;
2832
2933 public const VERSION_AUTHOR = '{http://nextcloud.org/ns}version-author ' ; // dav property for author
@@ -76,8 +80,8 @@ public function afterGet(RequestInterface $request, ResponseInterface $response)
7680
7781 public function propFind (PropFind $ propFind , INode $ node ): void {
7882 if ($ node instanceof VersionFile) {
79- $ propFind ->handle (self ::VERSION_LABEL , fn () => $ node ->getMetadataValue (' label ' ));
80- $ propFind ->handle (self ::VERSION_AUTHOR , fn () => $ node ->getMetadataValue (' author ' ));
83+ $ propFind ->handle (self ::VERSION_LABEL , fn () => $ node ->getMetadataValue (self :: LABEL ));
84+ $ propFind ->handle (self ::VERSION_AUTHOR , fn () => $ node ->getMetadataValue (self :: AUTHOR ));
8185 $ propFind ->handle (FilesPlugin::HAS_PREVIEW_PROPERTYNAME , fn () => $ this ->previewManager ->isMimeSupported ($ node ->getContentType ()));
8286 }
8387 }
@@ -86,7 +90,7 @@ public function propPatch($path, PropPatch $propPatch): void {
8690 $ node = $ this ->server ->tree ->getNodeForPath ($ path );
8791
8892 if ($ node instanceof VersionFile) {
89- $ propPatch ->handle (self ::VERSION_LABEL , fn (string $ label ) => $ node ->setMetadataValue (' label ' , $ label ));
93+ $ propPatch ->handle (self ::VERSION_LABEL , fn (string $ label ) => $ node ->setMetadataValue (self :: LABEL , $ label ));
9094 }
9195 }
9296}
0 commit comments