Try:

```php
if ( 0 < (int) $tags[ 'offset' ] ) {
    $params[ 'offset' ] = (int) $tags[ 'offset' ];
}
```