Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adjust code to make php-cs-fixer and phpstan pass #667

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

$start = microtime(true);

$lol = Sabre\VObject\Reader::read($data);
$lol = VObject\Reader::read($data);

echo 'time: '.(microtime(true) - $start)."\n";
6 changes: 3 additions & 3 deletions bin/bench_freebusygenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include __DIR__.'/../vendor/autoload.php';

if ($argc < 2) {
echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " freebusy benchmark\n";
echo 'sabre/vobject ', VObject\Version::VERSION, " freebusy benchmark\n";
echo "\n";
echo "This script can be used to measure the speed of generating a\n";
echo "free-busy report based on a calendar.\n";
Expand All @@ -19,7 +19,7 @@
$bench = new Hoa\Bench\Bench();
$bench->parse->start();

$vcal = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
$vcal = VObject\Reader::read(fopen($inputFile, 'r'));

$bench->parse->stop();

Expand All @@ -31,7 +31,7 @@
$bench->fb->start();

for ($i = 0; $i < $repeat; ++$i) {
$fb = new Sabre\VObject\FreeBusyGenerator($start, $end, $vcal, $timeZone);
$fb = new VObject\FreeBusyGenerator($start, $end, $vcal, $timeZone);
$results = $fb->getResult();
}
$bench->fb->stop();
Expand Down
4 changes: 2 additions & 2 deletions bin/bench_manipulatevcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include __DIR__.'/../vendor/autoload.php';

if ($argc < 2) {
echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " manipulation benchmark\n";
echo 'sabre/vobject ', 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";
Expand All @@ -17,7 +17,7 @@

$input = file_get_contents($inputFile);

$splitter = new Sabre\VObject\Splitter\VCard($input);
$splitter = new VObject\Splitter\VCard($input);

$bench = new Hoa\Bench\Bench();

Expand Down
4 changes: 2 additions & 2 deletions bin/rrulebench.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include __DIR__.'/../vendor/autoload.php';

if ($argc < 4) {
echo 'sabre/vobject ', Sabre\VObject\Version::VERSION, " RRULE benchmark\n";
echo 'sabre/vobject ', VObject\Version::VERSION, " RRULE benchmark\n";
echo "\n";
echo "This script can be used to measure the speed of the 'recurrence expansion'\n";
echo 'system.';
Expand All @@ -18,7 +18,7 @@
$bench->parse->start();

echo "Parsing.\n";
$vobj = Sabre\VObject\Reader::read(fopen($inputFile, 'r'));
$vobj = VObject\Reader::read(fopen($inputFile, 'r'));

$bench->parse->stop();

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"sabre/xml" : "^3.0 || ^4.0"
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "^3.54",
"friendsofphp/php-cs-fixer": "3.62.0",
"phpunit/phpunit" : "^9.6",
"phpunit/php-invoker" : "^2.0 || ^3.1",
"phpstan/phpstan": "^1.11"
"phpstan/phpstan": "^1.12"
},
"suggest" : {
"hoa/bench" : "If you would like to run the benchmark scripts"
Expand Down
10 changes: 6 additions & 4 deletions tests/VObject/ITip/BrokerDeleteEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Sabre\VObject\ITip;

use Sabre\VObject\Version;

class BrokerDeleteEventTest extends BrokerTester
{
public function testOrganizerDeleteWithDtend(): void
Expand All @@ -24,7 +26,7 @@ public function testOrganizerDeleteWithDtend(): void

$newMessage = null;

$version = \Sabre\VObject\Version::VERSION;
$version = Version::VERSION;

$expected = [
[
Expand Down Expand Up @@ -107,7 +109,7 @@ public function testOrganizerDeleteWithDuration(): void

$newMessage = null;

$version = \Sabre\VObject\Version::VERSION;
$version = Version::VERSION;

$expected = [
[
Expand Down Expand Up @@ -190,7 +192,7 @@ public function testAttendeeDeleteWithDtend(): void

$newMessage = null;

$version = \Sabre\VObject\Version::VERSION;
$version = Version::VERSION;

$expected = [
[
Expand Down Expand Up @@ -245,7 +247,7 @@ public function testAttendeeReplyWithDuration(): void

$newMessage = null;

$version = \Sabre\VObject\Version::VERSION;
$version = Version::VERSION;

$expected = [
[
Expand Down