Formulas/Resources/Formulas/Formula.php
private function getPeriodAspectValue( $source, $evaluationResult, $log )
	{
		// Get the period name from the source
		if ( is_null( $this->periodRule ) )
		{
			$context = $this->getContextForSource( $source, $evaluationResult, ASPECT_PERIOD, $log, $contextRef );
			if ( ! $context || ! isset( $context['period'] ) ) return null;

			// TODO What is in the $context array
			return $context['period'];
		}
		else
		{
			/**
			 *
			 * @var Period $period
			 */
			$period = Period::fromArray( $this->periodRule );
			// This function will throw an exception if there is a problem so there is no return value to check
			$this->checkSAVConflicts( $period->source, ASPECT_PERIOD, $evaluationResult, $log );
			return $period->getValue( $this, $evaluationResult, $log );
		}
	}
private function getPeriodAspectValue( $source, $evaluationResult, $log )
	{
		// Get the period name from the source
		if ( is_null( $this->periodRule ) )
		{
			$context = $this->getContextForSource( $source, $evaluationResult, ASPECT_PERIOD, $log, $contextRef );
			if ( ! $context || ! isset( $context['period'] ) ) return null;

			// TODO What is in the $context array
			return $context['period'];
		}
		else
		{
			/**
			 *
			 * @var Period $period
			 */
			$period = Period::fromArray( $this->periodRule );
			// This function will throw an exception if there is a problem so there is no return value to check
			$this->checkSAVConflicts( $period->source, ASPECT_PERIOD, $evaluationResult, $log );
			return $period->getValue( $this, $evaluationResult, $log );
		}
	}
private function getPeriodAspectValue ( $ source , $ evaluationResult , $ log ) { // Get the period name from the source
 if ( is_null ( $ this -> periodRule ) ) { $ context = $ this -> getContextForSource ( $ source , $ evaluationResult , ASPECT_PERIOD , $ log , $ contextRef ) ; if ( ! $ context || ! isset ( $ context [ 'period' ] ) ) return null ; // TODO What is in the $context array
 return $ context [ 'period' ] ; } else { /**
			 *
			 * @var Period $period
			 */ $ period = Period :: fromArray ( $ this -> periodRule ) ; // This function will throw an exception if there is a problem so there is no return value to check
 $ this -> checkSAVConflicts ( $ period -> source , ASPECT_PERIOD , $ evaluationResult , $ log ) ; return $ period -> getValue ( $ this , $ evaluationResult , $ log ) ; } }
Get the period to be used for this fact.  If a period rule does not exist, use the formula source value
@param array $source
@param array $evaluationResult
@param \XBRL_Log $log
@return array|NULL
Get the period to be used for this fact . If a period rule does not exist use the formula source value