22
33namespace Netgen \Bundle \EnhancedBinaryFileBundle \FieldHandler ;
44
5+ use DOMDocument ;
56use eZ \Publish \API \Repository \Values \ContentType \FieldDefinition ;
67use eZ \Publish \Core \FieldType \Value ;
7- use Netgen \Bundle \EnhancedBinaryFileBundle \Core \FieldType \EnhancedBinaryFile \Value as EnhancedBinaryFileValue ;
88use eZ \Publish \Core \IO \IOServiceInterface ;
9+ use Netgen \Bundle \EnhancedBinaryFileBundle \Core \FieldType \EnhancedBinaryFile \Value as EnhancedBinaryFileValue ;
910use Netgen \Bundle \InformationCollectionBundle \FieldHandler \Custom \CustomLegacyFieldHandlerInterface ;
1011use Netgen \Bundle \InformationCollectionBundle \Value \LegacyData ;
11- use DOMDocument ;
1212
1313class EnhancedBinaryFileHandler implements CustomLegacyFieldHandlerInterface
1414{
@@ -28,23 +28,23 @@ public function __construct(IOServiceInterface $IOService)
2828 }
2929
3030 /**
31- * @inheritDoc
31+ * {@inheritdoc}
3232 */
3333 public function supports (Value $ value )
3434 {
3535 return $ value instanceof EnhancedBinaryFileValue;
3636 }
3737
3838 /**
39- * @inheritDoc
39+ * {@inheritdoc}
4040 */
4141 public function toString (Value $ value , FieldDefinition $ fieldDefinition )
4242 {
43- return (string )$ value ;
43+ return (string ) $ value ;
4444 }
4545
4646 /**
47- * @inheritDoc
47+ * {@inheritdoc}
4848 */
4949 public function getLegacyValue (Value $ value , FieldDefinition $ fieldDefinition )
5050 {
@@ -58,7 +58,7 @@ public function getLegacyValue(Value $value, FieldDefinition $fieldDefinition)
5858
5959 /**
6060 * Create XML doc string
61- * and save file to filesystem
61+ * and save file to filesystem.
6262 *
6363 * @param EnhancedBinaryFileValue $value
6464 * @param FieldDefinition $fieldDefinition
@@ -69,19 +69,19 @@ protected function store(EnhancedBinaryFileValue $value, FieldDefinition $fieldD
6969 {
7070 $ binaryFile = $ this ->storeBinaryFileToPath ($ value );
7171
72- $ doc = new DOMDocument ( '1.0 ' , 'utf-8 ' );
73- $ root = $ doc ->createElement ( 'binaryfile-info ' );
74- $ binaryFileList = $ doc ->createElement ( 'binaryfile-attributes ' );
72+ $ doc = new DOMDocument ('1.0 ' , 'utf-8 ' );
73+ $ root = $ doc ->createElement ('binaryfile-info ' );
74+ $ binaryFileList = $ doc ->createElement ('binaryfile-attributes ' );
7575
7676 $ fileInfo = [
7777 'Filename ' => htmlentities ($ binaryFile ->uri ),
7878 'OriginalFilename ' => htmlentities ($ value ->fileName ),
7979 'Size ' => $ value ->fileSize ,
8080 ];
8181
82- foreach ($ fileInfo as $ key => $ binaryFileItem ) {
82+ foreach ($ fileInfo as $ key => $ binaryFileItem ) {
8383 $ binaryFileElement = $ doc ->createElement ($ key , $ binaryFileItem );
84- $ binaryFileList ->appendChild ( $ binaryFileElement );
84+ $ binaryFileList ->appendChild ($ binaryFileElement );
8585 }
8686
8787 $ root ->appendChild ($ binaryFileList );
@@ -91,7 +91,7 @@ protected function store(EnhancedBinaryFileValue $value, FieldDefinition $fieldD
9191 }
9292
9393 /**
94- * Stores file to filesystem
94+ * Stores file to filesystem.
9595 *
9696 * @param EnhancedBinaryFileValue $value
9797 * @param string $storagePrefix
@@ -110,5 +110,3 @@ protected function storeBinaryFileToPath(EnhancedBinaryFileValue $value, $storag
110110 return $ binaryFile ;
111111 }
112112}
113-
114-
0 commit comments