Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Sep 12, 2014
1 parent 026d407 commit faab6dd
Show file tree
Hide file tree
Showing 60 changed files with 30 additions and 119 deletions.
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Console/ApplicationFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ public function it_should_extend_Symfony_Console_Application()
{
$this->shouldHaveType('\Zend\ServiceManager\FactoryInterface');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ public function it_should_extend_Symfony_Console_Command()
{
$this->shouldBeAnInstanceOf('Symfony\Component\Console\Command\Command');
}

}
2 changes: 0 additions & 2 deletions spec/Phpro/SmartCrud/Console/Helper/AbstractHelperSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

abstract class AbstractHelperSpec extends ObjectBehavior
{

public function it_should_extend_from_symfony_helper()
{
$this->shouldBeAnInstanceOf('Symfony\Component\Console\Helper\Helper');
Expand All @@ -34,5 +33,4 @@ protected function mockConfig($config)
$helperSet->get('Config')->willReturn($helper);
$this->setHelperSet($helperSet);
}

}
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Console/Helper/ConfigHelperSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ public function it_should_load_application_config_from_servicemanager()
$this->mockApplicationConfig('ApplicationConfig', $config);
$this->getApplicationConfig()->shouldBe($config);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ public function it_should_know_the_default_gateway()
);
$this->getDefault()->shouldBe('default.key');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ public function it_should_load_a_modules_list()
$list->shouldBeArray();
$list[0]->shouldBe('SampleModule');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

class ServiceManagerHelperSpec extends AbstractHelperSpec
{

/**
* @param \Zend\ServiceManager\ServiceManager $serviceManager
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

class AbstractCrudControllerFactorySpec extends ObjectBehavior
{

/**
* @param \Zend\Mvc\Controller\ControllerManager $controllerManager
* @param \Zend\ServiceManager\ServiceLocatorInterface $serviceLocator
Expand Down Expand Up @@ -193,5 +192,4 @@ public function it_should_throw_exception_when_service_does_not_exist($controlle
$this->shouldThrow('Phpro\SmartCrud\Exception\SmartCrudException')
->duringCreateServiceWithName($controllerManager, $name, $name);
}

}
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Controller/CrudControllerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/
class CrudControllerSpec extends ObjectBehavior
{

public function let()
{
$this->setIdentifierName('id');
Expand Down
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Event/CrudEventSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
class CrudEventSpec extends ObjectBehavior
{

/**
* @param \stdClass $entity
*/
Expand Down
2 changes: 0 additions & 2 deletions spec/Phpro/SmartCrud/Gateway/AbstractGatewayFactorySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public function mockBaseGateway($serviceLocator, $gateway)
*/
public function it_should_be_able_to_create_gateway_services($serviceLocator)
{

$this->mockConfiguration($serviceLocator);
$name = 'custom-gateway';
$this->canCreateServiceWithName($serviceLocator, $name, $name)->shouldReturn(true);
Expand Down Expand Up @@ -107,5 +106,4 @@ public function it_should_throw_exception_when_base_gateway_does_not_exist($serv
$this->shouldThrow('Phpro\SmartCrud\Exception\SmartCrudException')
->duringCreateServiceWithName($serviceLocator, $name, $name);
}

}
2 changes: 0 additions & 2 deletions spec/Phpro/SmartCrud/Gateway/DoctrineCrudGatewaySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
class DoctrineCrudGatewaySpec extends ObjectBehavior
{

public function it_is_initializable()
{
$this->shouldHaveType('Phpro\SmartCrud\Gateway\DoctrineCrudGateway');
Expand Down Expand Up @@ -180,5 +179,4 @@ public function it_should_not_delete_invalid_entity($objectManager, $entity)

$this->delete($entity, array())->shouldReturn(false);
}

}
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Gateway/ZendDbCrudGatewaySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ public function it_should_implement_Phpro_SmartCrud_CrudGatewayInterface()
{
$this->shouldBeAnInstanceOf('Phpro\SmartCrud\Gateway\CrudGatewayInterface');
}

}
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Listener/BjyAuthorizeSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

