for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace roaresearch\yii2\roa\urlRules;
use Yii;
/**
* Default Url Rule to handle resources with collections.
*
* Supports representative URL using ownership slug.
* @author Angel (Faryshta) Guevara <[email protected]>
*/
class Resource extends \yii\rest\UrlRule
{
* @inheritdoc
public $pluralize = false;
public $tokens = ['{id}' => '<id:\d+>'];
public function parseRequest($manager, $request)
$pathInfo = $request->getPathInfo();
$pathInfo
foreach ($this->rules as $urlName => $rules) {
foreach ($rules as $rule) {
/* @var $rule \yii\web\UrlRule */
$result = $rule->parseRequest($manager, $request);
if (YII_DEBUG) {
Yii::trace([
yii\BaseYii::trace()
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
/** @scrutinizer ignore-deprecated */ Yii::trace([
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
'rule' => $rule instanceof \Stringable
? (string)$rule
: $rule::class,
'match' => $result !== false,
'parent' => static::class,
], __METHOD__);
}
if ($result !== false) {
return $result;
return false;