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

Update friendsofphp/php-cs-fixer requirement from ^2.19 to ^3.40 #1520

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ bin/vobject
bin/generate_vcards
bin/phpdocmd

# Assuming every .php file in the root is for testing
/*.php

# Other testing stuff
/tmpdata
/data
Expand All @@ -37,4 +34,4 @@ build.properties
docs/api
docs/wikidocs

.php_cs.cache
.php-cs-fixer.cache
2 changes: 1 addition & 1 deletion .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$config = PhpCsFixer\Config::create();
$config = new PhpCsFixer\Config();
$config->getFinder()
->exclude('vendor')
->in(__DIR__);
Expand Down
2 changes: 1 addition & 1 deletion bin/migrateto20.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

HELLO;

exit();
exit;
}

// There's a bunch of places where the autoloader could be, so we'll try all of
Expand Down
2 changes: 1 addition & 1 deletion bin/migrateto21.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

HELLO;

exit();
exit;
}

// There's a bunch of places where the autoloader could be, so we'll try all of
Expand Down
2 changes: 1 addition & 1 deletion bin/migrateto30.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

HELLO;

exit();
exit;
}

// There's a bunch of places where the autoloader could be, so we'll try all of
Expand Down
10 changes: 5 additions & 5 deletions bin/migrateto32.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

HELLO;

exit();
exit;
}

// There's a bunch of places where the autoloader could be, so we'll try all of
Expand Down Expand Up @@ -110,7 +110,7 @@
UNIQUE(calendarid, share_href)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
SQL
);
);
$pdo->exec('
INSERT INTO calendarinstances
(
Expand Down Expand Up @@ -159,7 +159,7 @@
UNIQUE (calendarid, share_href)
);
SQL
);
);
$pdo->exec('
INSERT INTO calendarinstances
(
Expand Down Expand Up @@ -233,7 +233,7 @@
components VARBINARY(21)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SQL
);
);
break;
case 'sqlite':
$pdo->exec(<<<SQL
Expand All @@ -243,7 +243,7 @@
components text NOT NULL
);
SQL
);
);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"require-dev" : {
"ext-sqlite3": "*",
"friendsofphp/php-cs-fixer": "^2.19",
"friendsofphp/php-cs-fixer": "^3.40",
"monolog/monolog": "^2.9",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
Expand Down
4 changes: 2 additions & 2 deletions examples/addressbookserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$authBackend = new Sabre\DAV\Auth\Backend\PDO($pdo);
$principalBackend = new Sabre\DAVACL\PrincipalBackend\PDO($pdo);
$carddavBackend = new Sabre\CardDAV\Backend\PDO($pdo);
//$caldavBackend = new Sabre\CalDAV\Backend\PDO($pdo);
// $caldavBackend = new Sabre\CalDAV\Backend\PDO($pdo);

// Setting up the directory tree //
$nodes = [
Expand All @@ -42,7 +42,7 @@
// Plugins
$server->addPlugin(new Sabre\DAV\Auth\Plugin($authBackend));
$server->addPlugin(new Sabre\DAV\Browser\Plugin());
//$server->addPlugin(new Sabre\CalDAV\Plugin());
// $server->addPlugin(new Sabre\CalDAV\Plugin());
$server->addPlugin(new Sabre\CardDAV\Plugin());
$server->addPlugin(new Sabre\DAVACL\Plugin());
$server->addPlugin(new Sabre\DAV\Sync\Plugin());
Expand Down
2 changes: 1 addition & 1 deletion examples/groupwareserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

// Logging
$server->setLogger($logger);
//$server->debugExceptions = true; //enable this to include the stacktrace in exception responses
// $server->debugExceptions = true; //enable this to include the stacktrace in exception responses

// Plugins
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend));
Expand Down
6 changes: 0 additions & 6 deletions lib/CalDAV/Backend/AbstractBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ abstract class AbstractBackend implements BackendInterface
* promise I can handle updating this property".
*
* Read the PropPatch documentation for more info and examples.
*
* @param mixed $calendarId
*/
public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch)
{
Expand All @@ -44,8 +42,6 @@ public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch)
*
* If the backend supports this, it may allow for some speed-ups.
*
* @param mixed $calendarId
*
* @return array
*/
public function getMultipleCalendarObjects($calendarId, array $uris)
Expand Down Expand Up @@ -100,8 +96,6 @@ public function getMultipleCalendarObjects($calendarId, array $uris)
* as possible, so it gives you a good idea on what type of stuff you need
* to think of.
*
* @param mixed $calendarId
*
* @return array
*/
public function calendarQuery($calendarId, array $filters)
Expand Down
16 changes: 0 additions & 16 deletions lib/CalDAV/Backend/BackendInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ public function getCalendarsForUser($principalUri);
*
* @param string $principalUri
* @param string $calendarUri
*
* @return mixed
*/
public function createCalendar($principalUri, $calendarUri, array $properties);

