Some parts of your code may be unable to conform to your coding standard. You can ignore file parts in the following way
$xmlPackage = new XMLPackage;
// phpcs:disable
$xmlPackage['error_code'] = get_default_error_code_value();
$xmlPackage->send();
// phpcs:enable
In your case you are trying to ignore the doc block for the page and the class, so you should start the // phpcs:disable
before the namespace
and then close it using // phpcs:enable
right after the opening braces of the class {
.
I am adding the sample code to ignore the docs block for the file and class below using my own code as you never added the actual code but the image
<?php
// phpcs:disable
namespace frontend\controllers;
use Yii;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\web\Response;
/**
* ApiKeysController implements the CRUD actions for ApiKeys model.
*/
class ApiKeysController extends Controller
{
// phpcs:enable
}
Note: Before PHP_CodeSniffer version 3.2.0
, use // @codingStandardsIgnoreStart
instead of // phpcs:disable
, and use // @codingStandardsIgnoreEnd
instead of
// phpcs:enable
. The @codingStandards
syntax is deprecated and will be removed in
PHP_CodeSniffer version 4.0
.