@@ -12,10 +12,10 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @return AbstractXliffParser |
| 14 | 14 | */ |
| 15 | - public static function getInstance( $xliffVersion, $xliffProprietary = null, LoggerInterface $logger = null ) { |
|
| 15 | + public static function getInstance($xliffVersion, $xliffProprietary = null, LoggerInterface $logger = null) { |
|
| 16 | 16 | $parserClass = 'Matecat\\XliffParser\\XliffParser\\XliffParserV' . $xliffVersion; |
| 17 | 17 | |
| 18 | 18 | /** @var AbstractXliffParser $parser */ |
| 19 | - return new $parserClass( $xliffVersion, $xliffProprietary, $logger ); |
|
| 19 | + return new $parserClass($xliffVersion, $xliffProprietary, $logger); |
|
| 20 | 20 | } |
| 21 | 21 | } |
@@ -16,33 +16,33 @@ discard block |
||
| 16 | 16 | * @inheritDoc |
| 17 | 17 | * @throws Exception |
| 18 | 18 | */ |
| 19 | - public function parse( DOMDocument $dom, $output = [] ) { |
|
| 19 | + public function parse(DOMDocument $dom, $output = []) { |
|
| 20 | 20 | $i = 1; |
| 21 | 21 | /** @var DOMElement $file */ |
| 22 | - foreach ( $dom->getElementsByTagName( 'file' ) as $file ) { |
|
| 22 | + foreach ($dom->getElementsByTagName('file') as $file) { |
|
| 23 | 23 | |
| 24 | 24 | // metadata |
| 25 | - $output[ 'files' ][ $i ][ 'attr' ] = $this->extractMetadata( $file ); |
|
| 25 | + $output['files'][$i]['attr'] = $this->extractMetadata($file); |
|
| 26 | 26 | |
| 27 | 27 | // reference |
| 28 | - if ( !empty( $this->extractReference( $file ) ) ) { |
|
| 29 | - $output[ 'files' ][ $i ][ 'reference' ] = $this->extractReference( $file ); |
|
| 28 | + if (!empty($this->extractReference($file))) { |
|
| 29 | + $output['files'][$i]['reference'] = $this->extractReference($file); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | // trans-units |
| 33 | 33 | $transUnitIdArrayForUniquenessCheck = []; |
| 34 | 34 | $j = 1; |
| 35 | - foreach ( $file->childNodes as $body ) { |
|
| 36 | - if ( $body->nodeName === 'body' ) { |
|
| 37 | - foreach ( $body->childNodes as $childNode ) { |
|
| 38 | - $this->extractTuFromNode( $childNode, $transUnitIdArrayForUniquenessCheck, $dom, $output, $i, $j ); |
|
| 35 | + foreach ($file->childNodes as $body) { |
|
| 36 | + if ($body->nodeName === 'body') { |
|
| 37 | + foreach ($body->childNodes as $childNode) { |
|
| 38 | + $this->extractTuFromNode($childNode, $transUnitIdArrayForUniquenessCheck, $dom, $output, $i, $j); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | // trans-unit re-count check |
| 42 | - $totalTransUnitsId = count( $transUnitIdArrayForUniquenessCheck ); |
|
| 43 | - $transUnitsUniqueId = count( array_unique( $transUnitIdArrayForUniquenessCheck ) ); |
|
| 44 | - if ( $totalTransUnitsId != $transUnitsUniqueId ) { |
|
| 45 | - throw new DuplicateTransUnitIdInXliff( "Invalid trans-unit id, duplicate found.", 400 ); |
|
| 42 | + $totalTransUnitsId = count($transUnitIdArrayForUniquenessCheck); |
|
| 43 | + $transUnitsUniqueId = count(array_unique($transUnitIdArrayForUniquenessCheck)); |
|
| 44 | + if ($totalTransUnitsId != $transUnitsUniqueId) { |
|
| 45 | + throw new DuplicateTransUnitIdInXliff("Invalid trans-unit id, duplicate found.", 400); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $i++; |
@@ -58,50 +58,50 @@ discard block |
||
| 58 | 58 | * |
| 59 | 59 | * @return array |
| 60 | 60 | */ |
| 61 | - private function extractMetadata( DOMElement $file ) { |
|
| 61 | + private function extractMetadata(DOMElement $file) { |
|
| 62 | 62 | $metadata = []; |
| 63 | 63 | $customAttr = []; |
| 64 | 64 | |
| 65 | 65 | /** @var DOMAttr $attribute */ |
| 66 | - foreach ( $file->attributes as $attribute ) { |
|
| 67 | - switch ( $attribute->localName ) { |
|
| 66 | + foreach ($file->attributes as $attribute) { |
|
| 67 | + switch ($attribute->localName) { |
|
| 68 | 68 | // original |
| 69 | 69 | case 'original': |
| 70 | - $metadata[ 'original' ] = $attribute->value; |
|
| 70 | + $metadata['original'] = $attribute->value; |
|
| 71 | 71 | break; |
| 72 | 72 | |
| 73 | 73 | // source-language |
| 74 | 74 | case 'source-language': |
| 75 | - $metadata[ 'source-language' ] = $attribute->value; |
|
| 75 | + $metadata['source-language'] = $attribute->value; |
|
| 76 | 76 | break; |
| 77 | 77 | |
| 78 | 78 | // data-type |
| 79 | 79 | case 'datatype': |
| 80 | - $metadata[ 'data-type' ] = $attribute->value; |
|
| 80 | + $metadata['data-type'] = $attribute->value; |
|
| 81 | 81 | break; |
| 82 | 82 | |
| 83 | 83 | // target-language |
| 84 | 84 | case 'target-language': |
| 85 | - $metadata[ 'target-language' ] = $attribute->value; |
|
| 85 | + $metadata['target-language'] = $attribute->value; |
|
| 86 | 86 | break; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | // Custom MateCat x-Attribute |
| 90 | - preg_match( '|x-(.*?)|si', $attribute->localName, $temp ); |
|
| 91 | - if ( isset( $temp[ 1 ] ) ) { |
|
| 92 | - $customAttr[ $attribute->localName ] = $attribute->value; |
|
| 90 | + preg_match('|x-(.*?)|si', $attribute->localName, $temp); |
|
| 91 | + if (isset($temp[1])) { |
|
| 92 | + $customAttr[$attribute->localName] = $attribute->value; |
|
| 93 | 93 | } |
| 94 | - unset( $temp ); |
|
| 94 | + unset($temp); |
|
| 95 | 95 | |
| 96 | 96 | // Custom MateCat namespace Attribute mtc: |
| 97 | - preg_match( '|mtc:(.*?)|si', $attribute->nodeName, $temp ); |
|
| 98 | - if ( isset( $temp[ 1 ] ) ) { |
|
| 99 | - $customAttr[ $attribute->nodeName ] = $attribute->value; |
|
| 97 | + preg_match('|mtc:(.*?)|si', $attribute->nodeName, $temp); |
|
| 98 | + if (isset($temp[1])) { |
|
| 99 | + $customAttr[$attribute->nodeName] = $attribute->value; |
|
| 100 | 100 | } |
| 101 | - unset( $temp ); |
|
| 101 | + unset($temp); |
|
| 102 | 102 | |
| 103 | - if ( !empty( $customAttr ) ) { |
|
| 104 | - $metadata[ 'custom' ] = $customAttr; |
|
| 103 | + if (!empty($customAttr)) { |
|
| 104 | + $metadata['custom'] = $customAttr; |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
@@ -113,16 +113,16 @@ discard block |
||
| 113 | 113 | * |
| 114 | 114 | * @return array |
| 115 | 115 | */ |
| 116 | - private function extractReference( DOMElement $file ) { |
|
| 116 | + private function extractReference(DOMElement $file) { |
|
| 117 | 117 | $reference = []; |
| 118 | 118 | |
| 119 | 119 | $order = 0; |
| 120 | - foreach ( $file->getElementsByTagName( 'reference' ) as $ref ) { |
|
| 120 | + foreach ($file->getElementsByTagName('reference') as $ref) { |
|
| 121 | 121 | /** @var DOMNode $childNode */ |
| 122 | - foreach ( $ref->childNodes as $childNode ) { |
|
| 123 | - if ( $childNode->nodeName === 'internal-file' ) { |
|
| 124 | - $reference[ $order ][ 'form-type' ] = $childNode->attributes->getNamedItem( 'form' )->nodeValue; |
|
| 125 | - $reference[ $order ][ 'base64' ] = trim( $childNode->nodeValue ); |
|
| 122 | + foreach ($ref->childNodes as $childNode) { |
|
| 123 | + if ($childNode->nodeName === 'internal-file') { |
|
| 124 | + $reference[$order]['form-type'] = $childNode->attributes->getNamedItem('form')->nodeValue; |
|
| 125 | + $reference[$order]['base64'] = trim($childNode->nodeValue); |
|
| 126 | 126 | $order++; |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -143,53 +143,53 @@ discard block |
||
| 143 | 143 | * |
| 144 | 144 | * @throws Exception |
| 145 | 145 | */ |
| 146 | - protected function extractTransUnit( $transUnit, &$transUnitIdArrayForUniquenessCheck, $dom, &$output, &$i, &$j ) { |
|
| 146 | + protected function extractTransUnit($transUnit, &$transUnitIdArrayForUniquenessCheck, $dom, &$output, &$i, &$j) { |
|
| 147 | 147 | // metadata |
| 148 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'attr' ] = $this->extractTransUnitMetadata( $transUnit, $transUnitIdArrayForUniquenessCheck ); |
|
| 148 | + $output['files'][$i]['trans-units'][$j]['attr'] = $this->extractTransUnitMetadata($transUnit, $transUnitIdArrayForUniquenessCheck); |
|
| 149 | 149 | |
| 150 | 150 | // notes |
| 151 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'notes' ] = $this->extractTransUnitNotes( $dom, $transUnit ); |
|
| 151 | + $output['files'][$i]['trans-units'][$j]['notes'] = $this->extractTransUnitNotes($dom, $transUnit); |
|
| 152 | 152 | |
| 153 | 153 | // content |
| 154 | 154 | /** @var DOMElement $childNode */ |
| 155 | - foreach ( $transUnit->childNodes as $childNode ) { |
|
| 155 | + foreach ($transUnit->childNodes as $childNode) { |
|
| 156 | 156 | // source |
| 157 | - if ( $childNode->nodeName === 'source' ) { |
|
| 158 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'source' ] = $this->extractContent( $dom, $childNode ); |
|
| 157 | + if ($childNode->nodeName === 'source') { |
|
| 158 | + $output['files'][$i]['trans-units'][$j]['source'] = $this->extractContent($dom, $childNode); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | // seg-source |
| 162 | - if ( $childNode->nodeName === 'seg-source' ) { |
|
| 163 | - $rawSegment = $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'source' ][ 'raw-content' ]; |
|
| 164 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'seg-source' ] = $this->extractContentWithMarksAndExtTags( $dom, $childNode, $rawSegment ); |
|
| 162 | + if ($childNode->nodeName === 'seg-source') { |
|
| 163 | + $rawSegment = $output['files'][$i]['trans-units'][$j]['source']['raw-content']; |
|
| 164 | + $output['files'][$i]['trans-units'][$j]['seg-source'] = $this->extractContentWithMarksAndExtTags($dom, $childNode, $rawSegment); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // target |
| 168 | - if ( $childNode->nodeName === 'target' ) { |
|
| 169 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'target' ] = $this->extractContent( $dom, $childNode ); |
|
| 168 | + if ($childNode->nodeName === 'target') { |
|
| 169 | + $output['files'][$i]['trans-units'][$j]['target'] = $this->extractContent($dom, $childNode); |
|
| 170 | 170 | |
| 171 | 171 | // seg-target |
| 172 | - $targetRawContent = @$output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'target' ][ 'raw-content' ]; |
|
| 173 | - $segSource = @$output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'seg-source' ]; |
|
| 174 | - if ( isset( $targetRawContent ) && !empty( $targetRawContent ) && isset( $segSource ) && count( $segSource ) > 0 ) { |
|
| 175 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'seg-target' ] = $this->extractContentWithMarksAndExtTags( $dom, $childNode, $targetRawContent ); |
|
| 172 | + $targetRawContent = @$output['files'][$i]['trans-units'][$j]['target']['raw-content']; |
|
| 173 | + $segSource = @$output['files'][$i]['trans-units'][$j]['seg-source']; |
|
| 174 | + if (isset($targetRawContent) && !empty($targetRawContent) && isset($segSource) && count($segSource) > 0) { |
|
| 175 | + $output['files'][$i]['trans-units'][$j]['seg-target'] = $this->extractContentWithMarksAndExtTags($dom, $childNode, $targetRawContent); |
|
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | // locked |
| 180 | - if ( $childNode->nodeName === 'sdl:seg' ) { |
|
| 181 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'locked' ] = $this->extractLocked( $childNode ); |
|
| 180 | + if ($childNode->nodeName === 'sdl:seg') { |
|
| 181 | + $output['files'][$i]['trans-units'][$j]['locked'] = $this->extractLocked($childNode); |
|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | // context-group |
| 186 | - foreach ( $transUnit->getElementsByTagName( 'context-group' ) as $contextGroup ) { |
|
| 187 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'context-group' ][] = $this->extractTransUnitContextGroup( $dom, $contextGroup ); |
|
| 186 | + foreach ($transUnit->getElementsByTagName('context-group') as $contextGroup) { |
|
| 187 | + $output['files'][$i]['trans-units'][$j]['context-group'][] = $this->extractTransUnitContextGroup($dom, $contextGroup); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | // alt-trans |
| 191 | - foreach ( $transUnit->getElementsByTagName( 'alt-trans' ) as $altTrans ) { |
|
| 192 | - $output[ 'files' ][ $i ][ 'trans-units' ][ $j ][ 'alt-trans' ][] = $this->extractTransUnitAltTrans( $altTrans ); |
|
| 191 | + foreach ($transUnit->getElementsByTagName('alt-trans') as $altTrans) { |
|
| 192 | + $output['files'][$i]['trans-units'][$j]['alt-trans'][] = $this->extractTransUnitAltTrans($altTrans); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | $j++; |
@@ -202,42 +202,42 @@ discard block |
||
| 202 | 202 | * @return array |
| 203 | 203 | * @throws Exception |
| 204 | 204 | */ |
| 205 | - private function extractTransUnitMetadata( DOMElement $transUnit, array &$transUnitIdArrayForUniquenessCheck ) { |
|
| 205 | + private function extractTransUnitMetadata(DOMElement $transUnit, array &$transUnitIdArrayForUniquenessCheck) { |
|
| 206 | 206 | $metadata = []; |
| 207 | 207 | |
| 208 | 208 | // id MUST NOT be null |
| 209 | - if ( null === $transUnit->attributes->getNamedItem( 'id' ) ) { |
|
| 210 | - throw new NotFoundIdInTransUnit( 'Invalid trans-unit id found. EMPTY value', 400 ); |
|
| 209 | + if (null === $transUnit->attributes->getNamedItem('id')) { |
|
| 210 | + throw new NotFoundIdInTransUnit('Invalid trans-unit id found. EMPTY value', 400); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
| 214 | 214 | * @var string $key |
| 215 | 215 | * @var DOMAttr $element |
| 216 | 216 | */ |
| 217 | - foreach ( $transUnit->attributes as $key => $element ) { |
|
| 217 | + foreach ($transUnit->attributes as $key => $element) { |
|
| 218 | 218 | |
| 219 | - if ( $element->nodeName === "id" ) { |
|
| 219 | + if ($element->nodeName === "id") { |
|
| 220 | 220 | |
| 221 | 221 | $id = $element->nodeValue; |
| 222 | 222 | |
| 223 | - if ( strlen( $id ) > 100 ) { |
|
| 224 | - throw new SegmentIdTooLongException( 'Segment-id too long. Max 100 characters allowed', 400 ); |
|
| 223 | + if (strlen($id) > 100) { |
|
| 224 | + throw new SegmentIdTooLongException('Segment-id too long. Max 100 characters allowed', 400); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | $transUnitIdArrayForUniquenessCheck[] = $id; |
| 228 | - $metadata[ 'id' ] = $id; |
|
| 228 | + $metadata['id'] = $id; |
|
| 229 | 229 | |
| 230 | - } elseif ( $element->nodeName === "approved" ) { |
|
| 230 | + } elseif ($element->nodeName === "approved") { |
|
| 231 | 231 | // approved as BOOLEAN |
| 232 | 232 | // http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#approved |
| 233 | - $metadata[ $element->nodeName ] = filter_var( $element->nodeValue, FILTER_VALIDATE_BOOLEAN ); |
|
| 234 | - } elseif ( $element->nodeName === "maxwidth" ) { |
|
| 233 | + $metadata[$element->nodeName] = filter_var($element->nodeValue, FILTER_VALIDATE_BOOLEAN); |
|
| 234 | + } elseif ($element->nodeName === "maxwidth") { |
|
| 235 | 235 | // we ignore ( but we get ) the attribute size-unit="char" assuming that a restriction is everytime done by character |
| 236 | 236 | // we duplicate the info to allow Xliff V1 and V2 to work the same |
| 237 | - $metadata[ 'sizeRestriction' ] = filter_var( $element->nodeValue, FILTER_SANITIZE_NUMBER_INT ); |
|
| 238 | - $metadata[ $element->nodeName ] = filter_var( $element->nodeValue, FILTER_SANITIZE_NUMBER_INT ); |
|
| 237 | + $metadata['sizeRestriction'] = filter_var($element->nodeValue, FILTER_SANITIZE_NUMBER_INT); |
|
| 238 | + $metadata[$element->nodeName] = filter_var($element->nodeValue, FILTER_SANITIZE_NUMBER_INT); |
|
| 239 | 239 | } else { |
| 240 | - $metadata[ $element->nodeName ] = $element->nodeValue; |
|
| 240 | + $metadata[$element->nodeName] = $element->nodeValue; |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | } |
@@ -251,19 +251,19 @@ discard block |
||
| 251 | 251 | * @return array |
| 252 | 252 | * @throws Exception |
| 253 | 253 | */ |
| 254 | - private function extractTransUnitNotes( DOMDocument $dom, DOMElement $transUnit ) { |
|
| 254 | + private function extractTransUnitNotes(DOMDocument $dom, DOMElement $transUnit) { |
|
| 255 | 255 | $notes = []; |
| 256 | - foreach ( $transUnit->getElementsByTagName( 'note' ) as $note ) { |
|
| 256 | + foreach ($transUnit->getElementsByTagName('note') as $note) { |
|
| 257 | 257 | |
| 258 | - $noteValue = $this->extractTagContent( $dom, $note ); |
|
| 258 | + $noteValue = $this->extractTagContent($dom, $note); |
|
| 259 | 259 | |
| 260 | - if ( '' !== $noteValue ) { |
|
| 260 | + if ('' !== $noteValue) { |
|
| 261 | 261 | |
| 262 | - $extractedNote = $this->JSONOrRawContentArray( $noteValue ); |
|
| 262 | + $extractedNote = $this->JSONOrRawContentArray($noteValue); |
|
| 263 | 263 | |
| 264 | 264 | // extract all the attributes |
| 265 | - foreach ( $note->attributes as $attribute ) { |
|
| 266 | - $extractedNote[ $attribute->name ] = $attribute->value; |
|
| 265 | + foreach ($note->attributes as $attribute) { |
|
| 266 | + $extractedNote[$attribute->name] = $attribute->value; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | $notes[] = $extractedNote; |
@@ -278,14 +278,14 @@ discard block |
||
| 278 | 278 | * |
| 279 | 279 | * @return array |
| 280 | 280 | */ |
| 281 | - private function extractTransUnitContextGroup( DOMDocument $dom, DOMElement $contextGroup ) { |
|
| 281 | + private function extractTransUnitContextGroup(DOMDocument $dom, DOMElement $contextGroup) { |
|
| 282 | 282 | $cg = []; |
| 283 | - $cg[ 'attr' ] = $this->extractTagAttributes( $contextGroup ); |
|
| 283 | + $cg['attr'] = $this->extractTagAttributes($contextGroup); |
|
| 284 | 284 | |
| 285 | 285 | /** @var DOMNode $context */ |
| 286 | - foreach ( $contextGroup->childNodes as $context ) { |
|
| 287 | - if ( $context->nodeName === 'context' ) { |
|
| 288 | - $cg[ 'contexts' ][] = $this->extractContent( $dom, $context ); |
|
| 286 | + foreach ($contextGroup->childNodes as $context) { |
|
| 287 | + if ($context->nodeName === 'context') { |
|
| 288 | + $cg['contexts'][] = $this->extractContent($dom, $context); |
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
@@ -297,16 +297,16 @@ discard block |
||
| 297 | 297 | * |
| 298 | 298 | * @return array |
| 299 | 299 | */ |
| 300 | - private function extractTransUnitAltTrans( DOMElement $altTrans ) { |
|
| 300 | + private function extractTransUnitAltTrans(DOMElement $altTrans) { |
|
| 301 | 301 | $at = []; |
| 302 | - $at[ 'attr' ] = $this->extractTagAttributes( $altTrans ); |
|
| 302 | + $at['attr'] = $this->extractTagAttributes($altTrans); |
|
| 303 | 303 | |
| 304 | - if ( $altTrans->getElementsByTagName( 'source' )->length > 0 ) { |
|
| 305 | - $at[ 'source' ] = $altTrans->getElementsByTagName( 'source' )->item( 0 )->nodeValue; |
|
| 304 | + if ($altTrans->getElementsByTagName('source')->length > 0) { |
|
| 305 | + $at['source'] = $altTrans->getElementsByTagName('source')->item(0)->nodeValue; |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | - if ( $altTrans->getElementsByTagName( 'target' ) ) { |
|
| 309 | - $at[ 'target' ] = $altTrans->getElementsByTagName( 'target' )->item( 0 )->nodeValue; |
|
| 308 | + if ($altTrans->getElementsByTagName('target')) { |
|
| 309 | + $at['target'] = $altTrans->getElementsByTagName('target')->item(0)->nodeValue; |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | return $at; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * |
| 318 | 318 | * @return bool |
| 319 | 319 | */ |
| 320 | - private function extractLocked( DOMElement $locked ) { |
|
| 321 | - return null !== $locked->getAttribute( 'locked' ); |
|
| 320 | + private function extractLocked(DOMElement $locked) { |
|
| 321 | + return null !== $locked->getAttribute('locked'); |
|
| 322 | 322 | } |
| 323 | 323 | } |