本文整理匯總了PHP中Shopware\Tests\Mink\Helper::floatValue方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::floatValue方法的具體用法?PHP Helper::floatValue怎麽用?PHP Helper::floatValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Shopware\Tests\Mink\Helper
的用法示例。
在下文中一共展示了Helper::floatValue方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getOrderPositionData
/**
* Helper function returns the data of an order position
* @param NodeElement $position
* @param string[] $selectors
* @return array
*/
private function getOrderPositionData(NodeElement $position, array $selectors)
{
$data = [];
foreach ($selectors as $key => $selector) {
$element = $position->find('css', $selector);
$data[$key] = $element->getText();
if ($key !== 'product') {
$data[$key] = Helper::floatValue($data[$key]);
}
}
return $data;
}
示例2: getStarsProperty
/**
* Returns the star rating
* @return float
*/
public function getStarsProperty()
{
$elements = Helper::findElements($this, ['stars']);
return Helper::floatValue($elements['stars']->getAttribute('class'));
}
示例3: getFloatProperty
/**
* Helper method to read a float property
* @param string $propertyName
* @return float
*/
protected function getFloatProperty($propertyName)
{
$element = Helper::findElements($this, [$propertyName]);
return Helper::floatValue($element[$propertyName]->getText());
}
示例4: getPriceProperty
/**
* Returns the price
* @param NodeElement $slide
* @return float
*/
public function getPriceProperty(NodeElement $slide)
{
$selector = Helper::getRequiredSelector($this, 'slidePrice');
$price = $slide->find('css', $selector)->getText();
return Helper::floatValue($price);
}
示例5: getPriceProperty
/**
* Returns the price
* @return float
*/
public function getPriceProperty()
{
$price = $this->getProperty('price');
return Helper::floatValue($price);
}
示例6: getPriceProperty
/**
* @return float
*/
public function getPriceProperty()
{
$elements = Helper::findElements($this, ['price']);
return Helper::floatValue($elements['price']->getText());
}
示例7: getPriceProperty
/**
* Returns the price
* @param NodeElement $slide
* @return float
*/
public function getPriceProperty(NodeElement $slide)
{
$selector = Helper::getRequiredSelector($this, 'slidePrice');
preg_match('(\\d+,\\d{2})', $slide->find('css', $selector)->getHtml(), $price);
return Helper::floatValue(current($price));
}