public function itemValue(callable $valueFunction)
    {
        // Paths aren't recorded at all if requireUnique+itemValue
        // because then key is filename|dirname and value is arbitrary.
        $this->pathNameRecord = $this->requireUnique ? 'none' : 'key';

        $this->itemValue = $valueFunction;
        return $this;
    }
public function itemValue(callable $valueFunction)
    {
        // Paths aren't recorded at all if requireUnique+itemValue
        // because then key is filename|dirname and value is arbitrary.
        $this->pathNameRecord = $this->requireUnique ? 'none' : 'key';

        $this->itemValue = $valueFunction;
        return $this;
    }
public function itemValue ( callable $ valueFunction ) { // Paths aren't recorded at all if requireUnique+itemValue // because then key is filename|dirname and value is arbitrary. $ this -> pathNameRecord = $ this -> requireUnique ? 'none' : 'key' ; $ this -> itemValue = $ valueFunction ; return $ this ; }
Provide function to set list item values.

List keys become paths and values become file|dir items passed
to this function.
Except if also requireUnique, then keys become filename|dirname
and paths won't be recorded at all.

The value function must:
- take an SplFileInfo item as first and only argument
- return any type of value

@code
$list = (new PathList('/home/you/Documents'))
->itemValue(function(\SplFileInfo $item) {
return $item->getSize();
})
->find();
@endcode

@see \SplFileInfo

@param callable $valueFunction

@return $this|PathList
Provide function to set list item values .