Expand All @@ -67,15 +65,11 @@ public function createCalendar($principalUri, $calendarUri, array $properties);
* promise I can handle updating this property".
*
* Read the PropPatch documentation for more info and examples.
*
* @param mixed $calendarId
*/
public function updateCalendar($calendarId, \Sabre\DAV\PropPatch $propPatch);

/**
* Delete a calendar and all its objects.
*
* @param mixed $calendarId
*/
public function deleteCalendar($calendarId);

Expand Down Expand Up @@ -107,8 +101,6 @@ public function deleteCalendar($calendarId);
* used/fetched to determine these numbers. If both are specified the
* amount of times this is needed is reduced by a great degree.
*
* @param mixed $calendarId
*
* @return array
*/
public function getCalendarObjects($calendarId);
Expand All @@ -125,7 +117,6 @@ public function getCalendarObjects($calendarId);
*
* This method must return null if the object did not exist.
*
* @param mixed $calendarId
* @param string $objectUri
*
* @return array|null
Expand All @@ -140,8 +131,6 @@ public function getCalendarObject($calendarId, $objectUri);
*
* If the backend supports this, it may allow for some speed-ups.
*
* @param mixed $calendarId
*
* @return array
*/
public function getMultipleCalendarObjects($calendarId, array $uris);
Expand All @@ -159,7 +148,6 @@ public function getMultipleCalendarObjects($calendarId, array $uris);
* calendar-data. If the result of a subsequent GET to this object is not
* the exact same as this request body, you should omit the ETag.
*
* @param mixed $calendarId

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having explicit docs about mixed types. it allowes the api user to differentiate where we accidentally forgot to define a type and where we explicitly declared mixed.

maybe this is a rule we could skip?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this is a rule we could skip?

agree - explicitly writing "mixed" means that someone should have thought about it and that mixed is really allowed.

https://cs.symfony.com/doc/rules/phpdoc/no_superfluous_phpdoc_tags.html

I pushed a commit to allow mixed PHPdoc tags.

but what do we do about existing places where mixed is in the PHPdoc?
For example, I doubt that $calendarId can be anything. It should have a better PHPdoc clue than mixed
So the existing places that have mixed in PHPdoc (and were auto-removed in this PR) maybe do not actually allow the full set of mixed as inputs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, I doubt that $calendarId can be anything. It should have a better PHPdoc clue than mixed

I assume we have releases with such phpdocs - which means I am fine with it.

separate PRs can be submitted to improve/narrow these places if possible.

* @param string $objectUri
* @param string $calendarData
*
Expand All @@ -180,7 +168,6 @@ public function createCalendarObject($calendarId, $objectUri, $calendarData);
* calendar-data. If the result of a subsequent GET to this object is not
* the exact same as this request body, you should omit the ETag.
*
* @param mixed $calendarId
* @param string $objectUri
* @param string $calendarData
*
Expand All @@ -193,7 +180,6 @@ public function updateCalendarObject($calendarId, $objectUri, $calendarData);
*
* The object uri is only the basename, or filename and not a full path.
*
* @param mixed $calendarId
* @param string $objectUri
*/
public function deleteCalendarObject($calendarId, $objectUri);
Expand Down Expand Up @@ -243,8 +229,6 @@ public function deleteCalendarObject($calendarId, $objectUri);
* as possible, so it gives you a good idea on what type of stuff you need
* to think of.
*
* @param mixed $calendarId
*
* @return array
*/
public function calendarQuery($calendarId, array $filters);
Expand Down