CoreFiles by mySites.guru
Recipe.php65 lines, 1,495 bytes, from Joomla_5.0.0-alpha3-Alpha-Full_Package.zip
Raw History Compare with 5.0.0-alpha2
md5
11d94d4551599f9f17ee4d577c887526
sha1
b28350bf2719071bc21b6d10400442c20aec93ec
sha256
d459fc357f2fd1b661320054fccda1faf7746d834dbb04d9ad091ce8f0812beb
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Schemaorg.recipe
 *
 * @copyright   (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt

 * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
 */

namespace Joomla\Plugin\Schemaorg\Recipe\Extension;

use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Schemaorg\SchemaorgPluginTrait;
use Joomla\Event\SubscriberInterface;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Schemaorg Plugin
 *
 * @since  5.0.0
 */
final class Recipe extends CMSPlugin implements SubscriberInterface
{
    use SchemaorgPluginTrait;

    /**
     * Load the language file on instantiation.
     *
     * @var    boolean
     * @since  5.0.0
     */
    protected $autoloadLanguage = true;

    /**
     * The name of the schema form
     *
     * @var   string
     * @since 5.0.0
     */
    protected $pluginName = 'Recipe';

    /**
     *  To add plugin specific functions
     *
     *  @param   array $schema Schema form
     *
     *  @return  array Updated schema form
     */
    public function customCleanup(array $schema)
    {
        $schema = $this->normalizeDurationsToISO($schema, ['cookTime', 'prepTime']);

        $schema = $this->convertToArray($schema, ['recipeIngredient']);

        $schema = $this->cleanupDate($schema, ['datePublished']);

        return $schema;
    }
}

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