src/Matcher.php
public function getScoresByAttribute(Attribute $attribute): Collection
    {
        return $this->candidates->map(function (CanBeSpecified $candidate) {
            return $candidate->specifications();
        })->map(function (SpecificationsInterface $specifications) use ($attribute) {
            if (!$specifications->has($attribute)) {
                return;
            }

            return $specifications->get($attribute)->getScoreValue();
        });
    }
public function getScoresByAttribute(Attribute $attribute): Collection
    {
        return $this->candidates->map(function (CanBeSpecified $candidate) {
            return $candidate->specifications();
        })->map(function (SpecificationsInterface $specifications) use ($attribute) {
            if (!$specifications->has($attribute)) {
                return;
            }

            return $specifications->get($attribute)->getScoreValue();
        });
    }
public function getScoresByAttribute ( Attribute $ attribute ) : Collection { return $ this -> candidates -> map ( function ( CanBeSpecified $ candidate ) { return $ candidate -> specifications ( ) ; } ) -> map ( function ( SpecificationsInterface $ specifications ) use ( $ attribute ) { if ( ! $ specifications -> has ( $ attribute ) ) { return ; } return $ specifications -> get ( $ attribute ) -> getScoreValue ( ) ; } ) ; }
Returns a collection where the keys matches the keys of the
candidates Collection but contain the score of the given
Attribute object.

@param  \Pbmedia\Specifications\Interfaces\Attribute   $attribute
@return \Illuminate\Support\Collection
Returns a collection where the keys matches the keys of the candidates Collection but contain the score of the given Attribute object .