private function checkDataSourceName($name, DataSourceInterface $datasource = null)
    {
        if (empty($name)) {
            throw new DataSourceException('Name of data source can\'t be empty.');
        }

        if (isset($this->datasources[$name]) && ($this->datasources[$name] !== $datasource)) {
            throw new DataSourceException('Name of data source must be unique.');
        }

        if (!preg_match('/^[\w\d]+$/', $name)) {
            throw new DataSourceException('Name of data source may contain only word characters and digits.');
        }
    }
private function checkDataSourceName($name, DataSourceInterface $datasource = null)
    {
        if (empty($name)) {
            throw new DataSourceException('Name of data source can\'t be empty.');
        }

        if (isset($this->datasources[$name]) && ($this->datasources[$name] !== $datasource)) {
            throw new DataSourceException('Name of data source must be unique.');
        }

        if (!preg_match('/^[\w\d]+$/', $name)) {
            throw new DataSourceException('Name of data source may contain only word characters and digits.');
        }
    }
private function checkDataSourceName ( $ name , DataSourceInterface $ datasource = null ) { if ( empty ( $ name ) ) { throw new DataSourceException ( 'Name of data source can\'t be empty.' ) ; } if ( isset ( $ this -> datasources [ $ name ] ) && ( $ this -> datasources [ $ name ] !== $ datasource ) ) { throw new DataSourceException ( 'Name of data source must be unique.' ) ; } if ( ! preg_match ( '/^[\w\d]+$/' , $ name ) ) { throw new DataSourceException ( 'Name of data source may contain only word characters and digits.' ) ; } }
Method to checking datasources name.

@throws \FSi\Component\DataSource\Exception\DataSourceException
@param string $name
@param \FSi\Component\DataSource\DataSourceInterface $datasource
Method to checking datasources name .