Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75945

Check all uses of $num_points in image(open|filled)polygon calls

XMLWordPrintable

    • 2
    • Team Hedgehog Sprint 1 review

      The $num_points parameter of image(open|filled)polygon has been deprecated.

      And we have a few of them in core:

      $ ag 'image.*polygon' --php
      lib/graphlib.php
      1568:          ImageFilledPolygon($this->image, array($u, $v-$half, $u+$half, $v, $u, $v+$half, $u-$half, $v), 4, $this->colour[$colour]);
      1571:          ImagePolygon($this->image, array($u, $v-$half, $u+$half, $v, $u, $v+$half, $u-$half, $v), 4, $this->colour[$colour]);
      1574:          ImageFilledPolygon($this->image, array($u, $v-$half, $u+$half, $v+$half, $u-$half, $v+$half), 3, $this->colour[$colour]);
      1577:          ImagePolygon($this->image, array($u, $v-$half, $u+$half, $v+$half, $u-$half, $v+$half), 3, $this->colour[$colour]);
      1668:            ImageFilledPolygon($this->image, array($u_start, $v_start, $u_end, $v_end, $u_end, $zero, $u_start, $zero), 4, $this->colour[$colour]);
      1669:            ImagePolygon($this->image, array($u_start, $v_start, $u_end, $v_end, $u_end, $zero, $u_start, $zero), 4, $this->colour[$colour]);
      1672:            //ImagePolygon($this->image, array($u_start, $v_start, $u_end, $v_end, $u_end, $zero, $u_start, $zero), 4, $this->colour[$colour]);
      1689:            ImageFilledPolygon($this->image, array($u_start, $v_start, $u_end, $v_end, $u_end, $bottom, $u_start, $bottom), 4, $this->colour[$colour]);
      1692:            ImagePolygon($this->image, array($u_start, $v_start, $u_end, $v_end, $u_end, $bottom, $u_start, $bottom), 4, $this->colour[$colour]);
      1779:          ImageFilledPolygon($this->image, array($x+$half, $y-$half,
      1786:          ImageFilledPolygon($this->image, array($x-$half, $y-$half,
      

      Note that, surely, in order to keep both 8.1 and older php versions working without notices... we'll need to make some conditional coding here, using PHP_VERSION_ID >= 80100 or version_compare(PHP_VERSION, '8.1', '>='.

      Ciao

            meirza.arson@moodle.com Meirza
            stronk7 Eloy Lafuente (stronk7)
            Safat Shahin Safat Shahin
            Andrew Lyons Andrew Lyons
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 5 hours, 9 minutes
                1d 5h 9m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.