The expression array_sum($scores) / count($scores); of type integer|double adds the type double to the return on line 56 which is incompatible with the return type declared by the interface Prophecy\Argument\Token\...nterface::scoreArgument of type boolean|integer.