Completed
Push — temp/wip ( 2b4a6c...3e0623 )
by Nate
05:30 queued 03:38
created

actions/organizations/CreateOrganizationType.php (2 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/organization/license
6
 * @link       https://www.flipboxfactory.com/software/organization/
7
 */
8
9
namespace flipbox\organizations\actions\organizations;
10
11
use flipbox\craft\ember\actions\records\CreateRecord;
12
use flipbox\organizations\records\OrganizationType;
13
use yii\db\ActiveRecord;
14
15
/**
16
 * @author Flipbox Factory <[email protected]>
17
 * @since 1.0.0
18
 */
19
class CreateOrganizationType extends CreateRecord
20
{
21
    use PopulateOrganizationTypeTrait;
22
23
    /**
24
     * @inheritdoc
25
     * @param OrganizationType $record
26
     * @return OrganizationType
27
     */
28
    protected function populate(ActiveRecord $record): ActiveRecord
29
    {
30
        $this->populateSiteLayout($record);
1 ignored issue
show
$record of type object<yii\db\ActiveRecord> is not a sub-type of object<flipbox\organizat...cords\OrganizationType>. It seems like you assume a child class of the class yii\db\ActiveRecord to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
31
        $this->populateSiteSettings($record);
1 ignored issue
show
$record of type object<yii\db\ActiveRecord> is not a sub-type of object<flipbox\organizat...cords\OrganizationType>. It seems like you assume a child class of the class yii\db\ActiveRecord to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
32
33
        return parent::populate($record);
34
    }
35
36
    /**
37
     * @inheritdoc
38
     * @return OrganizationType
39
     */
40
    protected function newRecord(array $config = []): ActiveRecord
41
    {
42
        return new OrganizationType($config);
43
    }
44
}
45