Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Many CS changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maks3w committed Oct 15, 2014
1 parent c26edce commit 5512620
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 35 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getConfigTreeBuilder()
->end()
->end()
->validate()
->ifTrue(function($v) {
->ifTrue(function ($v) {
return $v['driver']['useSsl'] && $v['driver']['useStartTls'];
})
->thenInvalid('The useSsl and useStartTls options are mutually exclusive.')
Expand Down
2 changes: 1 addition & 1 deletion Driver/LdapDriverException.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ public function __construct($message)
{
parent::__construct($message);
}
}
}
4 changes: 2 additions & 2 deletions Driver/LdapDriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface LdapDriverInterface
*
* @throws LdapDriverException if some error occurs.
*/
function bind(UserInterface $user, $password);
public function bind(UserInterface $user, $password);

/**
* Search LDAP tree
Expand All @@ -41,5 +41,5 @@ function bind(UserInterface $user, $password);
*
* @throws LdapDriverException if some error occurs.
*/
function search($baseDn, $filter, array $attributes = array());
public function search($baseDn, $filter, array $attributes = array());
}
3 changes: 2 additions & 1 deletion Driver/LegacyLdapDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public function search($baseDn, $filter, array $attributes = array())
return $entries;
}
}

return false;
}

Expand Down Expand Up @@ -73,12 +74,12 @@ public function bind(UserInterface $user, $password)
$bind_rdn = $user->getUsername();
}


if (null === $this->ldap_res) {
$this->connect();
}

$this->logDebug(sprintf('ldap_bind(%s, ****)', $bind_rdn));

return @ldap_bind($this->ldap_res, $bind_rdn, $password);
}

Expand Down
4 changes: 2 additions & 2 deletions Driver/ZendLdapDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function bind(UserInterface $user, $password)

/**
* Treat a Zend Ldap Exception
*
*
* @param ZendLdapException $exception
*/
protected function zendExceptionHandler(ZendLdapException $exception)
Expand All @@ -105,7 +105,7 @@ protected function zendExceptionHandler(ZendLdapException $exception)

/**
* Log debug messages if the logger is set.
*
*
* @param string $message
*/
private function logDebug($message)
Expand Down
2 changes: 1 addition & 1 deletion Ldap/LdapManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function findUserBy(array $criteria);
* @param string $password
* @return Boolean
*/
function bind(UserInterface $user, $password);
public function bind(UserInterface $user, $password);

