Skip to content

Instantly share code, notes, and snippets.

View config.json
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#ff5a5f",
"@brand-success": "#5cb85c",
@AlexeyKosov
AlexeyKosov / closest.php
Created Nov 9, 2016
Symfony Crawler closest()
View closest.php
<?php
/**
* @param Crawler $crawler
* @param string $cssSelector
* @return Crawler
*/
function closest(Crawler $crawler, $cssSelector)
{
$xpath = (new CssSelectorConverter())->toXPath($cssSelector, './');