CoreFiles by mySites.guru
SyndicateHelper.php49 lines, 1,026 bytes, from Joomla_4.0.0-beta5-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta4
md5
9c6f0c86bc9fcd062cf37a9ec4de0320
sha1
d02120a177db226d639d8b5c888345755ae44d35
sha256
4abfa8a0939daf21fb772ca22a0ee93db72ab02dc9196af8efbcf2c389f49778
<?php
/**
 * @package     Joomla.Site
 * @subpackage  mod_syndicate
 *
 * @copyright   Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Module\Syndicate\Site\Helper;

\defined('_JEXEC') or die;

use Joomla\CMS\Document\HtmlDocument;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;

/**
 * Helper for mod_syndicate
 *
 * @since  1.5
 */
class SyndicateHelper
{
	/**
	 * Gets the link
	 *
	 * @param   Registry      $params    The module parameters
	 * @param   HtmlDocument  $document  The document
	 *
	 * @return  string|null  The link as a string, if found
	 *
	 * @since   1.5
	 */
	public static function getLink(Registry $params, HtmlDocument $document)
	{
		foreach ($document->_links as $link => $value)
		{
			$value = ArrayHelper::toString($value);

			if (strpos($value, 'application/' . $params->get('format') . '+xml'))
			{
				return $link;
			}
		}

		return null;
	}
}

No other release has this exact content. See every version of this file.