class BjyAuthorizeSpec extends ObjectBehavior
{

/**
* @param \BjyAuthorize\Service\Authorize $authorizeService
*/
Expand Down
3 changes: 0 additions & 3 deletions spec/Phpro/SmartCrud/Listener/FlashMessengerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
class FlashMessengerSpec extends ObjectBehavior
{

/**
* Mock the flashmessenger
*
Expand Down Expand Up @@ -125,7 +124,6 @@ public function it_should_add_delete_succeeded_message($flashMessenger, $event)

$this->deleteSucceeded($event);
$flashMessenger->addSuccessMessage(Argument::type('string'))->shouldBeCalled();

}

/**
Expand Down Expand Up @@ -163,5 +161,4 @@ public function it_should_add_delete_failed_message($flashMessenger, $event)
$this->deleteFailed($event);
$flashMessenger->addErrorMessage(Argument::type('string'))->shouldBeCalled();
}

}
2 changes: 0 additions & 2 deletions spec/Phpro/SmartCrud/ModuleSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

class ModuleSpec extends ObjectBehavior
{

public function it_is_initializable()
{
$this->shouldHaveType('Phpro\SmartCrud\Module');
Expand Down Expand Up @@ -71,5 +70,4 @@ public function it_should_configure_cli($event, $cli, $serviceManager, $helperSe
$cli->addCommands(Argument::type('array'))->shouldBeCalled();
$helperSet->set(Argument::cetera())->shouldBeCalled();
}

}
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Query/DoctrineProviderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ public function it_should_create_a_list($repository, $queryBuilder, $query)

$this->createQuery(array())->shouldReturn($query);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ public function it_should_check_if_service_can_be_created($serviceLocator)
public function it_should_create_a_service_and_inject_the_dependencies(
$serviceLocator, $smartService, $eventManager, $listener, $crudGateway, $form, $parameterService)
{

$name = "Create service";
$requestedName = 'key_in_configuration';
$serviceKey = 'module/service';
Expand Down Expand Up @@ -205,7 +204,5 @@ public function it_should_create_a_service_and_inject_the_dependencies(

$eventManager->attach($listener)->shouldBeCalled();
$this->createServiceWithName($serviceLocator, $name, $requestedName . '::' . 'create')->shouldReturn($smartService);

}

}
2 changes: 0 additions & 2 deletions spec/Phpro/SmartCrud/Service/AbstractSmartServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/
abstract class AbstractSmartServiceSpec extends ObjectBehavior
{

/**
* @param array $paramsData
*
Expand Down Expand Up @@ -127,5 +126,4 @@ public function it_should_create_crud_event($entity)
$crudEvent->getTarget()->shouldReturn($entity);
$crudEvent->getParams()->shouldReturn($this->getParameters());
}

}
10 changes: 6 additions & 4 deletions spec/Phpro/SmartCrud/Service/CreateServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
class CreateServiceSpec extends AbstractSmartServiceSpec
{

public function it_is_initializable()
{
$this->shouldHaveType('Phpro\SmartCrud\Service\CreateService');
Expand Down Expand Up @@ -53,7 +52,8 @@ public function it_should_handle_no_data($gateway, $eventManager, $form, $result
$this->setGateway($gateway);
$this->setForm($form);

$this->run(null,null)->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');;
$this->run(null,null)->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');
;
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_VALIDATION))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_CREATE))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_CREATE))->shouldNotBeCalled();
Expand Down Expand Up @@ -83,7 +83,8 @@ public function it_should_handle_invalid_data($gateway, $eventManager, $form, $r
$this->setGateway($gateway);
$this->setForm($form);

$this->run(null,$this->getMockPostData())->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');;
$this->run(null,$this->getMockPostData())->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');
;
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_VALIDATION))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_CREATE))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_CREATE))->shouldNotBeCalled();
Expand Down Expand Up @@ -119,7 +120,8 @@ public function it_should_handle_valid_data($gateway, $eventManager, $form, $res
$this->setResult($result);
$this->setForm($form);

$this->run(null,$this->getMockPostData())->shouldReturn($result);;
$this->run(null,$this->getMockPostData())->shouldReturn($result);
;
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_VALIDATION))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_CREATE))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_CREATE))->shouldBeCalled();
Expand Down
7 changes: 4 additions & 3 deletions spec/Phpro/SmartCrud/Service/DeleteServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
class DeleteServiceSpec extends AbstractSmartServiceSpec
{

public function it_is_initializable()
{
$this->shouldHaveType('Phpro\SmartCrud\Service\DeleteService');
Expand All @@ -46,7 +45,8 @@ public function it_should_handle_invalid_data($gateway, $eventManager, $form, $r
$this->setGateway($gateway);
$this->setForm($form);

$this->run(null,$this->getMockPostData())->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');;
$this->run(null,$this->getMockPostData())->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');
;
$eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_DELETE))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DELETE))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::AFTER_DELETE))->shouldNotBeCalled();
Expand Down Expand Up @@ -74,7 +74,8 @@ public function it_should_handle_valid_data($gateway, $eventManager, $form, $res
$this->setResult($result);
$this->setForm($form);

$this->run(null,$this->getMockPostData())->shouldReturn($result);;
$this->run(null,$this->getMockPostData())->shouldReturn($result);
;
$eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_DELETE))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DELETE))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::AFTER_DELETE))->shouldBeCalled();
Expand Down
5 changes: 2 additions & 3 deletions spec/Phpro/SmartCrud/Service/ListServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
class ListServiceSpec extends AbstractSmartServiceSpec
{

/**
* @param \Phpro\SmartCrud\Gateway\CrudGatewayInterface $gateway
* @param \Zend\EventManager\EventManager $eventManager
Expand Down Expand Up @@ -99,7 +98,8 @@ public function it_should_return_a_result($gateway, $eventManager, $paginatorFac
$this->setGateway($gateway);
$this->setResult($result);

$this->run(Argument::any(), $getData)->shouldReturn($result);;
$this->run(Argument::any(), $getData)->shouldReturn($result);
;
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_LIST))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::AFTER_LIST))->shouldBeCalled();
}
Expand All @@ -117,5 +117,4 @@ public function it_should_create_paginator($paginatorFactory, $paginator)

$this->getPaginator($records, $params)->shouldReturn($paginator);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ public function it_should_create_paginator()
$paginator->getCurrentPageNumber()->shouldReturn($pageNumber);
$paginator->getItemCountPerPage()->shouldReturn($itemCount);
}

}
2 changes: 0 additions & 2 deletions spec/Phpro/SmartCrud/Service/ParametersServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function it_should_return_params_plugin($serviceLocator, $request, $contr
$this->mockServiceLocator($serviceLocator, $request, $controller, $params);
$this->createService($serviceLocator)->shouldReturn($this);
$controller->plugin('params')->shouldBeCalled();

}

/**
Expand Down Expand Up @@ -164,5 +163,4 @@ public function it_should_load_route_data_from_plugin($serviceLocator, $request,
$this->fromRoute('key', 'default');
$params->fromRoute('key', 'default')->shouldBeCalled();
}

}
5 changes: 2 additions & 3 deletions spec/Phpro/SmartCrud/Service/ReadServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
class ReadServiceSpec extends AbstractSmartServiceSpec
{

public function it_is_initializable()
{
$this->shouldHaveType('Phpro\SmartCrud\Service\ReadService');
Expand Down Expand Up @@ -51,10 +50,10 @@ public function it_should_return_a_result($gateway, $eventManager, $result)
$this->setGateway($gateway);
$this->setResult($result);

$this->run($entity->id, $postData)->shouldReturn($result);;
$this->run($entity->id, $postData)->shouldReturn($result);
;
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_VALIDATION))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_READ))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::AFTER_READ))->shouldBeCalled();
}

}
1 change: 0 additions & 1 deletion spec/Phpro/SmartCrud/Service/SmartServiceResultSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
class SmartServiceResultSpec extends ObjectBehavior
{

public function it_is_initializable()
{
$this->shouldHaveType('Phpro\SmartCrud\Service\SmartServiceResult');
Expand Down
7 changes: 4 additions & 3 deletions spec/Phpro/SmartCrud/Service/UpdateServiceSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
*/
class UpdateServiceSpec extends AbstractSmartServiceSpec
{

public function it_is_initializable()
{
$this->shouldHaveType('Phpro\SmartCrud\Service\UpdateService');
Expand Down Expand Up @@ -54,7 +53,8 @@ public function it_should_handle_no_data($gateway, $eventManager, $form, $result
$this->setGateway($gateway);
$this->setForm($form);

$this->run($entity->id,null)->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');;
$this->run($entity->id,null)->shouldReturnAnInstanceOf('Phpro\SmartCrud\Service\SmartServiceResult');
;
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_VALIDATION))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_UPDATE))->shouldNotBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_UPDATE))->shouldNotBeCalled();
Expand Down Expand Up @@ -91,7 +91,8 @@ public function it_should_handle_invalid_data($gateway, $eventManager,$form, $re
$this->setResult($result);
$this->setForm($form);

$this->run($entity->id, $this->getMockPostData())->shouldReturn($result);;
$this->run($entity->id, $this->getMockPostData())->shouldReturn($result);
;
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_DATA_VALIDATION))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::INVALID_UPDATE))->shouldBeCalled();
$eventManager->trigger(Argument::which('getName', CrudEvent::BEFORE_UPDATE))->shouldNotBeCalled();
Expand Down
2 changes: 0 additions & 2 deletions src/Phpro/SmartCrud/Console/ApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
class ApplicationFactory implements FactoryInterface
{

/**
* @var \Zend\EventManager\EventManagerInterface
*/
Expand Down Expand Up @@ -69,5 +68,4 @@ public function createService(ServiceLocatorInterface $sl)

return $cli;
}

}
2 changes: 0 additions & 2 deletions src/Phpro/SmartCrud/Console/Command/Controller/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ protected function getGatewayClass(OutputInterface $output)
*/
protected function parseConfig($gateway, $routePrefix, $controller, $entity, $form)
{

$entitySuffix = ltrim($entity, '\\');
$serviceKey = 'SmartCrudService\\' . $entitySuffix;
$controllerKey = 'SmartCrudController\\' . $entitySuffix;
Expand Down Expand Up @@ -293,5 +292,4 @@ protected function writeConfig($module, $config)

return $file;
}

}
1 change: 0 additions & 1 deletion src/Phpro/SmartCrud/Console/Helper/ConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
class ConfigHelper extends Helper
{

/**
* @return array
*/
Expand Down
Loading

0 comments on commit faab6dd

Please sign in to comment.