@@ -38,7 +38,7 @@ |
||
38 | 38 | protected function configure() |
39 | 39 | { |
40 | 40 | $this->setName('report:merchant') |
41 | - ->setDescription('Generate the merchant transactions report') |
|
41 | + ->setDescription('Generate the merchant transactions report') |
|
42 | 42 | ->addArgument( |
43 | 43 | 'merchant_id', |
44 | 44 | InputArgument::OPTIONAL, |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function __construct($csvFilePath) |
42 | 42 | { |
43 | - $this->csvFilePath = $csvFilePath; |
|
43 | + $this->csvFilePath = $csvFilePath; |
|
44 | 44 | |
45 | 45 | if (!ini_get("auto_detect_line_endings")) { |
46 | 46 | ini_set("auto_detect_line_endings", '1'); |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | foreach ($data as $item) { |
72 | 72 | $itemTime = $dateWorker->createFromFormat('d/m/Y', $item[1])->format('Y-m-d H:i:s'); |
73 | - if (null === $formattedDate || strtotime($formattedDate) - strtotime($itemTime) >= 0 ) { |
|
73 | + if (null === $formattedDate || strtotime($formattedDate) - strtotime($itemTime) >= 0) { |
|
74 | 74 | $symbol = mb_substr($item[2], 0, 1, 'UTF-8'); |
75 | 75 | $amount = mb_substr($item[2], 1); |
76 | 76 | $temp = array_merge($item, [$symbol, $amount]); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | switch ($originalCurrency) { |
31 | 31 | case 'GBP': |
32 | - switch($targetCurrency) { |
|
32 | + switch ($targetCurrency) { |
|
33 | 33 | case 'GBP': |
34 | 34 | $rate = 1.00; |
35 | 35 | break; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | break; |
46 | 46 | case 'USD': |
47 | - switch($targetCurrency) { |
|
47 | + switch ($targetCurrency) { |
|
48 | 48 | case 'GBP': |
49 | 49 | $rate = random_int(77, 82) / 100; |
50 | 50 | break; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } |
60 | 60 | break; |
61 | 61 | case 'EUR': |
62 | - switch($targetCurrency) { |
|
62 | + switch ($targetCurrency) { |
|
63 | 63 | case 'GBP': |
64 | 64 | $rate = random_int(85, 90) / 100; |
65 | 65 | break; |
@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | return array_filter( |
56 | 56 | $this->getTransactionRepository()->getTransactions(), |
57 | - function ($e) use ($merchantId) { |
|
57 | + function($e) use ($merchantId) { |
|
58 | 58 | return (int)$e[0] === (int)$merchantId; |
59 | 59 | } |
60 | 60 | ); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public static function array_intersect_recursive($array1, $array2) |
25 | 25 | { |
26 | - foreach($array1 as $key => $value) { |
|
26 | + foreach ($array1 as $key => $value) { |
|
27 | 27 | if (!isset($array2[$key])) { |
28 | 28 | unset($array1[$key]); |
29 | 29 | } else { |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) |
51 | 51 | { |
52 | - $this->fulfilled = (bool) $fulfilled; |
|
53 | - $this->testMessage = (string) $testMessage; |
|
54 | - $this->helpHtml = (string) $helpHtml; |
|
55 | - $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; |
|
56 | - $this->optional = (bool) $optional; |
|
52 | + $this->fulfilled = (bool)$fulfilled; |
|
53 | + $this->testMessage = (string)$testMessage; |
|
54 | + $this->helpHtml = (string)$helpHtml; |
|
55 | + $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string)$helpText; |
|
56 | + $this->optional = (bool)$optional; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -417,13 +417,13 @@ discard block |
||
417 | 417 | ); |
418 | 418 | |
419 | 419 | $this->addRequirement( |
420 | - is_dir(__DIR__.'/../vendor/composer'), |
|
420 | + is_dir(__DIR__ . '/../vendor/composer'), |
|
421 | 421 | 'Vendor libraries must be installed', |
422 | - 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. '. |
|
422 | + 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' . |
|
423 | 423 | 'Then run "<strong>php composer.phar install</strong>" to install them.' |
424 | 424 | ); |
425 | 425 | |
426 | - $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; |
|
426 | + $cacheDir = is_dir(__DIR__ . '/../var/cache') ? __DIR__ . '/../var/cache' : __DIR__ . '/cache'; |
|
427 | 427 | |
428 | 428 | $this->addRequirement( |
429 | 429 | is_writable($cacheDir), |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | 'Change the permissions of either "<strong>app/cache/</strong>" or "<strong>var/cache/</strong>" directory so that the web server can write into it.' |
432 | 432 | ); |
433 | 433 | |
434 | - $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; |
|
434 | + $logsDir = is_dir(__DIR__ . '/../var/logs') ? __DIR__ . '/../var/logs' : __DIR__ . '/logs'; |
|
435 | 435 | |
436 | 436 | $this->addRequirement( |
437 | 437 | is_writable($logsDir), |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | ); |
545 | 545 | } |
546 | 546 | |
547 | - $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; |
|
547 | + $pcreVersion = defined('PCRE_VERSION') ? (float)PCRE_VERSION : null; |
|
548 | 548 | |
549 | 549 | $this->addRequirement( |
550 | 550 | null !== $pcreVersion, |
@@ -564,13 +564,13 @@ discard block |
||
564 | 564 | |
565 | 565 | /* optional recommendations follow */ |
566 | 566 | |
567 | - if (file_exists(__DIR__.'/../vendor/composer')) { |
|
568 | - require_once __DIR__.'/../vendor/autoload.php'; |
|
567 | + if (file_exists(__DIR__ . '/../vendor/composer')) { |
|
568 | + require_once __DIR__ . '/../vendor/autoload.php'; |
|
569 | 569 | |
570 | 570 | try { |
571 | 571 | $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); |
572 | 572 | |
573 | - $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); |
|
573 | + $contents = file_get_contents(dirname($r->getFileName()) . '/Resources/skeleton/app/SymfonyRequirements.php'); |
|
574 | 574 | } catch (ReflectionException $e) { |
575 | 575 | $contents = ''; |
576 | 576 | } |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | $unit = ''; |
778 | 778 | if (!ctype_digit($size)) { |
779 | 779 | $unit = strtolower(substr($size, -1, 1)); |
780 | - $size = (int) substr($size, 0, -1); |
|
780 | + $size = (int)substr($size, 0, -1); |
|
781 | 781 | } |
782 | 782 | switch ($unit) { |
783 | 783 | case 'g': |
@@ -787,7 +787,7 @@ discard block |
||
787 | 787 | case 'k': |
788 | 788 | return $size * 1024; |
789 | 789 | default: |
790 | - return (int) $size; |
|
790 | + return (int)$size; |
|
791 | 791 | } |
792 | 792 | } |
793 | 793 | |
@@ -798,7 +798,7 @@ discard block |
||
798 | 798 | */ |
799 | 799 | protected function getPhpRequiredVersion() |
800 | 800 | { |
801 | - if (!file_exists($path = __DIR__.'/../composer.lock')) { |
|
801 | + if (!file_exists($path = __DIR__ . '/../composer.lock')) { |
|
802 | 802 | return false; |
803 | 803 | } |
804 | 804 | |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | continue; |
810 | 810 | } |
811 | 811 | |
812 | - return (int) $package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; |
|
812 | + return (int)$package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; |
|
813 | 813 | } |
814 | 814 | |
815 | 815 | return false; |