Skip to content
Snippets Groups Projects

feat(fields): #1 add sorting fields by priority field

Closed feat(fields): #1 add sorting fields by priority field
5 unresolved threads
Closed Krzysztof Dyszczyk requested to merge feature/add-priority-sorting into master
5 unresolved threads

Będę wdzięczny za zdanie. Nawiązuje to do #1 (closed)

Wprowadziłem też kilka zmian, które właściwie łamią kompatybilność PHP, ale z drugiej strony już nie wspieramy PHP 5.6, więc nie powinno być to dużym problemem (czy jednak jest?). Zresztą, zauważyłem, że w ostatnim fixie, który wrzucałem wykorzystałem ??, który jest dopiero w 7.0 🤷

Głównym powodem do podbicia PHP do wersji 7.0 na tej bibliotece była potrzeba dodania testu integracyjnego, który przy zainstalowanym PHPUnit by się nie odpalił (oczywiście, daje to też parę dodatkowych opcji, jak chociażby <=> w funkcji sortującej).

Jeśli pomysł na pole z priorytetem jest okej, ale podbicie PHP już nie, to przepiszę odpowiednio wrzucony kod.

Dodatkowo: z bootstrap.php do testów integracyjnych usunąłem zaciąganie WP i WC - o ile dokładnie przejrzałem, to ta biblioteka wykorzystuje tylko jedną funkcję z WP (sanitize_text_field).

Merge request reports

Checking pipeline status.

Approval is optional

Closed by Krzysztof DyszczykKrzysztof Dyszczyk 3 years ago (Sep 4, 2021 4:41pm UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
298 298
299 299 return $this;
300 300 }
301
302 /** @return int */
303 public function get_priority() {
304 return $this->meta['priority'] ?? 10;
  • 298 298
    299 299 return $this;
    300 300 }
    301
    302 /** @return int */
    303 public function get_priority() {
  • 298 298
    299 299 return $this;
    300 300 }
    301
    302 /** @return int */
    303 public function get_priority() {
    304 return $this->meta['priority'] ?? 10;
    305 }
    306
    307 public function set_priority( int $priority ) {
  • added 1 commit

    • 398bb2eb - refactor: add consistency in typing and inline docs

    Compare with previous version

    By Bartek Jaskulski on 2021-09-03T08:41:38 (imported from GitLab)

  • 25 26
    26 27 public function __construct() {
    27 28 $this->meta['class'] = [];
    29 $this->meta['priority'] = 10;
  • 1 1 # Changelog
    2 2
    3 ## [2.5.0] - 2021-09-03
    4 ### Added
    5 - Added fields sorting by priority field
  • unassigned @dyszczo

    By Dyszczo on 2021-09-03T12:43:29 (imported from GitLab)

  • Please register or sign in to reply
    Loading