| 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 |
||
| 619 | public static function get_dashicons() { |
||
| 620 | |||
| 621 | $admin_menu = array( |
||
| 622 | 'menu', |
||
| 623 | 'admin-site', |
||
| 624 | 'dashboard', |
||
| 625 | 'admin-post', |
||
| 626 | 'admin-media', |
||
| 627 | 'admin-links', |
||
| 628 | 'admin-page', |
||
| 629 | 'admin-comments', |
||
| 630 | 'admin-appearance', |
||
| 631 | 'admin-plugins', |
||
| 632 | 'admin-users', |
||
| 633 | 'admin-tools', |
||
| 634 | 'admin-settings', |
||
| 635 | 'admin-network', |
||
| 636 | 'admin-home', |
||
| 637 | 'admin-generic', |
||
| 638 | 'admin-collapse', |
||
| 639 | 'filter', |
||
| 640 | 'admin-customizer', |
||
| 641 | 'admin-multisite', |
||
| 642 | ); |
||
| 643 | |||
| 644 | $welcome_screen = array( |
||
| 645 | 'welcome-write-blog', |
||
| 646 | 'welcome-add-page', |
||
| 647 | 'welcome-view-site', |
||
| 648 | 'welcome-widgets-menus', |
||
| 649 | 'welcome-comments', |
||
| 650 | 'welcome-learn-more', |
||
| 651 | ); |
||
| 652 | |||
| 653 | $post_formats = array( |
||
| 654 | 'format-aside', |
||
| 655 | 'format-image', |
||
| 656 | 'format-gallery', |
||
| 657 | 'format-video', |
||
| 658 | 'format-status', |
||
| 659 | 'format-quote', |
||
| 660 | 'format-chat', |
||
| 661 | 'format-audio', |
||
| 662 | 'camera', |
||
| 663 | 'images-alt', |
||
| 664 | 'images-alt2', |
||
| 665 | 'video-alt', |
||
| 666 | 'video-alt2', |
||
| 667 | 'video-alt3', |
||
| 668 | ); |
||
| 669 | |||
| 670 | $media = array( |
||
| 671 | 'media-archive', |
||
| 672 | 'media-audio', |
||
| 673 | 'media-code', |
||
| 674 | 'media-default', |
||
| 675 | 'media-document', |
||
| 676 | 'media-interactive', |
||
| 677 | 'media-spreadsheet', |
||
| 678 | 'media-text', |
||
| 679 | 'media-video', |
||
| 680 | 'playlist-audio', |
||
| 681 | 'playlist-video', |
||
| 682 | 'controls-play', |
||
| 683 | 'controls-pause', |
||
| 684 | 'controls-forward', |
||
| 685 | 'controls-skipforward', |
||
| 686 | 'controls-back', |
||
| 687 | 'controls-skipback', |
||
| 688 | 'controls-repeat', |
||
| 689 | 'controls-volumeon', |
||
| 690 | 'controls-volumeoff', |
||
| 691 | ); |
||
| 692 | |||
| 693 | $image_editing = array( |
||
| 694 | 'image-crop', |
||
| 695 | 'image-rotate', |
||
| 696 | 'image-rotate-left', |
||
| 697 | 'image-rotate-right', |
||
| 698 | 'image-flip-vertical', |
||
| 699 | 'image-flip-horizontal', |
||
| 700 | 'image-filter', |
||
| 701 | 'undo', |
||
| 702 | 'redo', |
||
| 703 | ); |
||
| 704 | |||
| 705 | $tinymce = array( |
||
| 706 | 'editor-bold', |
||
| 707 | 'editor-italic', |
||
| 708 | 'editor-ul', |
||
| 709 | 'editor-ol', |
||
| 710 | 'editor-quote', |
||
| 711 | 'editor-alignleft', |
||
| 712 | 'editor-aligncenter', |
||
| 713 | 'editor-alignright', |
||
| 714 | 'editor-insertmore', |
||
| 715 | 'editor-spellcheck', |
||
| 716 | 'editor-expand', |
||
| 717 | 'editor-contract', |
||
| 718 | 'editor-kitchensink', |
||
| 719 | 'editor-underline', |
||
| 720 | 'editor-justify', |
||
| 721 | 'editor-textcolor', |
||
| 722 | 'editor-paste-word', |
||
| 723 | 'editor-paste-text', |
||
| 724 | 'editor-removeformatting', |
||
| 725 | 'editor-video', |
||
| 726 | 'editor-customchar', |
||
| 727 | 'editor-outdent', |
||
| 728 | 'editor-indent', |
||
| 729 | 'editor-help', |
||
| 730 | 'editor-strikethrough', |
||
| 731 | 'editor-unlink', |
||
| 732 | 'editor-rtl', |
||
| 733 | 'editor-break', |
||
| 734 | 'editor-code', |
||
| 735 | 'editor-paragraph', |
||
| 736 | 'editor-table', |
||
| 737 | ); |
||
| 738 | |||
| 739 | $posts = array( |
||
| 740 | 'align-left', |
||
| 741 | 'align-right', |
||
| 742 | 'align-center', |
||
| 743 | 'align-none', |
||
| 744 | 'lock', |
||
| 745 | 'unlock', |
||
| 746 | 'calendar', |
||
| 747 | 'calendar-alt', |
||
| 748 | 'visibility', |
||
| 749 | 'hidden', |
||
| 750 | 'post-status', |
||
| 751 | 'edit', |
||
| 752 | 'trash', |
||
| 753 | 'sticky', |
||
| 754 | ); |
||
| 755 | |||
| 756 | $sorting = array( |
||
| 757 | 'external', |
||
| 758 | 'arrow-up', |
||
| 759 | 'arrow-down', |
||
| 760 | 'arrow-right', |
||
| 761 | 'arrow-left', |
||
| 762 | 'arrow-up-alt', |
||
| 763 | 'arrow-down-alt', |
||
| 764 | 'arrow-right-alt', |
||
| 765 | 'arrow-left-alt', |
||
| 766 | 'arrow-up-alt2', |
||
| 767 | 'arrow-down-alt2', |
||
| 768 | 'arrow-right-alt2', |
||
| 769 | 'arrow-left-alt2', |
||
| 770 | 'sort', |
||
| 771 | 'leftright', |
||
| 772 | 'randomize', |
||
| 773 | 'list-view', |
||
| 774 | 'exerpt-view', |
||
| 775 | 'grid-view', |
||
| 776 | ); |
||
| 777 | |||
| 778 | $social = array( |
||
| 779 | 'share', |
||
| 780 | 'share-alt', |
||
| 781 | 'share-alt2', |
||
| 782 | 'twitter', |
||
| 783 | 'rss', |
||
| 784 | 'email', |
||
| 785 | 'email-alt', |
||
| 786 | 'facebook', |
||
| 787 | 'facebook-alt', |
||
| 788 | 'googleplus', |
||
| 789 | 'networking', |
||
| 790 | ); |
||
| 791 | |||
| 792 | $wordpress_org = array( |
||
| 793 | 'hammer', |
||
| 794 | 'art', |
||
| 795 | 'migrate', |
||
| 796 | 'performance', |
||
| 797 | 'universal-access', |
||
| 798 | 'universal-access-alt', |
||
| 799 | 'tickets', |
||
| 800 | 'nametag', |
||
| 801 | 'clipboard', |
||
| 802 | 'heart', |
||
| 803 | 'megaphone', |
||
| 804 | 'schedule', |
||
| 805 | ); |
||
| 806 | |||
| 807 | $products = array( |
||
| 808 | 'wordpress', |
||
| 809 | 'wordpress-alt', |
||
| 810 | 'pressthis', |
||
| 811 | 'update', |
||
| 812 | 'screenoptions', |
||
| 813 | 'info', |
||
| 814 | 'cart', |
||
| 815 | 'feedback', |
||
| 816 | 'cloud', |
||
| 817 | 'translation', |
||
| 818 | ); |
||
| 819 | |||
| 820 | $taxonomies = array( |
||
| 821 | 'tag', |
||
| 822 | 'category', |
||
| 823 | ); |
||
| 824 | |||
| 825 | $widgets = array( |
||
| 826 | 'archive', |
||
| 827 | 'tagcloud', |
||
| 828 | 'text', |
||
| 829 | ); |
||
| 830 | |||
| 831 | $notifications = array( |
||
| 832 | 'yes', |
||
| 833 | 'no', |
||
| 834 | 'no-alt', |
||
| 835 | 'plus', |
||
| 836 | 'plus-alt', |
||
| 837 | 'minus', |
||
| 838 | 'dismiss', |
||
| 839 | 'marker', |
||
| 840 | 'star-filled', |
||
| 841 | 'star-half', |
||
| 842 | 'star-empty', |
||
| 843 | 'flag', |
||
| 844 | 'warning', |
||
| 845 | ); |
||
| 846 | |||
| 847 | $misc = array( |
||
| 848 | 'location', |
||
| 849 | 'location-alt', |
||
| 850 | 'vault', |
||
| 851 | 'shield', |
||
| 852 | 'shield-alt', |
||
| 853 | 'sos', |
||
| 854 | 'search', |
||
| 855 | 'slides', |
||
| 856 | 'analytics', |
||
| 857 | 'chart-pie', |
||
| 858 | 'chart-bar', |
||
| 859 | 'chart-line', |
||
| 860 | 'chart-area', |
||
| 861 | 'groups', |
||
| 862 | 'businessman', |
||
| 863 | 'id', |
||
| 864 | 'id-alt', |
||
| 865 | 'products', |
||
| 866 | 'awards', |
||
| 867 | 'forms', |
||
| 868 | 'testimonial', |
||
| 869 | 'portfolio', |
||
| 870 | 'book', |
||
| 871 | 'book-alt', |
||
| 872 | 'download', |
||
| 873 | 'upload', |
||
| 874 | 'backup', |
||
| 875 | 'clock', |
||
| 876 | 'lightbulb', |
||
| 877 | 'microphone', |
||
| 878 | 'desktop', |
||
| 879 | 'tablet', |
||
| 880 | 'smartphone', |
||
| 881 | 'phone', |
||
| 882 | 'index-card', |
||
| 883 | 'carrot', |
||
| 884 | 'building', |
||
| 885 | 'store', |
||
| 886 | 'album', |
||
| 887 | 'palmtree', |
||
| 888 | 'tickets-alt', |
||
| 889 | 'money', |
||
| 890 | 'smiley', |
||
| 891 | 'thumbs-up', |
||
| 892 | 'thumbs-down', |
||
| 893 | 'layout', |
||
| 894 | ); |
||
| 895 | |||
| 896 | return array( |
||
| 897 | 'admin-menu' => $admin_menu, |
||
| 898 | 'welcome-screen' => $welcome_screen, |
||
| 899 | 'post-formats' => $post_formats, |
||
| 900 | 'media' => $media, |
||
| 901 | 'image-editing' => $image_editing, |
||
| 902 | 'tinymce' => $tinymce, |
||
| 903 | 'posts' => $posts, |
||
| 904 | 'sorting' => $sorting, |
||
| 905 | 'social' => $social, |
||
| 906 | 'wordpress_org' => $wordpress_org, |
||
| 907 | 'products' => $products, |
||
| 908 | 'taxonomies' => $taxonomies, |
||
| 909 | 'widgets' => $widgets, |
||
| 910 | 'notifications' => $notifications, |
||
| 911 | 'misc' => $misc, |
||
| 912 | ); |
||
| 913 | |||
| 914 | } |
||
| 915 | } |
||
| 916 |