Skip to content

Commit

Permalink
Fixed coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Oct 5, 2014
1 parent ab0388a commit b8ec444
Show file tree
Hide file tree
Showing 29 changed files with 58 additions and 88 deletions.
4 changes: 2 additions & 2 deletions src/Pagerfanta/Adapter/AdapterInterface.php
Expand Up @@ -23,7 +23,7 @@ interface AdapterInterface
*
* @return integer The number of results.
*/
function getNbResults();
public function getNbResults();

/**
* Returns an slice of the results.
Expand All @@ -33,5 +33,5 @@ function getNbResults();
*
* @return array|\Traversable The slice.
*/
function getSlice($offset, $length);
public function getSlice($offset, $length);
}
2 changes: 1 addition & 1 deletion src/Pagerfanta/Adapter/DoctrineDbalAdapter.php
Expand Up @@ -74,4 +74,4 @@ public function getSlice($offset, $length)

return $result->fetchAll();
}
}
}
2 changes: 1 addition & 1 deletion src/Pagerfanta/Adapter/DoctrineDbalSingleTableAdapter.php
Expand Up @@ -67,4 +67,4 @@ private function countFieldHasNoAlias($countField)
{
return strpos($countField, '.') === false;
}
}
}
6 changes: 3 additions & 3 deletions src/Pagerfanta/Adapter/DoctrineORMAdapter.php
Expand Up @@ -28,9 +28,9 @@ class DoctrineORMAdapter implements AdapterInterface
/**
* Constructor.
*
* @param \Doctrine\ORM\Query|\Doctrine\ORM\QueryBuilder $query A Doctrine ORM query or query builder.
* @param Boolean $fetchJoinCollection Whether the query joins a collection (true by default).
* @param Boolean|null $useOutputWalkers Whether to use output walkers pagination mode
* @param \Doctrine\ORM\Query|\Doctrine\ORM\QueryBuilder $query A Doctrine ORM query or query builder.
* @param Boolean $fetchJoinCollection Whether the query joins a collection (true by default).
* @param Boolean|null $useOutputWalkers Whether to use output walkers pagination mode
*/
public function __construct($query, $fetchJoinCollection = true, $useOutputWalkers = null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Pagerfanta/Adapter/SolariumAdapter.php
Expand Up @@ -34,8 +34,8 @@ class SolariumAdapter implements AdapterInterface
/**
* Constructor.
*
* @param Solarium_Client|Client $client A Solarium client.
* @param Solarium_Query_Select|Query $query A Solarium select query.
* @param Solarium_Client|Client $client A Solarium client.
* @param Solarium_Query_Select|Query $query A Solarium select query.
*/
public function __construct($client, $query)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Pagerfanta/PagerfantaInterface.php
Expand Up @@ -16,4 +16,4 @@
*/
interface PagerfantaInterface
{
}
}
2 changes: 1 addition & 1 deletion src/Pagerfanta/View/OptionableView.php
Expand Up @@ -28,7 +28,7 @@ class OptionableView implements ViewInterface
/**
* Constructor.
*
* @param ViewInterface $view A view.
* @param ViewInterface $view A view.
* @param array $defaultOptions An array of default options.
*/
public function __construct(ViewInterface $view, array $defaultOptions)
Expand Down
4 changes: 2 additions & 2 deletions src/Pagerfanta/View/Template/DefaultTemplate.php
Expand Up @@ -25,7 +25,7 @@ class DefaultTemplate extends Template
'dots_text' => '...',
'container_template' => '<nav>%pages%</nav>',
'page_template' => '<a href="%href%">%text%</a>',
'span_template' => '<span class="%class%">%text%</span>'
'span_template' => '<span class="%class%">%text%</span>',
);

public function container()
Expand Down Expand Up @@ -97,4 +97,4 @@ private function generateSpan($class, $page)

return str_replace($search, $replace, $this->option('span_template'));
}
}
}
4 changes: 2 additions & 2 deletions src/Pagerfanta/View/Template/Template.php
Expand Up @@ -16,7 +16,7 @@
*/
abstract class Template implements TemplateInterface
{
static protected $defaultOptions = array();
protected static $defaultOptions = array();

private $routeGenerator;
private $options;
Expand Down Expand Up @@ -63,4 +63,4 @@ protected function option($name)

return $this->options[$name];
}
}
}
24 changes: 12 additions & 12 deletions src/Pagerfanta/View/Template/TemplateInterface.php
Expand Up @@ -16,25 +16,25 @@
*/
interface TemplateInterface
{
function container();
public function container();

function page($page);
public function page($page);

function pageWithText($page, $text);
public function pageWithText($page, $text);

function previousDisabled();
public function previousDisabled();

function previousEnabled($page);
public function previousEnabled($page);

function nextDisabled();
public function nextDisabled();

function nextEnabled($page);
public function nextEnabled($page);

function first();
public function first();

function last($page);
public function last($page);

function current($page);
public function current($page);

function separator();
}
public function separator();
}
1 change: 0 additions & 1 deletion src/Pagerfanta/View/Template/TwitterBootstrap3Template.php
Expand Up @@ -30,4 +30,3 @@ public function container()
);
}
}

