File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/Condition.php.tar
httpdocs/wp-content/plugins/google-listings-and-ads/src/Product/Attributes/Condition.php 0000644 00000003613 15155656346 0034045 0 ustar 00 var/www/vhosts/uyarreklam.com.tr <?php
declare( strict_types=1 );
namespace Automattic\WooCommerce\GoogleListingsAndAds\Product\Attributes;
use Automattic\WooCommerce\GoogleListingsAndAds\Admin\Product\Attributes\Input\ConditionInput;
use Automattic\WooCommerce\GoogleListingsAndAds\Product\AttributeMapping\Traits\IsEnumTrait;
defined( 'ABSPATH' ) || exit;
/**
* Class Condition
*
* @package Automattic\WooCommerce\GoogleListingsAndAds\Product\Attributes
*/
class Condition extends AbstractAttribute implements WithValueOptionsInterface, WithMappingInterface {
use IsEnumTrait;
/**
* Returns the attribute ID.
*
* Must be the same as a Google product's property name to be set automatically.
*
* @return string
*
* @see \Google\Service\ShoppingContent\Product for the list of properties.
*/
public static function get_id(): string {
return 'condition';
}
/**
* Return an array of WooCommerce product types that this attribute can be applied to.
*
* @return array
*/
public static function get_applicable_product_types(): array {
return [ 'simple', 'variation' ];
}
/**
* Return an array of values available to choose for the attribute.
*
* Note: array key is used as the option key.
*
* @return array
*/
public static function get_value_options(): array {
return [
'new' => __( 'New', 'google-listings-and-ads' ),
'refurbished' => __( 'Refurbished', 'google-listings-and-ads' ),
'used' => __( 'Used', 'google-listings-and-ads' ),
];
}
/**
* Return the attribute's input class. Must be an instance of `AttributeInputInterface`.
*
* @return string
*
* @see AttributeInputInterface
*
* @since 1.5.0
*/
public static function get_input_type(): string {
return ConditionInput::class;
}
/**
* Returns the attribute name
*
* @return string
*/
public static function get_name(): string {
return __( 'Condition', 'google-listings-and-ads' );
}
}
uyarreklam.com.tr/httpdocs/wp-content/plugins/so-widgets-bundle/base/inc/lib/Less/Tree/Condition.php0000644 00000002731 15155677662 0032473 0 ustar 00 var/www/vhosts <?php
/**
* Condition
*
* @package Less
* @subpackage tree
*/
class Less_Tree_Condition extends Less_Tree{
public $op;
public $lvalue;
public $rvalue;
public $index;
public $negate;
public $type = 'Condition';
public function __construct($op, $l, $r, $i = 0, $negate = false) {
$this->op = trim($op);
$this->lvalue = $l;
$this->rvalue = $r;
$this->index = $i;
$this->negate = $negate;
}
public function accept($visitor){
$this->lvalue = $visitor->visitObj( $this->lvalue );
$this->rvalue = $visitor->visitObj( $this->rvalue );
}
public function compile($env) {
$a = $this->lvalue->compile($env);
$b = $this->rvalue->compile($env);
switch( $this->op ){
case 'and':
$result = $a && $b;
break;
case 'or':
$result = $a || $b;
break;
default:
if( Less_Parser::is_method($a, 'compare') ){
$result = $a->compare($b);
}elseif( Less_Parser::is_method($b, 'compare') ){
$result = $b->compare($a);
}else{
throw new Less_Exception_Compiler('Unable to perform comparison', null, $this->index);
}
switch ($result) {
case -1:
$result = $this->op === '<' || $this->op === '=<' || $this->op === '<=';
break;
case 0:
$result = $this->op === '=' || $this->op === '>=' || $this->op === '=<' || $this->op === '<=';
break;
case 1:
$result = $this->op === '>' || $this->op === '>=';
break;
}
break;
}
return $this->negate ? !$result : $result;
}
}