[Pkg-owncloud-commits] [php-sabre-vobject] 333/341: Applied php-cs-fixer on bin/
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 13:36:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository php-sabre-vobject.
commit 87714ded64b415a8f1bcf70afb618d0caff3ace8
Author: Evert Pot <me at evertpot.com>
Date: Fri Jul 17 17:44:52 2015 -0400
Applied php-cs-fixer on bin/
---
bin/bench.php | 4 ++--
bin/bench_freebusygenerator.php | 8 ++++----
bin/bench_manipulatevcard.php | 8 ++++----
bin/fetch_windows_zones.php | 8 ++++----
bin/generateicalendardata.php | 27 +++++++++++++--------------
bin/rrulebench.php | 2 +-
6 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/bin/bench.php b/bin/bench.php
index b949c8e..807b407 100755
--- a/bin/bench.php
+++ b/bin/bench.php
@@ -5,8 +5,8 @@ include __DIR__ . '/../vendor/autoload.php';
$data = stream_get_contents(STDIN);
-$start = microtime(true);
+$start = microtime(true);
$lol = Sabre\VObject\Reader::read($data);
-echo "time: " . (microtime(true)-$start) . "\n";
+echo "time: " . (microtime(true) - $start) . "\n";
diff --git a/bin/bench_freebusygenerator.php b/bin/bench_freebusygenerator.php
index 0eb4666..2c51b2a 100644
--- a/bin/bench_freebusygenerator.php
+++ b/bin/bench_freebusygenerator.php
@@ -19,7 +19,7 @@ list(, $inputFile) = $argv;
$bench = new Hoa\Bench\Bench();
$bench->parse->start();
-$vcal = Sabre\VObject\Reader::read(fopen($inputFile,'r'));
+$vcal = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
$bench->parse->stop();
@@ -30,7 +30,7 @@ $timeZone = new \DateTimeZone('America/Toronto');
$bench->fb->start();
-for($i=0; $i<$repeat; $i++) {
+for ($i = 0; $i < $repeat; $i++) {
$fb = new Sabre\VObject\FreeBusyGenerator($start, $end, $vcal, $timeZone);
$results = $fb->getResult();
@@ -48,9 +48,9 @@ function formatMemory($input) {
return round($input / (1024 * 1024)) . 'M';
- } else if (strlen($input) > 3) {
+ } elseif (strlen($input) > 3) {
- return round($input/1024) . 'K';
+ return round($input / 1024) . 'K';
}
diff --git a/bin/bench_manipulatevcard.php b/bin/bench_manipulatevcard.php
index 518eb09..adc198e 100644
--- a/bin/bench_manipulatevcard.php
+++ b/bin/bench_manipulatevcard.php
@@ -6,7 +6,7 @@ if ($argc < 2) {
echo "sabre/vobject ", Sabre\VObject\Version::VERSION, " manipulation benchmark\n";
echo "\n";
echo "This script can be used to measure the speed of opening a large amount of\n";
- echo "vcards, making a few alterations and serializing them again.\n";
+ echo "vcards, making a few alterations and serializing them again.\n";
echo "system.";
echo "\n";
echo "Usage: " . $argv[0] . " inputfile.vcf\n";
@@ -32,7 +32,7 @@ while (true) {
$bench->manipulate->start();
$vcard->{'X-FOO'} = 'Random new value!';
$emails = [];
- if (isset($vcard->EMAIL)) foreach($vcard->EMAIL as $email) {
+ if (isset($vcard->EMAIL)) foreach ($vcard->EMAIL as $email) {
$emails[] = (string)$email;
}
$bench->manipulate->pause();
@@ -55,9 +55,9 @@ function formatMemory($input) {
return round($input / (1024 * 1024)) . 'M';
- } else if (strlen($input) > 3) {
+ } elseif (strlen($input) > 3) {
- return round($input/1024) . 'K';
+ return round($input / 1024) . 'K';
}
diff --git a/bin/fetch_windows_zones.php b/bin/fetch_windows_zones.php
index 88ca795..04c2eb9 100755
--- a/bin/fetch_windows_zones.php
+++ b/bin/fetch_windows_zones.php
@@ -10,9 +10,9 @@ $data = file_get_contents($windowsZonesUrl);
$xml = simplexml_load_string($data);
-$map = array();
+$map = [];
-foreach($xml->xpath('//mapZone') as $mapZone) {
+foreach ($xml->xpath('//mapZone') as $mapZone) {
$from = (string)$mapZone['other'];
$to = (string)$mapZone['type'];
@@ -28,13 +28,13 @@ foreach($xml->xpath('//mapZone') as $mapZone) {
ksort($map);
echo "Writing to: $outputFile\n";
-$f = fopen($outputFile,'w');
+$f = fopen($outputFile, 'w');
fwrite($f, "<?php\n\n");
fwrite($f, "/**\n");
fwrite($f, " * Automatically generated timezone file\n");
fwrite($f, " *\n");
fwrite($f, " * Last update: " . date(DATE_W3C) . "\n");
-fwrite($f, " * Source: " .$windowsZonesUrl . "\n");
+fwrite($f, " * Source: " . $windowsZonesUrl . "\n");
fwrite($f, " *\n");
fwrite($f, " * @copyright Copyright (C) 2007-2015 fruux GmbH (https://fruux.com/).\n");
fwrite($f, " * @license http://sabre.io/license/ Modified BSD License\n");
diff --git a/bin/generateicalendardata.php b/bin/generateicalendardata.php
index 92c8c10..eb55e10 100755
--- a/bin/generateicalendardata.php
+++ b/bin/generateicalendardata.php
@@ -3,7 +3,7 @@
use Sabre\VObject;
-if ($argc<2) {
+if ($argc < 2) {
$cmd = $argv[0];
fwrite(STDERR, <<<HI
Fruux test data generator
@@ -29,15 +29,15 @@ include __DIR__ . '/../vendor/autoload.php';
fwrite(STDERR, "Generating " . $events . " events\n");
-$currentDate = new DateTime('-' . round($events/2) . ' days');
+$currentDate = new DateTime('-' . round($events / 2) . ' days');
$calendar = VObject\Component::create('VCALENDAR');
$calendar->version = '2.0';
$calendar->calscale = 'GREGORIAN';
-$ii=0;
+$ii = 0;
-while($ii < $events) {
+while ($ii < $events) {
$ii++;
@@ -46,32 +46,32 @@ while($ii < $events) {
$event->SUMMARY = 'Event #' . $ii;
$event->UID = md5(microtime(true));
- $doctorRandom = mt_rand(1,1000);
+ $doctorRandom = mt_rand(1, 1000);
- switch($doctorRandom) {
+ switch ($doctorRandom) {
// All-day event
- case 1 :
+ case 1 :
$event->DTEND = 'bla';
$dtStart = clone $currentDate;
$dtEnd = clone $currentDate;
- $dtEnd->modify('+' . mt_rand(1,3) . ' days');
+ $dtEnd->modify('+' . mt_rand(1, 3) . ' days');
$event->DTSTART->setDateTime($dtStart, VObject\Property\DateTime::DATE);
$event->DTEND->setDateTime($dtEnd, VObject\Property\DateTime::DATE);
break;
case 2 :
- $event->RRULE = 'FREQ=DAILY;COUNT=' . mt_rand(1,10);
+ $event->RRULE = 'FREQ=DAILY;COUNT=' . mt_rand(1, 10);
// No break intentional
default :
$dtStart = clone $currentDate;
- $dtStart->setTime(mt_rand(1,23), mt_rand(0,59), mt_rand(0,59));
+ $dtStart->setTime(mt_rand(1, 23), mt_rand(0, 59), mt_rand(0, 59));
$event->DTSTART->setDateTime($dtStart, VObject\Property\DateTime::UTC);
- $event->DURATION = 'PT'.mt_rand(1,3).'H';
+ $event->DURATION = 'PT' . mt_rand(1, 3) . 'H';
break;
}
$calendar->add($event);
- $currentDate->modify('+ ' . mt_rand(0,3) . ' days');
+ $currentDate->modify('+ ' . mt_rand(0, 3) . ' days');
}
fwrite(STDERR, "Validating\n");
@@ -79,7 +79,7 @@ fwrite(STDERR, "Validating\n");
$result = $calendar->validate();
if ($result) {
fwrite(STDERR, "Errors!\n");
- fwrite(STDERR, print_r($result,true));
+ fwrite(STDERR, print_r($result, true));
die(-1);
}
@@ -88,4 +88,3 @@ fwrite(STDERR, "Serializing this beast\n");
echo $calendar->serialize();
fwrite(STDERR, "done.\n");
-
diff --git a/bin/rrulebench.php b/bin/rrulebench.php
index f151819..af26b47 100644
--- a/bin/rrulebench.php
+++ b/bin/rrulebench.php
@@ -18,7 +18,7 @@ $bench = new Hoa\Bench\Bench();
$bench->parse->start();
echo "Parsing.\n";
-$vobj = Sabre\VObject\Reader::read(fopen($inputFile,'r'));
+$vobj = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
$bench->parse->stop();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabre-vobject.git
More information about the Pkg-owncloud-commits
mailing list