Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
EditAction
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 show
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
6
 doesWrites
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Flow\Actions;
4
5use Article;
6use IContextSource;
7use MediaWiki\Title\Title;
8
9class EditAction extends FlowAction {
10
11    /**
12     * @param Article $article
13     * @param IContextSource $context
14     */
15    public function __construct( Article $article, IContextSource $context ) {
16        parent::__construct( $article, $context, 'edit' );
17    }
18
19    /**
20     * Flow doesn't support edit action, redirect to the title instead
21     */
22    public function show() {
23        $title = $this->context->getTitle();
24
25        // There should always be a title since Flow page
26        // is detected by title or namespace, adding this
27        // to prevent some werid cases
28        if ( !$title ) {
29            $title = Title::newMainPage();
30        }
31
32        $this->context->getOutput()->redirect( $title->getFullURL() );
33    }
34
35    public function doesWrites() {
36        return false;
37    }
38}