alt3 / cakephp-swagger

Compare 27b6cb5 ... +0 ... 3dd542d

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -1,4 +1,6 @@
Loading
1 1
<?php
2 +
declare(strict_types=1);
3 +
2 4
namespace Alt3\Swagger\Controller;
3 5
4 6
use Cake\Routing\Router;
@@ -37,7 +39,7 @@
Loading
37 39
            'plugin' => 'Alt3/Swagger',
38 40
            'controller' => 'Docs',
39 41
            'action' => 'index',
40 -
            $defaultDocument
42 +
            $defaultDocument,
41 43
        ], true);
42 44
    }
43 45
}

@@ -1,4 +1,6 @@
Loading
1 1
<?php
2 +
declare(strict_types=1);
3 +
2 4
namespace Alt3\Swagger\Lib;
3 5
4 6
use Cake\Core\Configure;
@@ -8,7 +10,6 @@
Loading
8 10
9 11
class SwaggerTools
10 12
{
11 -
12 13
    /**
13 14
     * @var string Prepended to filesystem swagger json files
14 15
     */
@@ -40,7 +41,7 @@
Loading
40 41
        $swaggerOptions = [];
41 42
        if (Configure::read("Swagger.library.$id.exclude")) {
42 43
            $swaggerOptions = [
43 -
                'exclude' => Configure::read("Swagger.library.$id.exclude")
44 +
                'exclude' => Configure::read("Swagger.library.$id.exclude"),
44 45
            ];
45 46
        }
46 47
        if (Configure::read('Swagger.analyser')) {

@@ -1,4 +1,6 @@
Loading
1 1
<?php
2 +
declare(strict_types=1);
3 +
2 4
namespace Alt3\Swagger\Controller;
3 5
4 6
use Cake\Controller\Controller as BaseController;
@@ -7,7 +9,6 @@
Loading
7 9
8 10
class AppController extends BaseController
9 11
{
10 -
11 12
    /**
12 13
     * @var array that will hold merged configuration settings.
13 14
     */
@@ -18,11 +19,11 @@
Loading
18 19
     */
19 20
    public static $defaultConfig = [
20 21
        'docs' => [
21 -
            'crawl' => true
22 +
            'crawl' => true,
22 23
        ],
23 24
        'ui' => [
24 -
            'title' => 'cakephp-swagger'
25 -
        ]
25 +
            'title' => 'cakephp-swagger',
26 +
        ],
26 27
    ];
27 28
28 29
    /**

@@ -1,18 +1,19 @@
Loading
1 1
<?php
2 +
declare(strict_types=1);
3 +
2 4
namespace Alt3\Swagger\Controller;
3 5
4 6
use Alt3\Swagger\Lib\SwaggerTools;
5 7
use Cake\Routing\Router;
6 8
7 9
class DocsController extends AppController
8 10
{
9 -
10 11
    /**
11 12
     * @var array Default CakePHP API success response structure.
12 13
     */
13 14
    public static $apiResponseBody = [
14 15
        'success' => true,
15 -
        'data' => []
16 +
        'data' => [],
16 17
    ];
17 18
18 19
    /**
@@ -67,8 +68,8 @@
Loading
67 68
                    'plugin' => 'Alt3/Swagger',
68 69
                    'controller' => 'Docs',
69 70
                    'action' => 'index',
70 -
                    $document
71 -
                ], true)
71 +
                    $document,
72 +
                ], true),
72 73
            ];
73 74
        }
74 75

@@ -1,12 +1,14 @@
Loading
1 1
<?php
2 +
declare(strict_types=1);
3 +
2 4
namespace Alt3\Swagger\Shell;
3 5
4 6
use Alt3\Swagger\Controller\AppController;
5 7
use Alt3\Swagger\Lib\SwaggerTools;
8 +
use Cake\Console\ConsoleOptionParser;
6 9
use Cake\Console\Shell;
7 10
use Cake\Core\Configure;
8 11
use Cake\Utility\Hash;
9 -
use Cake\Console\ConsoleOptionParser;
10 12
11 13
class SwaggerShell extends Shell
12 14
{
@@ -23,11 +25,11 @@
Loading
23 25
        $parser = parent::getOptionParser();
24 26
25 27
        $parser->addSubcommand('makedocs', [
26 -
            'description' => __('Crawl-generate fresh swagger file system documents for all entries found in the library.')
28 +
            'description' => __('Crawl-generate fresh swagger file system documents for all entries found in the library.'),
27 29
        ])
28 30
        ->addArgument('host', [
29 31
            'help' => __("Swagger host FQDN (without protocol) as to be inserted into the swagger doc property 'host'"),
30 -
            'required' => true
32 +
            'required' => true,
31 33
        ]);
32 34
33 35
        return $parser;

Learn more Showing 3 files with coverage changes found.

Changes in src/Shell/SwaggerShell.php
-6
+6
Loading file...
Changes in src/Lib/SwaggerTools.php
-9
+9
Loading file...
Changes in src/Controller/DocsController.php
-4
+4
Loading file...
Files Complexity Coverage
src ø -20.20% 79.80%
Project Totals (5 files) 32 79.80%
Loading