Code Duplication    Length = 9-9 lines in 2 locations

src/CustomPostType.php 1 location

@@ 87-95 (lines=9) @@
84
85
    protected function calculateLabels($calculatedLabel)
86
    {
87
        if ($this->getSingularLabel() === null) {
88
            $singularLabel = str_replace('_', ' ', $calculatedLabel);
89
            $singularLabel = str_replace('-', ' ', $singularLabel);
90
            $plural = $this->stringHelper::title($this->stringHelper::plural($singularLabel));
91
            $singularLabel = $this->stringHelper::title($singularLabel);
92
        } else {
93
            $singularLabel = $this->getSingularLabel();
94
            $plural = $this->stringHelper::plural($singularLabel);
95
        }
96
97
        return [
98
            'name' => $plural,

src/CustomTaxonomy.php 1 location

@@ 80-88 (lines=9) @@
77
78
    protected function calculateLabels($calculatedLabel)
79
    {
80
        if($this->getSingularLabel() === null){
81
            $singularLabel = str_replace('_', ' ', $calculatedLabel);
82
            $singularLabel = str_replace('-', ' ', $singularLabel);
83
            $plural = $this->stringHelper::title($this->stringHelper::plural($singularLabel));
84
            $singularLabel = $this->stringHelper::title($singularLabel);
85
        } else {
86
            $singularLabel = $this->getSingularLabel();
87
            $plural = $this->stringHelper::plural($singularLabel);
88
        }
89
90
        return [
91
            'name' => $plural,