| Conditions | 1 |
| Paths | 1 |
| Total Lines | 296 |
| Code Lines | 262 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 341 | public static function get_dashicons() { |
||
| 342 | |||
| 343 | $admin_menu = array( |
||
| 344 | 'menu', |
||
| 345 | 'admin-site', |
||
| 346 | 'dashboard', |
||
| 347 | 'admin-post', |
||
| 348 | 'admin-media', |
||
| 349 | 'admin-links', |
||
| 350 | 'admin-page', |
||
| 351 | 'admin-comments', |
||
| 352 | 'admin-appearance', |
||
| 353 | 'admin-plugins', |
||
| 354 | 'admin-users', |
||
| 355 | 'admin-tools', |
||
| 356 | 'admin-settings', |
||
| 357 | 'admin-network', |
||
| 358 | 'admin-home', |
||
| 359 | 'admin-generic', |
||
| 360 | 'admin-collapse', |
||
| 361 | 'filter', |
||
| 362 | 'admin-customizer', |
||
| 363 | 'admin-multisite', |
||
| 364 | ); |
||
| 365 | |||
| 366 | $welcome_screen = array( |
||
| 367 | 'welcome-write-blog', |
||
| 368 | 'welcome-add-page', |
||
| 369 | 'welcome-view-site', |
||
| 370 | 'welcome-widgets-menus', |
||
| 371 | 'welcome-comments', |
||
| 372 | 'welcome-learn-more', |
||
| 373 | ); |
||
| 374 | |||
| 375 | $post_formats = array( |
||
| 376 | 'format-aside', |
||
| 377 | 'format-image', |
||
| 378 | 'format-gallery', |
||
| 379 | 'format-video', |
||
| 380 | 'format-status', |
||
| 381 | 'format-quote', |
||
| 382 | 'format-chat', |
||
| 383 | 'format-audio', |
||
| 384 | 'camera', |
||
| 385 | 'images-alt', |
||
| 386 | 'images-alt2', |
||
| 387 | 'video-alt', |
||
| 388 | 'video-alt2', |
||
| 389 | 'video-alt3', |
||
| 390 | ); |
||
| 391 | |||
| 392 | $media = array( |
||
| 393 | 'media-archive', |
||
| 394 | 'media-audio', |
||
| 395 | 'media-code', |
||
| 396 | 'media-default', |
||
| 397 | 'media-document', |
||
| 398 | 'media-interactive', |
||
| 399 | 'media-spreadsheet', |
||
| 400 | 'media-text', |
||
| 401 | 'media-video', |
||
| 402 | 'playlist-audio', |
||
| 403 | 'playlist-video', |
||
| 404 | 'controls-play', |
||
| 405 | 'controls-pause', |
||
| 406 | 'controls-forward', |
||
| 407 | 'controls-skipforward', |
||
| 408 | 'controls-back', |
||
| 409 | 'controls-skipback', |
||
| 410 | 'controls-repeat', |
||
| 411 | 'controls-volumeon', |
||
| 412 | 'controls-volumeoff', |
||
| 413 | ); |
||
| 414 | |||
| 415 | $image_editing = array( |
||
| 416 | 'image-crop', |
||
| 417 | 'image-rotate', |
||
| 418 | 'image-rotate-left', |
||
| 419 | 'image-rotate-right', |
||
| 420 | 'image-flip-vertical', |
||
| 421 | 'image-flip-horizontal', |
||
| 422 | 'image-filter', |
||
| 423 | 'undo', |
||
| 424 | 'redo', |
||
| 425 | ); |
||
| 426 | |||
| 427 | $tinymce = array( |
||
| 428 | 'editor-bold', |
||
| 429 | 'editor-italic', |
||
| 430 | 'editor-ul', |
||
| 431 | 'editor-ol', |
||
| 432 | 'editor-quote', |
||
| 433 | 'editor-alignleft', |
||
| 434 | 'editor-aligncenter', |
||
| 435 | 'editor-alignright', |
||
| 436 | 'editor-insertmore', |
||
| 437 | 'editor-spellcheck', |
||
| 438 | 'editor-expand', |
||
| 439 | 'editor-contract', |
||
| 440 | 'editor-kitchensink', |
||
| 441 | 'editor-underline', |
||
| 442 | 'editor-justify', |
||
| 443 | 'editor-textcolor', |
||
| 444 | 'editor-paste-word', |
||
| 445 | 'editor-paste-text', |
||
| 446 | 'editor-removeformatting', |
||
| 447 | 'editor-video', |
||
| 448 | 'editor-customchar', |
||
| 449 | 'editor-outdent', |
||
| 450 | 'editor-indent', |
||
| 451 | 'editor-help', |
||
| 452 | 'editor-strikethrough', |
||
| 453 | 'editor-unlink', |
||
| 454 | 'editor-rtl', |
||
| 455 | 'editor-break', |
||
| 456 | 'editor-code', |
||
| 457 | 'editor-paragraph', |
||
| 458 | 'editor-table', |
||
| 459 | ); |
||
| 460 | |||
| 461 | $posts = array( |
||
| 462 | 'align-left', |
||
| 463 | 'align-right', |
||
| 464 | 'align-center', |
||
| 465 | 'align-none', |
||
| 466 | 'lock', |
||
| 467 | 'unlock', |
||
| 468 | 'calendar', |
||
| 469 | 'calendar-alt', |
||
| 470 | 'visibility', |
||
| 471 | 'hidden', |
||
| 472 | 'post-status', |
||
| 473 | 'edit', |
||
| 474 | 'trash', |
||
| 475 | 'sticky', |
||
| 476 | ); |
||
| 477 | |||
| 478 | $sorting = array( |
||
| 479 | 'external', |
||
| 480 | 'arrow-up', |
||
| 481 | 'arrow-down', |
||
| 482 | 'arrow-right', |
||
| 483 | 'arrow-left', |
||
| 484 | 'arrow-up-alt', |
||
| 485 | 'arrow-down-alt', |
||
| 486 | 'arrow-right-alt', |
||
| 487 | 'arrow-left-alt', |
||
| 488 | 'arrow-up-alt2', |
||
| 489 | 'arrow-down-alt2', |
||
| 490 | 'arrow-right-alt2', |
||
| 491 | 'arrow-left-alt2', |
||
| 492 | 'sort', |
||
| 493 | 'leftright', |
||
| 494 | 'randomize', |
||
| 495 | 'list-view', |
||
| 496 | 'exerpt-view', |
||
| 497 | 'grid-view', |
||
| 498 | ); |
||
| 499 | |||
| 500 | $social = array( |
||
| 501 | 'share', |
||
| 502 | 'share-alt', |
||
| 503 | 'share-alt2', |
||
| 504 | 'twitter', |
||
| 505 | 'rss', |
||
| 506 | 'email', |
||
| 507 | 'email-alt', |
||
| 508 | 'facebook', |
||
| 509 | 'facebook-alt', |
||
| 510 | 'googleplus', |
||
| 511 | 'networking', |
||
| 512 | ); |
||
| 513 | |||
| 514 | $wordpress_org = array( |
||
| 515 | 'hammer', |
||
| 516 | 'art', |
||
| 517 | 'migrate', |
||
| 518 | 'performance', |
||
| 519 | 'universal-access', |
||
| 520 | 'universal-access-alt', |
||
| 521 | 'tickets', |
||
| 522 | 'nametag', |
||
| 523 | 'clipboard', |
||
| 524 | 'heart', |
||
| 525 | 'megaphone', |
||
| 526 | 'schedule', |
||
| 527 | ); |
||
| 528 | |||
| 529 | $products = array( |
||
| 530 | 'wordpress', |
||
| 531 | 'wordpress-alt', |
||
| 532 | 'pressthis', |
||
| 533 | 'update', |
||
| 534 | 'screenoptions', |
||
| 535 | 'info', |
||
| 536 | 'cart', |
||
| 537 | 'feedback', |
||
| 538 | 'cloud', |
||
| 539 | 'translation', |
||
| 540 | ); |
||
| 541 | |||
| 542 | $taxonomies = array( |
||
| 543 | 'tag', |
||
| 544 | 'category', |
||
| 545 | ); |
||
| 546 | |||
| 547 | $widgets = array( |
||
| 548 | 'archive', |
||
| 549 | 'tagcloud', |
||
| 550 | 'text', |
||
| 551 | ); |
||
| 552 | |||
| 553 | $notifications = array( |
||
| 554 | 'yes', |
||
| 555 | 'no', |
||
| 556 | 'no-alt', |
||
| 557 | 'plus', |
||
| 558 | 'plus-alt', |
||
| 559 | 'minus', |
||
| 560 | 'dismiss', |
||
| 561 | 'marker', |
||
| 562 | 'star-filled', |
||
| 563 | 'star-half', |
||
| 564 | 'star-empty', |
||
| 565 | 'flag', |
||
| 566 | 'warning', |
||
| 567 | ); |
||
| 568 | |||
| 569 | $misc = array( |
||
| 570 | 'location', |
||
| 571 | 'location-alt', |
||
| 572 | 'vault', |
||
| 573 | 'shield', |
||
| 574 | 'shield-alt', |
||
| 575 | 'sos', |
||
| 576 | 'search', |
||
| 577 | 'slides', |
||
| 578 | 'analytics', |
||
| 579 | 'chart-pie', |
||
| 580 | 'chart-bar', |
||
| 581 | 'chart-line', |
||
| 582 | 'chart-area', |
||
| 583 | 'groups', |
||
| 584 | 'businessman', |
||
| 585 | 'id', |
||
| 586 | 'id-alt', |
||
| 587 | 'products', |
||
| 588 | 'awards', |
||
| 589 | 'forms', |
||
| 590 | 'testimonial', |
||
| 591 | 'portfolio', |
||
| 592 | 'book', |
||
| 593 | 'book-alt', |
||
| 594 | 'download', |
||
| 595 | 'upload', |
||
| 596 | 'backup', |
||
| 597 | 'clock', |
||
| 598 | 'lightbulb', |
||
| 599 | 'microphone', |
||
| 600 | 'desktop', |
||
| 601 | 'tablet', |
||
| 602 | 'smartphone', |
||
| 603 | 'phone', |
||
| 604 | 'index-card', |
||
| 605 | 'carrot', |
||
| 606 | 'building', |
||
| 607 | 'store', |
||
| 608 | 'album', |
||
| 609 | 'palmtree', |
||
| 610 | 'tickets-alt', |
||
| 611 | 'money', |
||
| 612 | 'smiley', |
||
| 613 | 'thumbs-up', |
||
| 614 | 'thumbs-down', |
||
| 615 | 'layout', |
||
| 616 | ); |
||
| 617 | |||
| 618 | return array( |
||
| 619 | 'admin-menu' => $admin_menu, |
||
| 620 | 'welcome-screen' => $welcome_screen, |
||
| 621 | 'post-formats' => $post_formats, |
||
| 622 | 'media' => $media, |
||
| 623 | 'image-editing' => $image_editing, |
||
| 624 | 'tinymce' => $tinymce, |
||
| 625 | 'posts' => $posts, |
||
| 626 | 'sorting' => $sorting, |
||
| 627 | 'social' => $social, |
||
| 628 | 'wordpress_org' => $wordpress_org, |
||
| 629 | 'products' => $products, |
||
| 630 | 'taxonomies' => $taxonomies, |
||
| 631 | 'widgets' => $widgets, |
||
| 632 | 'notifications' => $notifications, |
||
| 633 | 'misc' => $misc, |
||
| 634 | ); |
||
| 635 | |||
| 636 | } |
||
| 637 | } |
||
| 638 |