Importing data from spreadsheet
You might want to create a service that accepts the spreadsheet data as method argument instead.

And maybe the columns could be configured to make it more flexible.

Also no need to do 5 times the same again, instead use a loop.

class SpreadsheetTillsConverter
{
  private int $modelColumn;
  private int $versionColumn;

  /** @var array&lt;int, int&gt; Map nameColumn =&gt; ipAddressColumn */
  private array $columns;

  public function __construct(int $modelColumn, int $versionColumn, array $columns)
  {
    $this-&gt;modelColumn = $modelColumn;
    $this-&gt;versionColumn = $versionColumn;
    $this-&gt;columns = $columns;
  }

  public function getTills(array $data): array
  {
     if (!isset($data[$this-&gt;modelColumn])) {
        throw new \InvalidArgumentException('Model column not found.');
     }
     $model = $data[$this-&gt;modelColumn];

     if (!isset($data[$this-&gt;versionColumn])) {
        throw new \InvalidArgumentException('Version column not found.');
     }
     $version = $data[$this-&gt;versionColumn];

     $result = [];
     foreach ($this-&gt;columns as $nameColumn =&gt; $ipAddressColumn) {
        if (isset($data[$nameColumn], $data[$ipAddressColumn])) {
          $result[] = [
            'model' =&gt; $model,
            'name' =&gt; $data[$nameColumn],
            'ip_address' =&gt; $data[$ipAddressColumn],
            'version' =&gt; $version,
          ];
        }
     }
     return $result;
  }
}

$converter = new SpreadsheetTillsConverter(17, 7, [
  40 =&gt; 41,
  42 =&gt; 43,
  44 =&gt; 45,
  46 =&gt; 47,
  48 =&gt; 49
]);

$tills = $converter-&gt;getTills($spreadsheetData);