code: public function allFromAdapter(Adapter $adapter)
      {
          if ($adapter instanceof KnowsItsBehaviors) {
              return $adapter->getBehaviors();
          }
  
          $rfl       = new \ReflectionClass($adapter);
          $behaviors = array();
  
          foreach ($rfl->getInterfaces() as $interface) {
              if (true === $interface->isSubclassOf('Gaufrette\Core\Adapter\Behavior')) {
                  $behaviors[] = $interface->getName();
              }
          }
  
          return $behaviors;
      }
docs: Get all behavior of an adapter.
  
  @param Adapter $adapter
  
  @return string[]