public function first($name)
    {
        if (isset($this->files[$name])) {
            return $this->files[$name];
        }

        foreach ($this->files as $key => $file) {
            if (strpos($key, "{$name}[") === 0) {
                return $file;
            }
        }
    }
public function first($name)
    {
        if (isset($this->files[$name])) {
            return $this->files[$name];
        }

        foreach ($this->files as $key => $file) {
            if (strpos($key, "{$name}[") === 0) {
                return $file;
            }
        }
    }
public function first ( $ name ) { if ( isset ( $ this -> files [ $ name ] ) ) { return $ this -> files [ $ name ] ; } foreach ( $ this -> files as $ key => $ file ) { if ( strpos ( $ key , "{$name}[" ) === 0 ) { return $ file ; } } }
Returns the first file by its name.

@param $name
@return File|null
Returns the first file by its name .