Language/src/Annotation.php
private function filter($items, $path, $type)
    {
        if (!$items) {
            return null;
        }

        return array_filter($items, function ($item) use ($path, $type) {
            $itemCopy = $item;

            // key into the value with the given path
            foreach ($path as $key) {
                $itemCopy = $itemCopy[$key];
            }

            if (strtolower($itemCopy) === strtolower($type)) {
                return $item;
            }
        });
    }
private function filter($items, $path, $type)
    {
        if (!$items) {
            return null;
        }

        return array_filter($items, function ($item) use ($path, $type) {
            $itemCopy = $item;

            // key into the value with the given path
            foreach ($path as $key) {
                $itemCopy = $itemCopy[$key];
            }

            if (strtolower($itemCopy) === strtolower($type)) {
                return $item;
            }
        });
    }
private function filter ( $ items , $ path , $ type ) { if ( ! $ items ) { return null ; } return array_filter ( $ items , function ( $ item ) use ( $ path , $ type ) { $ itemCopy = $ item ; // key into the value with the given path foreach ( $ path as $ key ) { $ itemCopy = $ itemCopy [ $ key ] ; } if ( strtolower ( $ itemCopy ) === strtolower ( $ type ) ) { return $ item ; } } ) ; }
Filters an array of items based on the provided type.

@param array $items The items to iterate.
@param array $path The path to the value to compare against the provided
type.
@param string $type The type to filter on.
@return array|null
Filters an array of items based on the provided type .