HEX
Server: LiteSpeed
System: Linux eko108.isimtescil.net 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: uyarreklamcomtr (11202)
PHP: 7.4.33
Disabled: opcache_get_status
Upload Files
File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/ShoppingContentDateTrait.php.tar
httpdocs/wp-content/plugins/google-listings-and-ads/src/API/Google/ShoppingContentDateTrait.php000064400000001437151554440120035105 0ustar00var/www/vhosts/uyarreklam.com.tr<?php
declare( strict_types=1 );

namespace Automattic\WooCommerce\GoogleListingsAndAds\API\Google;

use Automattic\WooCommerce\GoogleListingsAndAds\Vendor\Google\Service\ShoppingContent\Date as ShoppingContentDate;
use DateTime;

defined( 'ABSPATH' ) || exit;

/**
 * Trait ShoppingContentDateTrait
 *
 * @package Automattic\WooCommerce\GoogleListingsAndAds\API\Google
 */
trait ShoppingContentDateTrait {

	/**
	 * Convert ShoppingContentDate to DateTime.
	 *
	 * @param ShoppingContentDate $date The Google date.
	 *
	 * @return DateTime|false The date converted or false if the date is invalid.
	 */
	protected function convert_shopping_content_date( ShoppingContentDate $date ) {
		return DateTime::createFromFormat( 'Y-m-d|', "{$date->getYear()}-{$date->getMonth()}-{$date->getDay()}" );
	}
}