for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Anton Tuyakhov <[email protected]>
*/
namespace tuyakhov\jsonapi;
* UrlRule is provided to simplify the creation of URL rules for JSON API support.
* @package tuyakhov\jsonapi
class UrlRule extends \yii\rest\UrlRule
{
* @inheritdoc
public function init()
$this->tokens = array_merge($this->tokens, array_merge([
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
'{relationship}' => '<name:\w+>'
]));
$this->patterns = array_merge($this->patterns, [
'DELETE {id}/relationships/{relationship}' => 'delete-relationship',
'POST,PATCH {id}/relationships/{relationship}' => 'update-relationship',
'GET {id}/{relationship}' => 'view-related',
'{id}/{relationship}' => 'options'
]);
parent::init();
}
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.