Code Duplication    Length = 12-12 lines in 2 locations

src/PublishedScope.php 2 locations

@@ 66-77 (lines=12) @@
63
     *
64
     * @return void
65
     */
66
    protected function addOnlyPublished(Builder $builder)
67
    {
68
        $builder->macro('onlyPublished', function (Builder $builder) {
69
            $model = $builder->getModel();
70
71
            $builder->withoutGlobalScope($this)->whereNotNull(
72
                $model->getQualifiedPublishedAtColumn()
73
            );
74
75
            return $builder;
76
        });
77
    }
78
79
    /**
80
     * Add the only-drafts extension to the builder.
@@ 86-97 (lines=12) @@
83
     *
84
     * @return void
85
     */
86
    protected function addOnlyDrafts(Builder $builder)
87
    {
88
        $builder->macro('onlyDrafts', function (Builder $builder) {
89
            $model = $builder->getModel();
90
91
            $builder->withoutGlobalScope($this)->whereNull(
92
                $model->getQualifiedPublishedAtColumn()
93
            );
94
95
            return $builder;
96
        });
97
    }
98
}
99