Skip to content

Commit

Permalink
Fixed code checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
eko committed Dec 12, 2015
1 parent 034fb2c commit 4326cb6
Show file tree
Hide file tree
Showing 93 changed files with 344 additions and 345 deletions.
6 changes: 3 additions & 3 deletions Controller/WordpressController.php
Expand Up @@ -13,7 +13,7 @@
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

/**
* Class WordpressController
* Class WordpressController.
*
* This is the controller to render Wordpress content
*
Expand All @@ -22,7 +22,7 @@
class WordpressController extends Controller
{
/**
* Wordpress catch-all route action
* Wordpress catch-all route action.
*
* @return \Ekino\WordpressBundle\Wordpress\WordpressResponse
*/
Expand All @@ -32,7 +32,7 @@ public function catchAllAction()
}

/**
* Returns Wordpress service
* Returns Wordpress service.
*
* @return \Ekino\WordpressBundle\Wordpress\Wordpress
*/
Expand Down
18 changes: 9 additions & 9 deletions DependencyInjection/Compiler/RegisterMappingsPass.php
Expand Up @@ -11,13 +11,13 @@

namespace Ekino\WordpressBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;

/**
* Class RegisterMappingsPass
* Class RegisterMappingsPass.
*
* This compiler pass registers the bundle schema with the Doctrine one
*
Expand Down Expand Up @@ -82,20 +82,20 @@ public function process(ContainerBuilder $container)
$chainDriverDef = $container->getDefinition($chainDriverDefService);

foreach ($this->namespaces as $namespace) {
$chainDriverDef->addMethodCall('addDriver', array($this->driver, $namespace));
$chainDriverDef->addMethodCall('addDriver', [$this->driver, $namespace]);
}
}

/**
* @param ContainerBuilder $container
*
* @return string
*
* @throws \Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException
*
* @return string
*/
protected function getChainDriverServiceName(ContainerBuilder $container)
{
foreach (array('ekino_wordpress.model_manager_name', $this->fallbackManagerParameter) as $param) {
foreach (['ekino_wordpress.model_manager_name', $this->fallbackManagerParameter] as $param) {
if ($container->hasParameter($param)) {
$name = $container->getParameter($param);
if ($name) {
Expand All @@ -114,10 +114,10 @@ protected function getChainDriverServiceName(ContainerBuilder $container)
*/
public static function createOrmMappingDriver(array $mappings)
{
$arguments = array($mappings, '.orm.xml');
$arguments = [$mappings, '.orm.xml'];
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator', $arguments);
$driver = new Definition('Doctrine\ORM\Mapping\Driver\XmlDriver', array($locator));
$driver = new Definition('Doctrine\ORM\Mapping\Driver\XmlDriver', [$locator]);

return new RegisterMappingsPass($driver, 'doctrine.orm.%s_metadata_driver', $mappings, 'ekino_wordpress.backend_type_orm', 'doctrine.default_entity_manager');
return new self($driver, 'doctrine.orm.%s_metadata_driver', $mappings, 'ekino_wordpress.backend_type_orm', 'doctrine.default_entity_manager');
}
}
10 changes: 4 additions & 6 deletions DependencyInjection/Configuration.php
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
* Configuration
* Configuration.
*
* This class generates configuration settings tree
*
Expand All @@ -24,7 +24,7 @@
class Configuration implements ConfigurationInterface
{
/**
* Builds configuration tree
* Builds configuration tree.
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder A tree builder instance
*/
Expand Down Expand Up @@ -54,8 +54,7 @@ public function getConfigTreeBuilder()
->scalarNode('login_url')->defaultValue('/wp-login.php')->end()
->end()
->end()
->end()
;
->end();

$this->addServicesSection($rootNode);

Expand Down Expand Up @@ -161,7 +160,6 @@ protected function addServicesSection(ArrayNodeDefinition $node)
->end()
->end()
->end()
->end()
;
->end();
}
}
18 changes: 9 additions & 9 deletions DependencyInjection/EkinoWordpressExtension.php
Expand Up @@ -11,14 +11,14 @@
namespace Ekino\WordpressBundle\DependencyInjection;

use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Config\FileLocator;

/**
* Class EkinoWordpressExtension
* Class EkinoWordpressExtension.
*
* This is the bundle Symfony extension class
*
Expand All @@ -29,7 +29,7 @@ class EkinoWordpressExtension extends Extension
/**
* @var array
*/
protected static $entities = array(
protected static $entities = [
'comment',
'comment_meta',
'link',
Expand All @@ -41,10 +41,10 @@ class EkinoWordpressExtension extends Extension
'term_taxonomy',
'user',
'user_meta',
);
];

/**
* Loads configuration
* Loads configuration.
*
* @param array $configs A configuration array
* @param ContainerBuilder $container Symfony container builder
Expand Down Expand Up @@ -130,7 +130,7 @@ protected function loadTablePrefix(ContainerBuilder $container, $prefix)
$identifier = 'ekino.wordpress.subscriber.table_prefix_subscriber';

$serviceDefinition = $container->getDefinition($identifier);
$serviceDefinition->setArguments(array($prefix));
$serviceDefinition->setArguments([$prefix]);

$container->setDefinition($identifier, $serviceDefinition);
}
Expand Down Expand Up @@ -174,14 +174,14 @@ protected function loadEntityManager(ContainerBuilder $container, $em)
*/
protected function loadWordpressGlobals(ContainerBuilder $container, $globals)
{
$coreGlobals = array('wp', 'wp_the_query', 'wpdb', 'wp_query', 'allowedentitynames');
$globals = array_merge($globals, $coreGlobals);
$coreGlobals = ['wp', 'wp_the_query', 'wpdb', 'wp_query', 'allowedentitynames'];
$globals = array_merge($globals, $coreGlobals);

$container->findDefinition('ekino.wordpress.wordpress')->replaceArgument(1, $globals);
}

/**
* Returns bundle alias name
* Returns bundle alias name.
*
* @return string
*/
Expand Down
6 changes: 3 additions & 3 deletions EkinoWordpressBundle.php
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\HttpKernel\Bundle\Bundle;

/**
* Class EkinoWordpressBundle
* Class EkinoWordpressBundle.
*
* This is the main Symfony bundle class
*
Expand All @@ -38,9 +38,9 @@ public function build(ContainerBuilder $container)
*/
public function addRegisterMappingPass(ContainerBuilder $containerBuilder)
{
$mappings = array(
$mappings = [
realpath(__DIR__.'/Resources/config/doctrine/model') => 'Ekino\WordpressBundle\Model',
);
];

$containerBuilder->addCompilerPass(RegisterMappingsPass::createOrmMappingDriver($mappings));
}
Expand Down
2 changes: 1 addition & 1 deletion Entity/Comment.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\Comment as CommentModel;

/**
* Class Comment
* Class Comment.
*
* This is the Comment entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/CommentMeta.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\CommentMeta as CommentMetaModel;

/**
* Class CommentMeta
* Class CommentMeta.
*
* This is the CommentMeta entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/Link.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\Link as LinkModel;

/**
* Class Link
* Class Link.
*
* This is the Link entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/Option.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\Option as OptionModel;

/**
* Class Option
* Class Option.
*
* This is the Option entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/Post.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\Post as PostModel;

/**
* Class Post
* Class Post.
*
* This is the Post entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/PostMeta.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\PostMeta as PostMetaModel;

/**
* Class PostMeta
* Class PostMeta.
*
* This is the PostMeta entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/Term.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\Term as TermModel;

/**
* Class Term
* Class Term.
*
* This is the Term entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/TermRelationships.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\TermRelationships as TermRelationshipsModel;

/**
* Class TermRelationships
* Class TermRelationships.
*
* This is the TermRelationships entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/TermTaxonomy.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\TermTaxonomy as TermTaxonomyModel;

/**
* Class TermTaxonomy
* Class TermTaxonomy.
*
* This is the TermTaxonomy entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/User.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\User as UserModel;

/**
* Class User
* Class User.
*
* This is the User entity
*
Expand Down
2 changes: 1 addition & 1 deletion Entity/UserMeta.php
Expand Up @@ -13,7 +13,7 @@
use Ekino\WordpressBundle\Model\UserMeta as UserMetaModel;

/**
* Class UserMeta
* Class UserMeta.
*
* This is the UserMeta entity
*
Expand Down
24 changes: 12 additions & 12 deletions Event/Hook/UserHookListener.php
Expand Up @@ -10,15 +10,15 @@

namespace Ekino\WordpressBundle\Event\Hook;

use Psr\Log\LoggerInterface;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Ekino\WordpressBundle\Event\WordpressEvent;
use Ekino\WordpressBundle\Manager\UserManager;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;

/**
* Class UserHookListener
* Class UserHookListener.
*
* This is a hook class that catch some user events fired by Wordpress
*
Expand Down Expand Up @@ -52,7 +52,7 @@ class UserHookListener
protected $firewall;

/**
* Constructor
* Constructor.
*
* @param UserManager $userManager Wordpress bundle user manager
* @param LoggerInterface $logger Symfony PSR logger
Expand All @@ -62,15 +62,15 @@ class UserHookListener
*/
public function __construct(UserManager $userManager, LoggerInterface $logger, TokenStorageInterface $tokenStorage, SessionInterface $session, $firewall)
{
$this->userManager = $userManager;
$this->logger = $logger;
$this->userManager = $userManager;
$this->logger = $logger;
$this->tokenStorage = $tokenStorage;
$this->session = $session;
$this->firewall = $firewall;
$this->session = $session;
$this->firewall = $firewall;
}

/**
* Wordpress user login hook method
* Wordpress user login hook method.
*
* @param WordpressEvent $event
*
Expand All @@ -90,7 +90,7 @@ public function onLogin(WordpressEvent $event)
}

/**
* Wordpress user log out hook method
* Wordpress user log out hook method.
*
* @param WordpressEvent $event
*
Expand Down

0 comments on commit 4326cb6

Please sign in to comment.