<?php

namespace Dalten\RuianToUir\Command\Helper;

use Symfony\Component\Finder\Finder;

/**
 * Created by PhpStorm.
 * User: karel
 * Date: 23.02.2017
 * Time: 11:09.
 */
class FileResolver
{
    /**
     * @param string $filename
     *
     * @return array|Finder
     */
    public function resolveFiles($filename)
    {
        try {
            $finder = new Finder();

            return $finder->in($filename)->name('*.xml');
        } catch (\InvalidArgumentException $e) {
            return [$filename];
        }
    }
}
