The Polish authorities had failed to assess the impact of the detention on the family and the children in particular, not fulfilled their obligation to consider the family’s detention as a measure of last resort and had not considered alternative measures. Child detention is permitted for the shortest amount of time and only if the detention conditions are appropriate and less coercive measures are not available.
Source: official link