Go to the documentation of this file.
26 use Wikimedia\Assert\Assert;
27 use Wikimedia\NonSerializable\NonSerializableTrait;
42 use NonSerializableTrait;
54 Assert::parameterType(
'array|callable',
$slots,
'$slots' );
56 if ( is_callable(
$slots ) ) {
67 Assert::parameterElementType( SlotRecord::class,
$slots,
'$slots' );
72 foreach (
$slots as $slot ) {
73 $role = $slot->getRole();
74 $this->slots[$role] = $slot;
95 return $this->
getSlot( $role )->getContent()->copy();
111 if ( isset(
$slots[$role] ) ) {
128 return isset(
$slots[$role] );
139 return array_keys(
$slots );
152 return $accu + $slot->
getSize();
166 if ( is_callable( $this->slots ) ) {
167 $slots = call_user_func( $this->slots );
169 Assert::postcondition(
171 'Slots info callback should return an array of objects'
201 return $accu ===
null
266 if ( $other === $this ) {
276 if ( array_keys( $aSlots ) !== array_keys( $bSlots ) ) {
280 foreach ( $aSlots as $role =>
$s ) {
283 if ( !
$s->hasSameContent(
$t ) ) {
301 if ( $other === $this ) {
311 $different = array_keys( array_merge(
312 array_diff_key( $aSlots, $bSlots ),
313 array_diff_key( $bSlots, $aSlots )
317 $common = array_intersect_key( $aSlots, $bSlots );
319 foreach ( $common as $role =>
$s ) {
322 if ( !
$s->hasSameContent(
$t ) ) {
323 $different[] = $role;
336 class_alias( RevisionSlots::class,
'MediaWiki\Storage\RevisionSlots' );
foreach( $mmfl['setupFiles'] as $fileName) if( $queue) if(empty( $mmfl['quiet'])) $s
Base interface for content objects.