/**
* Escapes the given VALUES according to RFC 2254 so that they can be safely used in LDAP filters.
Expand Down
2 changes: 0 additions & 2 deletions Model/UserManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace FR3D\LdapBundle\Model;

use FR3D\LdapBundle\Model\LdapUserInterface;

interface UserManagerInterface
{

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ Issues and feature requests are tracked in the [GitHub issue tracker](https://gi
When reporting a bug, it may be a good idea to reproduce it in a basic project
built using the [Symfony Standard Edition](https://github.com/symfony/symfony-standard)
to allow developers of the bundle to reproduce the issue by simply cloning it
and following some steps.
and following some steps.
2 changes: 1 addition & 1 deletion Resources/meta/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
4 changes: 2 additions & 2 deletions Security/Authentication/LdapAuthenticationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ protected function retrieveUser($username, UsernamePasswordToken $token)
throw $notFound;
} catch (\Exception $repositoryProblem) {
if (Kernel::MINOR_VERSION <= 1) {
throw new AuthenticationServiceException($repositoryProblem->getMessage(), $token, (int)$repositoryProblem->getCode(), $repositoryProblem);
throw new AuthenticationServiceException($repositoryProblem->getMessage(), $token, (int) $repositoryProblem->getCode(), $repositoryProblem);
} else {
$e = new AuthenticationServiceException($repositoryProblem->getMessage(), (int)$repositoryProblem->getCode(), $repositoryProblem);
$e = new AuthenticationServiceException($repositoryProblem->getMessage(), (int) $repositoryProblem->getCode(), $repositoryProblem);
$e->setToken($token);
throw $e;
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/FR3DLdapExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private function assertParameter($value, $key)

private function assertHasDefinition($id)
{
$this->assertTrue(($this->container->hasDefinition($id) ? : $this->container->hasAlias($id)), sprintf('%s definition is not set', $id));
$this->assertTrue(($this->container->hasDefinition($id) ?: $this->container->hasAlias($id)), sprintf('%s definition is not set', $id));
}

protected function tearDown()
Expand Down
2 changes: 1 addition & 1 deletion Tests/Driver/AbstractLdapDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require_once 'LDAPVirtual/zend-ldap_php-ldap_override.php';
require_once 'LDAPVirtual/fr3d-ldapbundle-driver_php-ldap_override.php';

abstract class AbstractDriverTest extends \PHPUnit_Framework_TestCase
abstract class AbstractLdapDriverTest extends \PHPUnit_Framework_TestCase
{

protected function setUp()
Expand Down
20 changes: 10 additions & 10 deletions Tests/Driver/LDAPVirtual/LDAPVirtualInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
interface LDAPVirtualInterface
{

function setTls($tls);
public function setTls($tls);

function setSsl($ssl);
public function setSsl($ssl);

function setOptions($options);
public function setOptions($options);

function addUser($username, $password);
public function addUser($username, $password);

function ldap_bind($username, $password);
public function ldap_bind($username, $password);

function ldap_connect($host, $port);
public function ldap_connect($host, $port);

function ldap_set_option($option, $value);
public function ldap_set_option($option, $value);

function ldap_start_tls();
public function ldap_start_tls();

function ldap_search($baseDn, $filter, $attributes);
public function ldap_search($baseDn, $filter, $attributes);

function ldap_get_entries();
public function ldap_get_entries();
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ function ldap_get_entries($ress, $result)
}

return $ldapServer->ldap_get_entries($result);
}
}
4 changes: 2 additions & 2 deletions Tests/Driver/LDAPVirtual/zend-ldap_php-ldap_override.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* This file override default PHP Ldap functions for the specified namespace
* This file override default PHP Ldap functions for the specified namespace
*/

namespace Zend\Ldap;
Expand Down Expand Up @@ -95,4 +95,4 @@ function ldap_get_entries($ress, $result)
}

return $ldapServer->ldap_get_entries($result);
}
}
4 changes: 1 addition & 3 deletions Tests/Driver/LegacyLdapDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public function testBindUserInterfaceByUsername()
->with($this->equalTo($username), $this->equalTo($password))
->will($this->returnValue(true));


$this->assertTrue($this->legacyLdapDriver->bind($user, $password));
}

Expand Down Expand Up @@ -147,7 +146,6 @@ public function testBindByDnFromUsername()
->with($this->equalTo($entry['dn']), $this->equalTo($password))
->will($this->returnValue(true));


$this->assertTrue($this->legacyLdapDriver->bind($user, $password));
}

Expand Down Expand Up @@ -180,4 +178,4 @@ public function testBindByDnFromBadUsername()

$this->assertFalse($this->legacyLdapDriver->bind($user, $password));
}
}
}
1 change: 0 additions & 1 deletion Tests/Driver/ZendLdapDriverMockedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public function testSearch()
$entry,
);


$this->zend->expects($this->once())
->method('searchEntries')
->with($this->equalTo($filter), $this->equalTo($baseDn), $this->equalTo(Ldap::SEARCH_SCOPE_SUB), $this->equalTo($attributes))
Expand Down
1 change: 0 additions & 1 deletion Tests/Security/User/LdapUserProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,3 @@ public function testRefreshUser()
$this->assertEquals($user, $this->userProvider->refreshUser($user));
}
}
?>
2 changes: 1 addition & 1 deletion UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ UPGRADE FROM 1.5 to 2.0
<argument type="service" id="fr3d_ldap.ldap_driver" />
<argument type="service" id="fr3d_ldap.user_manager" />
<argument>%fr3d_ldap.ldap_manager.parameters%</argument>
</service>
</service>

0 comments on commit 5512620

Please sign in to comment.