Clean up array() syntax from docs, part VI
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderModule.php
index 43cf78b..2351efd 100644 (file)
@@ -486,9 +486,11 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                                        ]
                                );
 
-                               $dbw->onTransactionResolution( function () use ( &$scopeLock ) {
-                                       ScopedCallback::consume( $scopeLock ); // release after commit
-                               } );
+                               if ( $dbw->trxLevel() ) {
+                                       $dbw->onTransactionResolution( function () use ( &$scopeLock ) {
+                                               ScopedCallback::consume( $scopeLock ); // release after commit
+                                       } );
+                               }
                        }
                } catch ( Exception $e ) {
                        wfDebugLog( 'resourceloader', __METHOD__ . ": failed to update DB: $e" );
@@ -787,10 +789,10 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         *
         * @code
         *     $summary = parent::getDefinitionSummary( $context );
-        *     $summary[] = array(
+        *     $summary[] = [
         *         'foo' => 123,
         *         'bar' => 'quux',
-        *     );
+        *     ];
         *     return $summary;
         * @endcode
         *