for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://flipboxfactory.com/software/organization/license
* @link https://www.flipboxfactory.com/software/organization/
*/
namespace flipbox\organizations\actions\organizations;
use Craft;
use flipbox\craft\ember\actions\records\SaveRecordTrait;
use flipbox\organizations\records\UserAssociation;
use yii\base\Action;
use yii\db\ActiveRecord;
* @author Flipbox Factory <[email protected]>
* @since 3.0.0
class AssociateUserToOrganization extends Action
{
use SaveRecordTrait, LookupAssociationTrait;
* @var array
public $validBodyParams = [
'sortOrder' => 'userOrder',
'state'
];
* @inheritdoc
* @param UserAssociation $record
$record
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return bool
protected function performAction(UserAssociation $association): bool
return $association->save();
}
* Body params that should be set on the record.
*
* @return array
protected function validBodyParams(): array
return $this->validBodyParams;
* @inheritDoc
protected function populate(UserAssociation $record): ActiveRecord
$record->setAttributes(
$this->attributeValuesFromBody()
);
$types = Craft::$app->getRequest()->getBodyParam('types', []);
if (!empty($types)) {
$record->getTypes()->clear()->add($types);
return $record;
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.