original_string: private function getMappedPermissions(array $permissions): array
      {
          $mappedPermissions = [];
          foreach ($permissions as $permission => $options) {
              $mappedPermissions[strtolower($permission)] = $permission;
              if (is_array($options) && array_key_exists('nested', $options)) {
                  $mappedPermissions = array_merge($mappedPermissions, $this->getMappedPermissions($options['nested']));
              }
          }
  
          return $mappedPermissions;
      }
code: private function getMappedPermissions(array $permissions): array
      {
          $mappedPermissions = [];
          foreach ($permissions as $permission => $options) {
              $mappedPermissions[strtolower($permission)] = $permission;
              if (is_array($options) && array_key_exists('nested', $options)) {
                  $mappedPermissions = array_merge($mappedPermissions, $this->getMappedPermissions($options['nested']));
              }
          }
  
          return $mappedPermissions;
      }
code_tokens: private function getMappedPermissions ( array $ permissions ) : array { $ mappedPermissions = [ ] ; foreach ( $ permissions as $ permission => $ options ) { $ mappedPermissions [ strtolower ( $ permission ) ] = $ permission ; if ( is_array ( $ options ) && array_key_exists ( 'nested' , $ options ) ) { $ mappedPermissions = array_merge ( $ mappedPermissions , $ this -> getMappedPermissions ( $ options [ 'nested' ] ) ) ; } } return $ mappedPermissions ; }
docstring: Recursive function to get mapped permissions.
  
  @param array $permissions
  
  @return array
docstring_tokens: Recursive function to get mapped permissions .