<?php

class EmployeesFactory
{
    public static function create(Profession $profession, int $amount, int $rank): array
    {
        if ($amount < 1) {
            throw new InvalidArgumentException();
        }

        $employees = [];

        for ($count = 0; $count < $amount; $count++) {
            $employees[] = new Employee($profession, $rank);
        }

        return $employees;
    }
}

$company = new Company('ООО Вектор');

$manager = ProfessionFactory('Manager');

$department1 = new Department('Рекламы');
$department1->addEmployees(EmployessFactory::create($manager, 20, 1));
//...

$company->addDepartment($department1);