6 changes: 3 additions & 3 deletions src/Pagerfanta/View/Template/TwitterBootstrapTemplate.php
Expand Up @@ -26,7 +26,7 @@ class TwitterBootstrapTemplate extends Template
'css_next_class' => 'next',
'css_disabled_class' => 'disabled',
'css_dots_class' => 'disabled',
'css_active_class' => 'active'
'css_active_class' => 'active',
);

public function container()
Expand Down Expand Up @@ -111,7 +111,7 @@ public function last($page)

public function current($page)
{
$text = trim($page . ' ' . $this->option('active_suffix'));
$text = trim($page.' '.$this->option('active_suffix'));
$class = $this->option('css_active_class');

return $this->spanLi($class, $text);
Expand All @@ -138,4 +138,4 @@ private function spanLi($class, $text)

return sprintf('<li%s><span>%s</span></li>', $liClass, $text);
}
}
}
14 changes: 7 additions & 7 deletions src/Pagerfanta/View/ViewFactoryInterface.php
Expand Up @@ -24,7 +24,7 @@ interface ViewFactoryInterface
* @param string $name The view name.
* @param ViewInterface $view The view.
*/
function set($name, ViewInterface $view);
public function set($name, ViewInterface $view);

/**
* Returns whether a view exists or not.
Expand All @@ -33,14 +33,14 @@ function set($name, ViewInterface $view);
*
* @return Boolean Whether a view exists or not.
*/
function has($name);
public function has($name);

/**
* Adds views.
*
* @param array $views An array of views.
*/
function add(array $views);
public function add(array $views);

/**
* Returns a view.
Expand All @@ -51,14 +51,14 @@ function add(array $views);
*
* @throws \InvalidArgumentException If the view does not exist.
*/
function get($name);
public function get($name);

/**
* Returns all the views.
*
* @return array The views.
*/
function all();
public function all();

/**
* Removes a view.
Expand All @@ -67,10 +67,10 @@ function all();
*
* @throws \InvalidArgumentException If the view does not exist.
*/
function remove($name);
public function remove($name);

/**
* Clears the views.
*/
function clear();
public function clear();
}
5 changes: 2 additions & 3 deletions src/Pagerfanta/View/ViewInterface.php
Expand Up @@ -31,13 +31,12 @@ interface ViewInterface
* @param mixed $routeGenerator A callable to generate the routes.
* @param array $options An array of options (optional).
*/
function render(PagerfantaInterface $pagerfanta, $routeGenerator, array $options = array());
public function render(PagerfantaInterface $pagerfanta, $routeGenerator, array $options = array());

/**
* Returns the canonical name.
*
* @return string The canonical name.
*/
function getName();

public function getName();
}
Expand Up @@ -4,7 +4,7 @@

use Pagerfanta\Adapter\DoctrineCollectionAdapter;

class DoctrineCollectionTest extends \PHPUnit_Framework_TestCase
class DoctrineCollectionAdapterTest extends \PHPUnit_Framework_TestCase
{
private $collection;
private $adapter;
Expand Down
2 changes: 0 additions & 2 deletions tests/Pagerfanta/Tests/Adapter/DoctrineDbalAdapterTest.php
Expand Up @@ -2,9 +2,7 @@

namespace Pagerfanta\Tests\Adapter;

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Schema\Schema;
use Pagerfanta\Adapter\DoctrineDbalAdapter;

class DoctrineDbalAdapterTest extends DoctrineDbalTestCase
Expand Down
Expand Up @@ -2,9 +2,6 @@

namespace Pagerfanta\Tests\Adapter;

use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Schema\Schema;
use Pagerfanta\Adapter\DoctrineDbalSingleTableAdapter;

class DoctrineDbalSingleTableAdapterTest extends DoctrineDbalTestCase
Expand Down
3 changes: 1 addition & 2 deletions tests/Pagerfanta/Tests/Adapter/DoctrineDbalTestCase.php
Expand Up @@ -5,7 +5,6 @@
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Schema\Schema;
use Pagerfanta\Adapter\DoctrineDbalAdapter;

abstract class DoctrineDbalTestCase extends \PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -35,7 +34,7 @@ private function getConnection()
{
$params = $conn = array(
'driver' => 'pdo_sqlite',
'memory' => true
'memory' => true,
);

return DriverManager::getConnection($params);
Expand Down

0 comments on commit b8ec444

Please sign in to comment.