Skip to content

Commit

Permalink
Add phpcs to travis build process, fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
AydinHassan committed May 5, 2014
1 parent afcf700 commit 5a5dada
Show file tree
Hide file tree
Showing 21 changed files with 262 additions and 198 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ before_script:
- mkdir -p build/logs

script:
- ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
- ./vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml
- ./vendor/bin/phpcs --standard=PSR2 ./src/

after_script:
- php vendor/bin/coveralls -v
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"require-dev": {
"phpunit/phpunit": "4.0.*",
"squizlabs/php_codesniffer": "1.4.*",
"satooshi/php-coveralls": "dev-master"
},
"repositories": [
Expand Down
139 changes: 105 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/JhFlexiTime/Controller/BookingAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,4 @@ public function viewAction()

return $viewModel;
}


}
}
2 changes: 0 additions & 2 deletions src/JhFlexiTime/Controller/BookingRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,4 @@ public function delete($id)
'weekTotals' => $this->timeCalculatorService->getWeekTotals($user, $booking->getDate())
));
}


}
8 changes: 4 additions & 4 deletions src/JhFlexiTime/Controller/GetSetDateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Zend\Validator\Date as DateValidator;


/**
* Class GetSetDateTrait
* @author Aydin Hassan <aydin@hotmail.co.uk>
Expand All @@ -21,9 +20,10 @@ trait GetSetDateTrait
* @param string $year
* @return \DateTime
*/
public function getDate($month = null, $year = null) {
public function getDate($month = null, $year = null)
{

if(!$this->date) {
if (!$this->date) {
$validator = new DateValidator(array('format' => 'M Y'));
if ($validator->isValid(sprintf("%s %s", $month, $year))) {
$period = new \DateTime(sprintf('last day of %s %s 23:59:59', $month, $year));
Expand All @@ -43,4 +43,4 @@ public function setDate(\DateTime $date)
{
$this->date = $date;
}
}
}
14 changes: 10 additions & 4 deletions src/JhFlexiTime/Controller/RunningBalanceCliController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ class RunningBalanceCliController extends AbstractActionController
* @param RunningBalanceService $runningBalanceService
* @param AdapterInterface $console
*/
public function __construct(UserRepositoryInterface $userRepository, RunningBalanceService $runningBalanceService, AdapterInterface $console)
{
public function __construct(
UserRepositoryInterface $userRepository,
RunningBalanceService $runningBalanceService,
AdapterInterface $console
) {
$this->userRepository = $userRepository;
$this->runningBalanceService = $runningBalanceService;
$this->console = $console;
Expand All @@ -51,7 +54,7 @@ public function reCalcRunningBalanceAction()
$request = $this->getRequest();
$email = $request->getParam('userEmail');

if($email) {
if ($email) {
$user = $this->userRepository->findOneByEmail($email);

if (!$user) {
Expand All @@ -75,7 +78,10 @@ public function reCalcRunningBalanceAction()
*/
public function calcPrevMonthBalanceAction()
{
$this->console->writeLine("Calculating Running Balance for all Users for previous month", ColorInterface::GREEN);
$this->console->writeLine(
"Calculating Running Balance for all Users for previous month",
ColorInterface::GREEN
);
$this->runningBalanceService->calculatePreviousMonthBalance();
$this->console->writeLine("Finished! ", ColorInterface::GREEN);
}
Expand Down
2 changes: 1 addition & 1 deletion src/JhFlexiTime/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getAction()
'settings' => $this->bookingOptions,
));
}
}
}

0 comments on commit 5a5dada

Please sign in to comment.