src/BoomCMS/FileInfo/Drivers/Word.php
protected function readMetadata(): array
    {
        try {
            $phpWord = IOFactory::load($this->file->getPathname());
            $docinfo = $phpWord->getDocInfo();

            $attrs = [
                'creator'        => $docinfo->getCreator(),
                'created'        => $docinfo->getCreated(),
                'lastModifiedBy' => $docinfo->getLastModifiedBy(),
                'modified'       => $docinfo->getModified(),
                'title'          => $docinfo->getTitle(),
                'description'    => $docinfo->getDescription(),
                'subject'        => $docinfo->getSubject(),
                'keywords'       => $docinfo->getKeywords(),
                'category'       => $docinfo->getCategory(),
                'company'        => $docinfo->getCompany(),
                'manager'        => $docinfo->getManager(),
            ];

            foreach ($attrs as $key => $value) {
                if (empty($value)) {
                    unset($attrs[$key]);
                }
            }

            return $attrs;
        } catch (Exception $e) {
            return [];
        }
    }
protected function readMetadata(): array
    {
        try {
            $phpWord = IOFactory::load($this->file->getPathname());
            $docinfo = $phpWord->getDocInfo();

            $attrs = [
                'creator'        => $docinfo->getCreator(),
                'created'        => $docinfo->getCreated(),
                'lastModifiedBy' => $docinfo->getLastModifiedBy(),
                'modified'       => $docinfo->getModified(),
                'title'          => $docinfo->getTitle(),
                'description'    => $docinfo->getDescription(),
                'subject'        => $docinfo->getSubject(),
                'keywords'       => $docinfo->getKeywords(),
                'category'       => $docinfo->getCategory(),
                'company'        => $docinfo->getCompany(),
                'manager'        => $docinfo->getManager(),
            ];

            foreach ($attrs as $key => $value) {
                if (empty($value)) {
                    unset($attrs[$key]);
                }
            }

            return $attrs;
        } catch (Exception $e) {
            return [];
        }
    }
protected function readMetadata ( ) : array { try { $ phpWord = IOFactory :: load ( $ this -> file -> getPathname ( ) ) ; $ docinfo = $ phpWord -> getDocInfo ( ) ; $ attrs = [ 'creator' => $ docinfo -> getCreator ( ) , 'created' => $ docinfo -> getCreated ( ) , 'lastModifiedBy' => $ docinfo -> getLastModifiedBy ( ) , 'modified' => $ docinfo -> getModified ( ) , 'title' => $ docinfo -> getTitle ( ) , 'description' => $ docinfo -> getDescription ( ) , 'subject' => $ docinfo -> getSubject ( ) , 'keywords' => $ docinfo -> getKeywords ( ) , 'category' => $ docinfo -> getCategory ( ) , 'company' => $ docinfo -> getCompany ( ) , 'manager' => $ docinfo -> getManager ( ) , ] ; foreach ( $ attrs as $ key => $ value ) { if ( empty ( $ value ) ) { unset ( $ attrs [ $ key ] ) ; } } return $ attrs ; } catch ( Exception $ e ) { return [ ] ; } }
Retrieves metadata from the file and turns it into an array.

@return array
Retrieves metadata from the file and turns it into an array .