XBRL.php
private function arcAttrbutesAreEquivalent( $attributes1, $attributes2 )
	{
		$array1Keys = array_keys( $attributes1 );
		$array2Keys = array_keys( $attributes2 );

		// Look for mismatched attributes
		if ( array_diff( $array1Keys, $array2Keys ) || array_diff( $array2Keys, $array1Keys ) ) return false;

		foreach ( $attributes1 as $type => $attribute )
		{
			if ( ! isset( $attributes2[ $type ] ) ) return false;
			$typePrefix1 = $this->context->types->getPrefixForNamespace( $attribute['namespace'] );
			$xequalType1 = XBRL_Equality::xequalAttributeType( $this->context->types, $attribute['name'], $typePrefix1 );
			$typePrefix2 = $this->context->types->getPrefixForNamespace( $attributes2[ $type ]['namespace'] );
			$xequalType2 = XBRL_Equality::xequalAttributeType( $this->context->types, $attributes2[ $type ]['name'], $typePrefix2 );

			if ( ! XBRL_Equality::xequal( $attribute['value'], $attributes2[ $type ]['value'], $xequalType1, $xequalType2 ) )
			{
				return false;
			}
		}

		return true;
	}
private function arcAttrbutesAreEquivalent( $attributes1, $attributes2 )
	{
		$array1Keys = array_keys( $attributes1 );
		$array2Keys = array_keys( $attributes2 );

		// Look for mismatched attributes
		if ( array_diff( $array1Keys, $array2Keys ) || array_diff( $array2Keys, $array1Keys ) ) return false;

		foreach ( $attributes1 as $type => $attribute )
		{
			if ( ! isset( $attributes2[ $type ] ) ) return false;
			$typePrefix1 = $this->context->types->getPrefixForNamespace( $attribute['namespace'] );
			$xequalType1 = XBRL_Equality::xequalAttributeType( $this->context->types, $attribute['name'], $typePrefix1 );
			$typePrefix2 = $this->context->types->getPrefixForNamespace( $attributes2[ $type ]['namespace'] );
			$xequalType2 = XBRL_Equality::xequalAttributeType( $this->context->types, $attributes2[ $type ]['name'], $typePrefix2 );

			if ( ! XBRL_Equality::xequal( $attribute['value'], $attributes2[ $type ]['value'], $xequalType1, $xequalType2 ) )
			{
				return false;
			}
		}

		return true;
	}
private function arcAttrbutesAreEquivalent ( $ attributes1 , $ attributes2 ) { $ array1Keys = array_keys ( $ attributes1 ) ; $ array2Keys = array_keys ( $ attributes2 ) ; // Look for mismatched attributes
 if ( array_diff ( $ array1Keys , $ array2Keys ) || array_diff ( $ array2Keys , $ array1Keys ) ) return false ; foreach ( $ attributes1 as $ type => $ attribute ) { if ( ! isset ( $ attributes2 [ $ type ] ) ) return false ; $ typePrefix1 = $ this -> context -> types -> getPrefixForNamespace ( $ attribute [ 'namespace' ] ) ; $ xequalType1 = XBRL_Equality :: xequalAttributeType ( $ this -> context -> types , $ attribute [ 'name' ] , $ typePrefix1 ) ; $ typePrefix2 = $ this -> context -> types -> getPrefixForNamespace ( $ attributes2 [ $ type ] [ 'namespace' ] ) ; $ xequalType2 = XBRL_Equality :: xequalAttributeType ( $ this -> context -> types , $ attributes2 [ $ type ] [ 'name' ] , $ typePrefix2 ) ; if ( ! XBRL_Equality :: xequal ( $ attribute [ 'value' ] , $ attributes2 [ $ type ] [ 'value' ] , $ xequalType1 , $ xequalType2 ) ) { return false ; } } return true ; }
Tests two arrays for equivalence
2018-05-01 At the moment this function is only used with calculation link arcs but needs to be applied to all arc types
@param array $attributes1 This array will have been generated by a call to getNonExemptArcAttributes
@param array $attributes2 This array will have been generated by a call to getNonExemptArcAttributes
@return bool
Tests two arrays for equivalence 2018 - 05 - 01 At the moment this function is only used with calculation link arcs but needs to be applied to all arc types