vmeretail / multi-tenancy-bundle

A multi tenancy bundle for Symfony 2 apps
25 stars 11 forks source link

[Insight] Logical operators should be avoided - in Service/TenantResolver.php, line 128 #36

Open StephenGillCoop opened 9 years ago

StephenGillCoop commented 9 years ago

in Service/TenantResolver.php, line 128

The or operator does not have the same precedence as ||. This could lead to unexpected behavior, use || instead.


    public function needStartScreen()
    {
        /** @var MultiTenantUserInterface $user */
        $user = $this->token->getToken()->getUser();
        return ($this->strategy == self::STRATEGY_FIXED_SUBDOMAIN and !$user->getActiveTenant())
            or ($this->strategy == self::STRATEGY_TENANT_AWARE_SUBDOMAIN and !$this->isSubdomain());
    }

    /**
     * @return Tenant
     */

Posted from SensioLabsInsight