mirror of
https://codeberg.org/icewind/SearchDAV.git
synced 2026-08-02 12:14:54 +02:00
switch to PSR12 base for formatting
This commit is contained in:
parent
9dbcdfb741
commit
cbff3d0764
29 changed files with 107 additions and 49 deletions
|
|
@ -5,7 +5,7 @@ $finder = PhpCsFixer\Finder::create()
|
||||||
;
|
;
|
||||||
return (new PhpCsFixer\Config())
|
return (new PhpCsFixer\Config())
|
||||||
->setRules([
|
->setRules([
|
||||||
'@PSR2' => true,
|
'@PSR12' => true,
|
||||||
'array_syntax' => ['syntax' => 'short'],
|
'array_syntax' => ['syntax' => 'short'],
|
||||||
'braces_position' => [
|
'braces_position' => [
|
||||||
'functions_opening_brace' => 'same_line',
|
'functions_opening_brace' => 'same_line',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -22,14 +24,14 @@
|
||||||
namespace SearchDAV\Backend;
|
namespace SearchDAV\Backend;
|
||||||
|
|
||||||
class SearchPropertyDefinition {
|
class SearchPropertyDefinition {
|
||||||
const XS = '{http://www.w3.org/2001/XMLSchema}';
|
public const XS = '{http://www.w3.org/2001/XMLSchema}';
|
||||||
const DATATYPE_STRING = self::XS . 'string';
|
public const DATATYPE_STRING = self::XS . 'string';
|
||||||
const DATATYPE_INTEGER = self::XS . 'integer';
|
public const DATATYPE_INTEGER = self::XS . 'integer';
|
||||||
const DATATYPE_NONNEGATIVE_INTEGER = self::XS . 'nonNegativeInteger';
|
public const DATATYPE_NONNEGATIVE_INTEGER = self::XS . 'nonNegativeInteger';
|
||||||
const DATATYPE_NON_NEGATIVE_INTEGER = self::XS . 'nonNegativeInteger';
|
public const DATATYPE_NON_NEGATIVE_INTEGER = self::XS . 'nonNegativeInteger';
|
||||||
const DATATYPE_DECIMAL = self::XS . 'decimal';
|
public const DATATYPE_DECIMAL = self::XS . 'decimal';
|
||||||
const DATATYPE_DATETIME = self::XS . 'dateTime';
|
public const DATATYPE_DATETIME = self::XS . 'dateTime';
|
||||||
const DATATYPE_BOOLEAN = self::XS . 'boolean';
|
public const DATATYPE_BOOLEAN = self::XS . 'boolean';
|
||||||
|
|
||||||
|
|
||||||
/** @var boolean */
|
/** @var boolean */
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -30,6 +32,7 @@ use SearchDAV\XML\Literal;
|
||||||
use SearchDAV\XML\Operator;
|
use SearchDAV\XML\Operator;
|
||||||
use SearchDAV\XML\Order;
|
use SearchDAV\XML\Order;
|
||||||
use SearchDAV\XML\Scope;
|
use SearchDAV\XML\Scope;
|
||||||
|
|
||||||
use function Sabre\Xml\Deserializer\keyValue;
|
use function Sabre\Xml\Deserializer\keyValue;
|
||||||
use function Sabre\Xml\Deserializer\repeatingElements;
|
use function Sabre\Xml\Deserializer\repeatingElements;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -32,7 +34,7 @@ use SearchDAV\Backend\ISearchBackend;
|
||||||
use SearchDAV\XML\SupportedQueryGrammar;
|
use SearchDAV\XML\SupportedQueryGrammar;
|
||||||
|
|
||||||
class SearchPlugin extends ServerPlugin {
|
class SearchPlugin extends ServerPlugin {
|
||||||
const SEARCHDAV_NS = 'https://github.com/icewind1991/SearchDAV/ns';
|
public const SEARCHDAV_NS = 'https://github.com/icewind1991/SearchDAV/ns';
|
||||||
|
|
||||||
/** @var ISearchBackend */
|
/** @var ISearchBackend */
|
||||||
private $searchBackend;
|
private $searchBackend;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -22,18 +24,18 @@
|
||||||
namespace SearchDAV\Query;
|
namespace SearchDAV\Query;
|
||||||
|
|
||||||
class Operator {
|
class Operator {
|
||||||
const OPERATION_AND = '{DAV:}and';
|
public const OPERATION_AND = '{DAV:}and';
|
||||||
const OPERATION_OR = '{DAV:}or';
|
public const OPERATION_OR = '{DAV:}or';
|
||||||
const OPERATION_NOT = '{DAV:}not';
|
public const OPERATION_NOT = '{DAV:}not';
|
||||||
const OPERATION_EQUAL = '{DAV:}eq';
|
public const OPERATION_EQUAL = '{DAV:}eq';
|
||||||
const OPERATION_LESS_THAN = '{DAV:}lt';
|
public const OPERATION_LESS_THAN = '{DAV:}lt';
|
||||||
const OPERATION_LESS_OR_EQUAL_THAN = '{DAV:}lte';
|
public const OPERATION_LESS_OR_EQUAL_THAN = '{DAV:}lte';
|
||||||
const OPERATION_GREATER_THAN = '{DAV:}gt';
|
public const OPERATION_GREATER_THAN = '{DAV:}gt';
|
||||||
const OPERATION_GREATER_OR_EQUAL_THAN = '{DAV:}gte';
|
public const OPERATION_GREATER_OR_EQUAL_THAN = '{DAV:}gte';
|
||||||
const OPERATION_IS_COLLECTION = '{DAV:}is-collection';
|
public const OPERATION_IS_COLLECTION = '{DAV:}is-collection';
|
||||||
const OPERATION_IS_DEFINED = '{DAV:}is-defined';
|
public const OPERATION_IS_DEFINED = '{DAV:}is-defined';
|
||||||
const OPERATION_IS_LIKE = '{DAV:}like';
|
public const OPERATION_IS_LIKE = '{DAV:}like';
|
||||||
const OPERATION_CONTAINS = '{DAV:}contains';
|
public const OPERATION_CONTAINS = '{DAV:}contains';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -24,8 +26,8 @@ namespace SearchDAV\Query;
|
||||||
use SearchDAV\Backend\SearchPropertyDefinition;
|
use SearchDAV\Backend\SearchPropertyDefinition;
|
||||||
|
|
||||||
class Order {
|
class Order {
|
||||||
const ASC = 'ascending';
|
public const ASC = 'ascending';
|
||||||
const DESC = 'descending';
|
public const DESC = 'descending';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var SearchPropertyDefinition
|
* @var SearchPropertyDefinition
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -24,6 +26,7 @@ namespace SearchDAV\XML;
|
||||||
use Sabre\Xml\ParseException;
|
use Sabre\Xml\ParseException;
|
||||||
use Sabre\Xml\Reader;
|
use Sabre\Xml\Reader;
|
||||||
use Sabre\Xml\XmlDeserializable;
|
use Sabre\Xml\XmlDeserializable;
|
||||||
|
|
||||||
use function Sabre\Xml\Deserializer\keyValue;
|
use function Sabre\Xml\Deserializer\keyValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -24,6 +26,7 @@ namespace SearchDAV\XML;
|
||||||
use Sabre\Xml\Reader;
|
use Sabre\Xml\Reader;
|
||||||
use Sabre\Xml\XmlDeserializable;
|
use Sabre\Xml\XmlDeserializable;
|
||||||
use SearchDAV\DAV\SearchPlugin;
|
use SearchDAV\DAV\SearchPlugin;
|
||||||
|
|
||||||
use function Sabre\Xml\Deserializer\keyValue;
|
use function Sabre\Xml\Deserializer\keyValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -23,6 +25,7 @@ namespace SearchDAV\XML;
|
||||||
|
|
||||||
use Sabre\Xml\Reader;
|
use Sabre\Xml\Reader;
|
||||||
use Sabre\Xml\XmlDeserializable;
|
use Sabre\Xml\XmlDeserializable;
|
||||||
|
|
||||||
use function Sabre\Xml\Deserializer\keyValue;
|
use function Sabre\Xml\Deserializer\keyValue;
|
||||||
|
|
||||||
class Order implements XmlDeserializable {
|
class Order implements XmlDeserializable {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -23,6 +25,7 @@ namespace SearchDAV\XML;
|
||||||
|
|
||||||
use Sabre\DAV\Xml\Element\Response;
|
use Sabre\DAV\Xml\Element\Response;
|
||||||
use Sabre\Xml\Writer;
|
use Sabre\Xml\Writer;
|
||||||
|
|
||||||
use function Sabre\HTTP\encodePath;
|
use function Sabre\HTTP\encodePath;
|
||||||
|
|
||||||
class QueryDiscoverResponse extends Response {
|
class QueryDiscoverResponse extends Response {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -23,6 +25,7 @@ namespace SearchDAV\XML;
|
||||||
|
|
||||||
use Sabre\Xml\Reader;
|
use Sabre\Xml\Reader;
|
||||||
use Sabre\Xml\XmlDeserializable;
|
use Sabre\Xml\XmlDeserializable;
|
||||||
|
|
||||||
use function Sabre\Xml\Deserializer\keyValue;
|
use function Sabre\Xml\Deserializer\keyValue;
|
||||||
|
|
||||||
class Scope extends \SearchDAV\Query\Scope implements XmlDeserializable {
|
class Scope extends \SearchDAV\Query\Scope implements XmlDeserializable {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
@ -25,7 +27,7 @@ use Sabre\Xml\Writer;
|
||||||
use Sabre\Xml\XmlSerializable;
|
use Sabre\Xml\XmlSerializable;
|
||||||
|
|
||||||
class SupportedQueryGrammar implements XmlSerializable {
|
class SupportedQueryGrammar implements XmlSerializable {
|
||||||
const GRAMMAR_BASIC_SEARCH = '{DAV:}basicsearch';
|
public const GRAMMAR_BASIC_SEARCH = '{DAV:}basicsearch';
|
||||||
|
|
||||||
public function xmlSerialize(Writer $writer): void {
|
public function xmlSerialize(Writer $writer): void {
|
||||||
$writer->startElement('{DAV:}supported-query-grammar');
|
$writer->startElement('{DAV:}supported-query-grammar');
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
* @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue