Exemple #1
0
 /**
  * Get used scopes in current inspection
  *
  * @return array
  */
 public function getScopeListAttribute()
 {
     $scopes = (int) $this->attributes['scopes'];
     foreach (SubScope::all() as $subScope) {
         if (($scopes & $subScope->code) > 0) {
             $scopeList[] = $subScope->scope->category;
         }
     }
     return collect(array_unique($scopeList));
 }
Exemple #2
0
 /**
  * Test Relationship SubScope with Scope
  *
  * @return void
  */
 public function testRelationshipWithScope()
 {
     $subScope = new SubScope();
     $this->assertInstanceOf(BelongsTo::class, $subScope->scope());
 }