Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: linter
name: php-cs-fixer

permissions:
contents: read
Expand All @@ -22,5 +22,8 @@ on:
push: *ignore-paths

jobs:
phpcs:
uses: yiisoft/yii2-actions/.github/workflows/linter.yml@master
php-cs-fixer:
uses: yiisoft/yii2-actions/.github/workflows/php-cs-fixer.yml@9bfbe47bd91bc31a6ff9f0ea77ba3724d7816c3d # master
with:
configuration: .php-cs-fixer.dist.php
php-version: '["7.4"]'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ coverage.xml
# local tests configuration
/tests/data/config.local.php
/tests/runtime

# PHP CS Fixer
.php-cs-fixer.php
.php-cs-fixer.cache
30 changes: 30 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$header = '@link https://www.yiiframework.com/
@copyright Copyright (c) 2008 Yii Software LLC
@license https://www.yiiframework.com/license/';

$finder = (new Finder())
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->notPath([
'#(^|/)views/#',
]);

return (new Config())
->setFinder($finder)
->setRules([
'@PSR2' => true,
'no_unused_imports' => true,
'phpdoc_scalar' => true,
'header_comment' => [
'comment_type' => 'PHPDoc',
'header' => $header,
'location' => 'after_open',
],
]);
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
},
"require-dev": {
"yiisoft/yii2-swiftmailer": "*",
"yiisoft/yii2-coding-standards": "~3.0",
"phpunit/phpunit": "^9.6",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"rector/rector": "^2.6",
"mspirkov/yii2-rector": "^0.1"
"mspirkov/yii2-rector": "^0.1",
"friendsofphp/php-cs-fixer": "^3.95"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -68,8 +68,8 @@
}
},
"scripts": {
"cs": "./vendor/bin/phpcs",
"cs-fix": "./vendor/bin/phpcbf",
"cs": "./vendor/bin/php-cs-fixer check",
"cs-fix": "./vendor/bin/php-cs-fixer fix",
"static": "./vendor/bin/phpstan --memory-limit=-1",
"tests": "./vendor/bin/phpunit",
"rector": "./vendor/bin/rector"
Expand Down
18 changes: 0 additions & 18 deletions phpcs.xml.dist

This file was deleted.

33 changes: 16 additions & 17 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,29 +179,28 @@ class Module extends \yii\base\Module implements BootstrapInterface
* @since 2.1.1
*/
public $urlRuleClass = 'yii\web\UrlRule';
/**
* @var string|callable Page title could be a string or a callable function
*
* ```php
* ...
* 'pageTitle' => 'Custom Debug Title',
* ...
* // OR
* 'pageTitle' => function($url) {
* $domain = getDomain($url);
* return $domain . ' debugger';
* }
* ```
*
* @since 2.1.1
*/
/**
* @var string|callable Page title could be a string or a callable function
*
* ```php
* ...
* 'pageTitle' => 'Custom Debug Title',
* ...
* // OR
* 'pageTitle' => function($url) {
* $domain = getDomain($url);
* return $domain . ' debugger';
* }
* ```
*
* @since 2.1.1
*/
public $pageTitle;
/**
* @var string Yii logo URL
*/
private static $_yiiLogo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAAC7lBMVEUAAACl034Cb7HlcjGRyT/H34fyy5PxqlSfzjwQeb5PmtX71HAMdrWOxkDzmU3qcDSPx0HzhUGNxT+/2lX2olDmUy/Q1l+TyD7rgjq21k3ZRzDQ4GGFw0Ghzz6MwOkKdrTA2lTzzMVjo9mhzkCIxUPk1MLynU7qWS33vmbP1rm011Fwqsj123/r44tUltTyq1aCxEOo0EL1tFuCw0Npp9v7xGVHkM8Ddrza0pvC3FboczHmXSvE21h+wkRkpNHvjkS92FPW3avpeDT2t1zX5GefzUD6wGQReLtMltPN417oczPZ0L+62FF+tuJgqtXZUzNzrN3s4Y7n65y72FLwmk7xjESr0kYof8MQe8DY5Gc6jMnN32DoaDLbTiLulUo1hsni45vuwnIigMXC21dqq8vKzaaBt+XU4mUMd7wDdr7xlUrU4a7A2VTD0LbVx5vvpFP/0m9godp/tuTD0LVyrsfZVDUuhMjkPChsrMt3suK92VDd52oEc7un0EKjzj7D21e01EuSyD2fzDvH3Fqu0kcDdL641k+x00rmXy0EdLiayzzynU2XyTzxmUur0ETshD7lZDDvkUbtiUDrgTvqfjrkWS292FPujEKAuObQ4GH3vWH1slr0r1j0pVLulEiPxj7oeDRnptn4zWrM31/1t13A2lb1rFb1qVS72FKHw0CLxD/qdTfnazL4wGPJ3VzwpFLpcjKFveljo9dfn9ZbntUYfcEIdr35w2XyoFH0ok/pfDZ9tONUmNRPltJIj89Ais388IL85Hn82nL80W33uV72tFy611DxlUnujkSCwkGlz0DqeTnocDJ3r99yrN1Xm9RFjc42hsorgsYhgMQPer/81XD5yGbT4mTriD/lbS3laCvjTiluqN5NktAxhMf853v84He/2VTgVCnmVSg8h8sHcrf6633+3nb8zGr2xmR/wEGcyzt3r+T/6n7tm01tqNnfSCnfPyO4zLmFwkDVRDGOweLP1aX55nrZTTOaxdjuY9uiAAAAfHRSTlMABv7+9hAJ/vMyGP2CbV5DOA+NbyYeG/DV0sC/ubaonYN5blZRQT41MSUk/v797+zj49PR0MXEw8PDu6imppqYlpOGhYN+bldWVFJROjAM+fPy8fDw8O7t6+vp5+Lh4N7e3Nvb2NPQ0MW8urm2rqiimJKFg3t5amZTT0k1ewExHwAABPVJREFUSMed1Xc81HEYB/DvhaOUEe29995777333ntv2sopUTQ4F104hRBSl8ohldCwOqfuuEiKaPdfz/P7/u6Syuu+ff727vM8z+8bhDHNB3TrXI38V6p1fvSosLBwgICd1qx/5cqVT8jrl9c1Wlm2qmFdgbWq5X316lXKq5dxu+ouyNWePevo6JjVd6il9T/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1+4gOUKhUl/sP0Z7ITJycmowz5q3oxrfMBvvYBh6O7ZKcnvqY7dZuPXR8hQvOXSJdQc/7hhTB8TBjs6Ivz6pezsbKobmggYbJWOT1ADT8HFGxKW9LwTjRp4CujbTHj007t37kRHhGP5h5Tk5K0MduLce0/vvoyOjoiIuH4ddMoeBrzz2WvUMDrMDvpDFQa89Pkr4KCBo+7OYEdFpqLGcqqbMuDVaZGpqc/1OjycYerKohtpkZFl9ECG4qoihxvA9aN3ZDlXL5GDXR7Vr56BZtlYcAOwnQMdHXRPlmdd2U5kh5gffRHL0GSUXR5gKBeJ0tIiZ1UmLKlqlydygHD1s8EyYYe8PBFMjulVhbClEdy6kohLVTaJGEYW4eBr6MhsY1fi0ggoe7a3a7d84O6J5L8iNOiX3U+uoa/p8UPtoQAAAABJRU5ErkJggg==';


/**
* @var array routes of AJAX requests to skip from being displayed in toolbar
* @since 2.1.14
Expand Down
1 change: 0 additions & 1 deletion src/Panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace yii\debug;

use Yii;
use yii\base\Component;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
Expand Down
1 change: 0 additions & 1 deletion src/models/UserSwitch.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class UserSwitch extends Model
*/
private $_mainUser;


/**
* @var string|User ID of the user component or a user object
* @since 2.0.13
Expand Down
1 change: 0 additions & 1 deletion src/panels/DbPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class DbPanel extends Panel
*/
private $_profileLogs;


/**
* @var array of event names used to get profile logs.
* @since 2.1.17
Expand Down
6 changes: 6 additions & 0 deletions tests/FlattenExceptionTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug;

use yii\debug\FlattenException;
Expand Down
6 changes: 6 additions & 0 deletions tests/LogTargetTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug;

use Yii;
Expand Down
6 changes: 6 additions & 0 deletions tests/ModuleTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug;

use Yii;
Expand Down
6 changes: 6 additions & 0 deletions tests/PanelTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug;

use yii\debug\Module;
Expand Down
6 changes: 6 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug;

use Yii;
Expand Down
7 changes: 7 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols

// ensure we get report on all possible php errors
error_reporting(-1);

Expand Down
6 changes: 6 additions & 0 deletions tests/router/ActionRoutesTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router;

use yii\debug\models\router\ActionRoutes;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/CurrentRouteTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router;

use PHPUnit\Framework\TestCase;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/CustomRuleStub.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router;

use yii\web\UrlRuleInterface;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/RouterRulesTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router;

use yii\debug\models\router\RouterRules;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/controllers/BadController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router\controllers;

use yii\web\Controller;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/controllers/RedirectController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router\controllers;

use yii\web\Controller;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/controllers/RestController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router\controllers;

use yii\rest\ActiveController;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/controllers/WebController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router\controllers;

use yii\web\Controller;
Expand Down
6 changes: 6 additions & 0 deletions tests/router/module/Module.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router\module;

class Module extends \yii\base\Module
Expand Down
6 changes: 6 additions & 0 deletions tests/router/module/controllers/ModuleWebController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license https://www.yiiframework.com/license/
*/

namespace yiiunit\debug\router\module\controllers;

use yii\web\Controller;
Expand Down
Loading