src/ElementResolver.php
public function format($selector)
    {
        $sortedElements = collect($this->elements)->sortByDesc(function ($element, $key) {
            return strlen($key);
        })->toArray();

        $selector = str_replace(
            array_keys($sortedElements), array_values($sortedElements), $originalSelector = $selector
        );

        if (Str::startsWith($selector, '@') && $selector === $originalSelector) {
            $selector = '[dusk="'.explode('@', $selector)[1].'"]';
        }

        return trim($this->prefix.' '.$selector);
    }
public function format($selector)
    {
        $sortedElements = collect($this->elements)->sortByDesc(function ($element, $key) {
            return strlen($key);
        })->toArray();

        $selector = str_replace(
            array_keys($sortedElements), array_values($sortedElements), $originalSelector = $selector
        );

        if (Str::startsWith($selector, '@') && $selector === $originalSelector) {
            $selector = '[dusk="'.explode('@', $selector)[1].'"]';
        }

        return trim($this->prefix.' '.$selector);
    }
public function format ( $ selector ) { $ sortedElements = collect ( $ this -> elements ) -> sortByDesc ( function ( $ element , $ key ) { return strlen ( $ key ) ; } ) -> toArray ( ) ; $ selector = str_replace ( array_keys ( $ sortedElements ) , array_values ( $ sortedElements ) , $ originalSelector = $ selector ) ; if ( Str :: startsWith ( $ selector , '@' ) && $ selector === $ originalSelector ) { $ selector = '[dusk="' . explode ( '@' , $ selector ) [ 1 ] . '"]' ; } return trim ( $ this -> prefix . ' ' . $ selector ) ; }
Format the given selector with the current prefix.

@param  string  $selector
@return string
Format the given selector with the current prefix .