diff --git a/.gitignore b/.gitignore index 0b82d85..e841c0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /vendor /vendor-bin/*/vendor /tests/coverage -/tests/.phpunit.result.cache \ No newline at end of file +/tests/.phpunit.result.cache +/.php_cs.cache diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..8bef6af --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,79 @@ + ['comment_type' => "phpdocs_only"], + 'array_syntax' => ['syntax' => "short"], + 'binary_operator_spaces' => [ + 'default' => "single_space", + 'operators' => ['=>' => "align_single_space"], + ], + 'cast_spaces' => ['space' => "single"], + 'concat_space' => ['spacing' => "none"], + 'list_syntax' => ['syntax' => "short"], + 'magic_constant_casing' => true, + 'magic_method_casing' => true, + 'modernize_types_casting' => true, + 'native_function_casing' => true, + 'native_function_type_declaration_casing' => true, + 'no_binary_string' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_extra_blank_lines' => true, // this could probably use more configuration + 'no_mixed_echo_print' => ['use' => "echo"], + 'no_short_bool_cast' => true, + 'no_trailing_comma_in_singleline_array' => true, + 'no_unneeded_control_parentheses' => true, + 'no_unneeded_curly_braces' => true, + 'no_unused_imports' => true, + 'no_whitespace_before_comma_in_array' => true, + 'normalize_index_brace' => true, + 'object_operator_without_whitespace' => true, + 'pow_to_exponentiation' => true, + 'set_type_to_cast' => true, + 'standardize_not_equals' => true, + 'trailing_comma_in_multiline_array' => true, + 'unary_operator_spaces' => true, + 'yoda_style' => false, + // PSR standard to apply + '@PSR2' => true, + // PSR-12 rules; php-cs-fixer does not yet support PSR-12 natively + 'compact_nullable_typehint' => true, + 'declare_equal_normalize' => ['space' => "none"], + 'function_typehint_space' => true, + 'lowercase_cast' => true, + 'lowercase_static_reference' => true, + 'no_alternative_syntax' => true, + 'no_empty_statement' => true, + 'no_leading_import_slash' => true, + 'no_leading_namespace_whitespace' => true, + 'no_whitespace_in_blank_line' => true, + 'return_type_declaration' => ['space_before' => "none"], + 'single_trait_insert_per_statement' => true, + 'short_scalar_cast' => true, + 'visibility_required' => ['elements' => ["const", "property", "method"]], + // house exceptions to PSR rules + 'braces' => ['position_after_functions_and_oop_constructs' => "same"], + 'function_declaration' => ['closure_function_spacing' => "none"], + 'new_with_braces' => false, // no option to specify absence of braces + ]; + +$finder = \PhpCsFixer\Finder::create(); +foreach ($paths as $path) { + if (is_file($path)) { + $finder = $finder->append([$path]); + } else { + $finder = $finder->in($path); + } +} +return \PhpCsFixer\Config::create()->setRiskyAllowed(true)->setRules($rules)->setFinder($finder); diff --git a/RoboFile.php b/RoboFile.php index d1a5750..565a764 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -24,7 +24,7 @@ class RoboFile extends \Robo\Tasks { * ./robo test --testsuite TTRSS --exclude-group slow --testdox * * Please see the PHPUnit documentation for available options. - */ + */ public function test(array $args): Result { return $this->runTests(escapeshellarg(\PHP_BINARY), "typical", $args); } @@ -33,7 +33,7 @@ class RoboFile extends \Robo\Tasks { * * This includes pedantic tests which may help to identify problems. * See help for the "test" task for more details. - */ + */ public function testFull(array $args): Result { return $this->runTests(escapeshellarg(\PHP_BINARY), "full", $args); } @@ -42,7 +42,7 @@ class RoboFile extends \Robo\Tasks { * Runs a quick subset of the test suite * * See help for the "test" task for more details. - */ + */ public function testQuick(array $args): Result { return $this->runTests(escapeshellarg(\PHP_BINARY), "quick", $args); } @@ -54,9 +54,9 @@ class RoboFile extends \Robo\Tasks { * arguments to this task as one would to PHPUnit. * * Robo first tries to use pcov and will fall back first to xdebug then - * phpdbg. Neither pcov nor xdebug need to be enabled to be used; they + * phpdbg. Neither pcov nor xdebug need to be enabled to be used; they * only need to be present in the extension load path to be used. - */ + */ public function coverage(array $args): Result { // run tests with code coverage reporting enabled $exec = $this->findCoverageEngine(); @@ -71,7 +71,7 @@ class RoboFile extends \Robo\Tasks { * run all tests which may cover code. * * See also help for the "coverage" task for more details. - */ + */ public function coverageFull(array $args): Result { // run tests with code coverage reporting enabled $exec = $this->findCoverageEngine(); @@ -121,7 +121,7 @@ class RoboFile extends \Robo\Tasks { return $all ? ">$hole 2>&1" : "2>$hole"; } - protected function runTests(string $executor, string $set, array $args) : Result { + protected function runTests(string $executor, string $set, array $args): Result { switch ($set) { case "typical": $set = ["--exclude-group", "optional"]; diff --git a/lib/Category/Category.php b/lib/Category/Category.php index 373f4ed..6c1da99 100644 --- a/lib/Category/Category.php +++ b/lib/Category/Category.php @@ -9,7 +9,7 @@ namespace JKingWeb\Lax\Category; class Category { public $name = ""; public $label = ""; - public $domain = ""; + public $domain = ""; public function __toString() { return strlen(strlen((string) $this->label)) ? $this->label : $this->name; diff --git a/lib/Category/Collection.php b/lib/Category/Collection.php index 5b86a33..f32bedd 100644 --- a/lib/Category/Collection.php +++ b/lib/Category/Collection.php @@ -8,16 +8,16 @@ namespace JKingWeb\Lax\Category; class Collection extends \JKingWeb\Lax\Collection { protected static $ranks = [ - 'webmaster' => 10, - 'editor' => 20, + 'webmaster' => 10, + 'editor' => 20, 'contributor' => 30, - 'author' => 40, + 'author' => 40, ]; /** Returns the collection formatted as an array of strings - * + * * The $humanFriendly parameter controls whether or not an effort is made to return human-friendly category names. Only Atom categories have this distinction - * + * */ public function list(bool $humanFriendly = true) { $out = []; diff --git a/lib/Collection.php b/lib/Collection.php index 9ebfd16..68f01df 100644 --- a/lib/Collection.php +++ b/lib/Collection.php @@ -7,7 +7,6 @@ declare(strict_types=1); namespace JKingWeb\Lax; abstract class Collection implements \IteratorAggregate, \ArrayAccess, \Countable, \JsonSerializable { - protected $data = []; /** Implementation for IteratorAggregate */ @@ -49,10 +48,10 @@ abstract class Collection implements \IteratorAggregate, \ArrayAccess, \Countabl unset($this->data[$offset]); } - /** Merges one or more other collections' items into this one - * + /** Merges one or more other collections' items into this one + * * The returned collection is the original instance, modified - */ + */ public function merge(Collection ...$coll): self { foreach ($coll as $c) { foreach ($c as $p) { @@ -62,14 +61,14 @@ abstract class Collection implements \IteratorAggregate, \ArrayAccess, \Countabl return $this; } - /** Returns a collection filtered along a given axis which includes or excludes only the specified terms - * + /** Returns a collection filtered along a given axis which includes or excludes only the specified terms + * * $terms is the list of values to include or exclude in the result - * - * $axis is the property of each collection member which value is to be checked against the terms - * + * + * $axis is the property of each collection member which value is to be checked against the terms + * * $inclusive specified whether the terms are to included in (true) or excluded from (false) the result - */ + */ protected function filter(array $terms, string $axis, bool $inclusive): self { $out = new static; foreach ($this as $item) { diff --git a/lib/Date.php b/lib/Date.php index fe9c556..c0dde50 100644 --- a/lib/Date.php +++ b/lib/Date.php @@ -7,7 +7,7 @@ declare(strict_types=1); namespace JKingWeb\Lax; class Date extends \DateTimeImmutable implements \JsonSerializable { - static public $supportedFormats = [ + public static $supportedFormats = [ // RFC 3339 formats 'Y-m-d\TH:i:s.u\Z', 'Y-m-d\TH:i:s.u\z', diff --git a/lib/Enclosure/Collection.php b/lib/Enclosure/Collection.php index 5afcb3b..4b5ddaa 100644 --- a/lib/Enclosure/Collection.php +++ b/lib/Enclosure/Collection.php @@ -9,11 +9,11 @@ namespace JKingWeb\Lax\Enclosure; class Collection extends \JKingWeb\Lax\Collection { /** Returns the primary ("best") enclosure of the collection - * + * * Videos are preferred over audios, which are preferred over images, which are preferred over anything else - * + * * Videos are first ranked by length, then resolution (total pixels), then bitrate, then size; audios are ranked by length, then bitrate, then size; images are ranked by resolution (total pixels), then size - * + * */ public function primary(): ?Enclosure { # stub diff --git a/lib/Entry.php b/lib/Entry.php index 2ef2e53..e015098 100644 --- a/lib/Entry.php +++ b/lib/Entry.php @@ -12,7 +12,7 @@ use JKingWeb\Lax\Enclosure\Collection as EnclosureCollection; class Entry { /** @var string $id The persistent identifier of the entry. This is often identical to the URL of the entry, but the latter may change - * + * * While identifiers are usually supposed to be globally unique, in practice they are frequently only unique within the context of a particular newsfeed */ public $id; @@ -25,7 +25,7 @@ class Entry { /** @var \JKingWeb\Lax\Text $title The title of the entry */ public $title; /** @var \JKingWeb\Lax\Text $content The content of the entry - * + * * This may be merely a summary or excerpt for many newsfeeds */ public $content; /** @var \JKingWeb\Lax\Text $summary A short summary or excerpt of the entry, distinct from the content */ diff --git a/lib/Exception.php b/lib/Exception.php index 5f47d11..cfc21bf 100644 --- a/lib/Exception.php +++ b/lib/Exception.php @@ -9,9 +9,9 @@ namespace JKingWeb\Lax; abstract class Exception extends \Exception { public const SYMBOLS = [ // Parsing: 0x1100 - "notJSONType" => [0x1111, "Document Content-Type is not either that of JSON Feed or generic JSON"], + "notJSONType" => [0x1111, "Document Content-Type is not either that of JSON Feed or generic JSON"], "notJSON" => [0x1112, "Document is not valid JSON"], - "notJSONFeed" => [0x1113, "Document is not a JSON Feed document"] + "notJSONFeed" => [0x1113, "Document is not a JSON Feed document"], ]; public function __construct(string $symbol, \Exception $e = null) { @@ -19,7 +19,7 @@ abstract class Exception extends \Exception { if (!$data) { throw new \Exception("Exception symbol \"$symbol\" does not exist"); } - list($code, $msg) = $data; + [$code, $msg] = $data; parent::__construct($msg, $code, $e); } -} \ No newline at end of file +} diff --git a/lib/Feed.php b/lib/Feed.php index 0c53e4e..3a827e2 100644 --- a/lib/Feed.php +++ b/lib/Feed.php @@ -10,30 +10,30 @@ use JKingWeb\Lax\Category\Collection as CategoryCollection; use JKingWeb\Lax\Person\Collection as PersonCollection; /** Represents a newsfeed, in arbitrary format - * + * * All properties may be null. */ class Feed { /** @var string $format The format of newsfeed, one of the following: - * + * * - `rss` for RSS 0.9x or RSS 2.0.x * - `rdf` for RSS 1.0 * - `atom` for Atom feeds * - `json` for JSON Feed * - `hfeed` for a microformat h-feeds - * + * * The format is largely advisory, but may be used when converting between formats */ public $format; /** @var string $version The format version of the newsfeed - * + * * The version is largely advisory, but may be used when converting between formats */ public $version; /** @var string $lang The human language of the newsfeed as a whole */ public $lang; /** @var string $id The globally unique identifier for the newsfeed - * + * * For some formats, such as RSS 2.0 and JSON Feed, this may be he same as the newsfeed URL */ public $id; @@ -46,7 +46,7 @@ class Feed { /** @var \JKingWeb\Lax\Text $summary A short description or summary of the newsfeed */ public $summary; /** @var \JKingWeb\Lax\Date $dateModified The date at which the newsfeed was last modified - * + * * This property only records a date embedded in the newsfeed itself, not any dates from HTTP or the file system */ public $dateModified; @@ -54,7 +54,7 @@ class Feed { public $icon; /** @var \JKingWeb\Lax\Url $image URL to a large banner or poster image for the newsfeed */ public $image; - + /** @var \JKingWeb\Lax\Category\Collection $categories A list of categories associated with the newsfeed as a whole */ public $categories; /** @var \JKingWeb\Lax\Person\Collection $people A list of people (e.g. authors, contributors) associated with the newsfeed as a whole */ @@ -73,14 +73,14 @@ class Feed { $this->categories = new CategoryCollection; $this->sched = new Schedule; } - + /** Parses a string to produce a Feed object - * + * * Most users will probably rather want the Feed::fetch() method - * + * * @param string $data The newsfeed to parse * @param string|null $contentType The HTTP Content-Type of the document, if available - * @param string|null $url The URL used to retrieve the newsfeed, if applicable + * @param string|null $url The URL used to retrieve the newsfeed, if applicable */ public static function parse(string $data, ?string $contentType = null, ?string $url = null): self { $out = new self; diff --git a/lib/Metadata.php b/lib/Metadata.php index 83f927b..d245777 100644 --- a/lib/Metadata.php +++ b/lib/Metadata.php @@ -14,4 +14,4 @@ class Metadata { public $etag; public $expires; public $maxAge; -} \ No newline at end of file +} diff --git a/lib/Parser/Construct.php b/lib/Parser/Construct.php index ff88842..2cb4a58 100644 --- a/lib/Parser/Construct.php +++ b/lib/Parser/Construct.php @@ -17,7 +17,7 @@ trait Construct { } /** Takes an HTML string as input and returns a sanitized version of that string - * + * * The $outputHtml parameter, when false, outputs only the plain-text content of the sanitized HTML */ protected function sanitizeString(string $markup, bool $outputHtml = true): string { @@ -30,7 +30,7 @@ trait Construct { } /** Tests whether a string is a valid e-mail address - * + * * Accepts IDN hosts and Unicode localparts */ protected function validateMail(string $addr): bool { @@ -42,7 +42,8 @@ trait Construct { $domain = $match[2]; // PHP's filter_var does not accept IDN hosts, so we have to perform an IDNA transformation first $domain = idn_to_ascii($domain, \IDNA_NONTRANSITIONAL_TO_ASCII | \IDNA_CHECK_BIDI | \IDNA_CHECK_CONTEXTJ, \INTL_IDNA_VARIANT_UTS46); // settings for IDNA2008 algorithm (I think) - if ($domain !== false) {$addr = "$local@$domain"; + if ($domain !== false) { + $addr = "$local@$domain"; return (bool) filter_var($addr, \FILTER_VALIDATE_EMAIL, \FILTER_FLAG_EMAIL_UNICODE); } return false; @@ -65,7 +66,7 @@ trait Construct { protected function parseMediaType(string $type, ?Url $url = null): ?string { if (preg_match('<^\s*([0-9a-z]+(?:/[!#$%&\'\*\+\-\.^_`|~0-9a-z]+)?)(?:\s|;|,|$)>i', $type, $match)) { - /* NOTE: The pattern used here is a subset of what is + /* NOTE: The pattern used here is a subset of what is technically allowed by RFC 7231: the "type" portion is supposed to be as general as the "subtype" portion, but in practice only alphabetic types have ever been diff --git a/lib/Parser/Entry.php b/lib/Parser/Entry.php index ab6b837..1eb5a1d 100644 --- a/lib/Parser/Entry.php +++ b/lib/Parser/Entry.php @@ -42,7 +42,7 @@ interface Entry { public function getDateModified(): ?Date; /** Returns the URL of a large image used as a banner when displaying the entry - * + * * This is only used by JSON Feed entries */ public function getBanner(): ?Url; diff --git a/lib/Parser/Exception.php b/lib/Parser/Exception.php index 82da6b0..338079c 100644 --- a/lib/Parser/Exception.php +++ b/lib/Parser/Exception.php @@ -9,4 +9,4 @@ namespace JKingWeb\Lax\Parser; use JKingWeb\Lax\Exception as BaseException; class Exception extends BaseException { -} \ No newline at end of file +} diff --git a/lib/Parser/Feed.php b/lib/Parser/Feed.php index 489c253..1ad176b 100644 --- a/lib/Parser/Feed.php +++ b/lib/Parser/Feed.php @@ -48,7 +48,7 @@ interface Feed { public function getPeople(): PersonCollection; /** Returns the list of entries - * + * * @param \JKingWeb\Lax\Feed $feed The newsfeed to which the entry belongs. Some data from the newsfeed may be used in parsing the entry */ public function getEntries(FeedStruct $feed = null): array; diff --git a/lib/Parser/JSON/Construct.php b/lib/Parser/JSON/Construct.php index 93f510e..7a48a6e 100644 --- a/lib/Parser/JSON/Construct.php +++ b/lib/Parser/JSON/Construct.php @@ -16,7 +16,7 @@ trait Construct { use \JKingWeb\Lax\Parser\Construct; /** Returns an object member if the member exists and is of the expected type - * + * * Returns null otherwise */ protected function fetchMember(string $key, string $type, ?\stdClass $obj = null) { diff --git a/lib/Parser/JSON/Entry.php b/lib/Parser/JSON/Entry.php index 20b4fe6..17d5b36 100644 --- a/lib/Parser/JSON/Entry.php +++ b/lib/Parser/JSON/Entry.php @@ -51,7 +51,7 @@ class Entry implements \JKingWeb\Lax\Parser\Entry { $entry->people = $this->getPeople(); $entry->categories = $this->getCategories(); $entry->enclosures = $this->getEnclosures(); - return $entry; + return $entry; } public function getId(): ?string { @@ -69,7 +69,7 @@ class Entry implements \JKingWeb\Lax\Parser\Entry { $exp = (int) $id[1]; $mul = $exp > -1; $exp = abs($exp); - list($int, $dec) = explode(".", $id[0]); + [$int, $dec] = explode(".", $id[0]); $dec = strlen($dec) ? str_split($dec, 1) : []; $int = str_split($int, 1); if ($int[0] === "-") { @@ -89,7 +89,7 @@ class Entry implements \JKingWeb\Lax\Parser\Entry { array_unshift($dec, "0"); } } - return ($neg ? "-" : "") . ($int ? implode("", $int) : "0") . ($dec ? ("." . rtrim(implode("", $dec), "0")) : ""); + return ($neg ? "-" : "").($int ? implode("", $int) : "0").($dec ? (".".rtrim(implode("", $dec), "0")) : ""); } } } else { @@ -156,9 +156,9 @@ class Entry implements \JKingWeb\Lax\Parser\Entry { $out[] = $m; } // handle other attachments - foreach ($this->fetchMember("attachments", "array") ?? [] as $attachment) { + foreach ($this->fetchMember("attachments", "array") ?? [] as $attachment) { $url = $this->fetchUrl("url", $attachment); - if ($url) { + if ($url) { $m = new Enclosure; $m->url = $url; $m->type = $this->fetchType("mime_type", $url, $attachment); diff --git a/lib/Parser/JSON/Feed.php b/lib/Parser/JSON/Feed.php index ecf05dc..55ed946 100644 --- a/lib/Parser/JSON/Feed.php +++ b/lib/Parser/JSON/Feed.php @@ -8,7 +8,6 @@ namespace JKingWeb\Lax\Parser\JSON; use JKingWeb\Lax\Text; use JKingWeb\Lax\Date; -use JKingWeb\Lax\Entry; use JKingWeb\Lax\Feed as FeedStruct; use JKingWeb\Lax\Person\Collection as PersonCollection; use JKingWeb\Lax\Category\Collection as CategoryCollection; @@ -82,9 +81,9 @@ class Feed implements \JKingWeb\Lax\Parser\Feed { } /** {@inheritdoc} - * + * * For JSON feeds this is always the feed URL specified in the feed - */ + */ public function getId(): ?string { return $this->fetchMember("feed_url", "str"); } @@ -106,9 +105,9 @@ class Feed implements \JKingWeb\Lax\Parser\Feed { } /** {@inheritdoc} - * + * * JSON feeds themselves don't have dates, so this always returns null - */ + */ public function getDateModified(): ?Date { return null; } @@ -118,9 +117,9 @@ class Feed implements \JKingWeb\Lax\Parser\Feed { } /** {@inheritdoc} - * + * * JSON Feed does not have categories at the feed level, so this always returns and empty collection - */ + */ public function getCategories(): CategoryCollection { return new CategoryCollection; } diff --git a/lib/Parser/XML/Construct.php b/lib/Parser/XML/Construct.php index 4f728a0..7b6f40f 100644 --- a/lib/Parser/XML/Construct.php +++ b/lib/Parser/XML/Construct.php @@ -15,7 +15,7 @@ trait Construct { use \JKingWeb\Lax\Parser\Construct; /** @var \DOMDocument */ - public $document; + protected $document; /** @var \DOMXPath */ protected $xpath; /** @var \DOMElement */ @@ -24,7 +24,7 @@ trait Construct { /** Retrieves an element node based on an XPath query */ protected function fetchElement(string $query, \DOMNode $context = null) { $node = @$this->xpath->query("(".$query.")[1]", $context ?? $this->subject); - if ($node===false) { + if ($node === false) { throw new \Exception("Invalid XPath query: $query"); // @codeCoverageIgnore } return ($node->length) ? $node->item(0) : null; @@ -55,12 +55,12 @@ trait Construct { protected function fetchStringAtom(string $query, bool $html = false): ?Text { $node = $this->fetchElement($query); if ($node) { - if (!$node->hasAttribute("type") || $node->getAttribute("type")=="text") { + if (!$node->hasAttribute("type") || $node->getAttribute("type") == "text") { return $html ? htmlspecialchars($this->trimText($node->textContent), \ENT_QUOTES | \ENT_HTML5) : $this->trimText($node->textContent); - } elseif ($node->getAttribute("type")=="xhtml") { + } elseif ($node->getAttribute("type") == "xhtml") { $node = $node->getElementsByTagNameNS(self::NS['xhtml'], "div")->item(0); return $node ? $this->sanitizeElement($node, $html) : null; - } elseif ($node->getAttribute("type")=="html") { + } elseif ($node->getAttribute("type") == "html") { return $this->sanitizeString($node->textContent, $html); } else { return null; @@ -76,19 +76,19 @@ trait Construct { } /** Returns a node-list of Atom link elements with the desired relation or equivalents. - * + * * Links without an href attribute are excluded. - * + * * @see https://tools.ietf.org/html/rfc4287#section-4.2.7.2 */ protected function fetchAtomRelations(string $rel = ""): \DOMNodeList { // FIXME: The XPath evaluation will fail if the relation contains an apostrophe. This is a known and difficult-to-overcome limitation of XPath 1.0 which I consider not worth the effort to address at this time - if ($rel=="" || $rel=="alternate" || $rel=="http://www.iana.org/assignments/relation/alternate") { + if ($rel == "" || $rel == "alternate" || $rel == "http://www.iana.org/assignments/relation/alternate") { $cond = "not(@rel) or @rel='' or @rel='alternate' or @rel='http://www.iana.org/assignments/relation/alternate'"; - } elseif (strpos($rel, ":")===false) { + } elseif (strpos($rel, ":") === false) { // FIXME: Checking only for a colon in a link relation is a hack that does not strictly follow IRI rules, but it's adequate for our needs $cond = "@rel='$rel' or @rel='http://www.iana.org/assignments/relation/$rel'"; - } elseif (strlen($rel) > 41 && strpos($rel, "http://www.iana.org/assignments/relation/")===0) { + } elseif (strlen($rel) > 41 && strpos($rel, "http://www.iana.org/assignments/relation/") === 0) { $rel = substr($rel, 41); $cond = "@rel='$rel' or @rel='http://www.iana.org/assignments/relation/$rel'"; } else { @@ -98,11 +98,11 @@ trait Construct { } /** Finds and parses RSS person-texts and returns a collection of person objects - * + * * Each can have a name, e-mail address, or both - * + * * The following forms will yield both a name and address: - * + * * - user@example.com (Full Name) * - Full Name */ @@ -157,12 +157,12 @@ trait Construct { return count($out) ? $out : null; } - /** Resolves a URL contained in a DOM element's atrribute or text - * + /** Resolves a URL contained in a DOM element's atrribute or text + * * This automatically performs xml:base and HTML resolution - * + * * Specifying the empty string for $attr results in the element content being used as a URL - */ + */ protected function resolveNodeUrl(\DOMElement $node = null, string $attr = "", string $ns = null): string { $base = $node->baseURI; $url = strlen($attr) ? $node->getAttributeNS($ns, $attr) : $this->trimText($node->textContent); diff --git a/lib/Parser/XML/Entry.php b/lib/Parser/XML/Entry.php index 85ca910..5bb5d9e 100644 --- a/lib/Parser/XML/Entry.php +++ b/lib/Parser/XML/Entry.php @@ -45,9 +45,9 @@ class Entry implements \JKingWeb\Lax\Parser\Entry { $entry->title = strlen($this->title) ? $this->title : $this->link; // do extra stuff just to test it $entry->categories = $this->getCategories(); - return $entry; + return $entry; } - + /** General function to fetch the entry title */ public function getTitle(): ?Text { return $this->getTitleAtom() ?? $this->getTitleRss1() ?? $this->getTitleRss2() ?? $this->getTitleDC() ?? $this->getTitlePod() ?? ""; @@ -86,7 +86,7 @@ class Entry implements \JKingWeb\Lax\Parser\Entry { } /** General function to fetch the URL of a article related to the entry - * + * * This is only reliable with Atom feeds */ public function getRelatedLink(): ?Url { @@ -102,7 +102,7 @@ class Entry implements \JKingWeb\Lax\Parser\Entry { } public function getEnclosures(): EnclosureCollection { - return new EnclosureCollection; + return new EnclosureCollection; } public function getLang(): ?string { diff --git a/lib/Parser/XML/Feed.php b/lib/Parser/XML/Feed.php index 4d45037..45a1000 100644 --- a/lib/Parser/XML/Feed.php +++ b/lib/Parser/XML/Feed.php @@ -24,8 +24,6 @@ class Feed implements \JKingWeb\Lax\Parser\Feed { protected $contentType; /** @var \JKingWeb\Lax\Url */ protected $url; - /** @var \DOMDocument */ - protected $document; /** @var \DOMElement */ protected $subject; /** @var \DOMXpath */ @@ -49,23 +47,23 @@ class Feed implements \JKingWeb\Lax\Parser\Feed { $this->subject = $this->document->documentElement; $ns = $this->subject->namespaceURI; $name = $this->subject->localName; - if (is_null($ns) && $name=="rss") { + if (is_null($ns) && $name === "rss") { $this->subject = $this->fetchElement("channel") ?? $this->subject; $feed->format = "rss"; $feed->version = $this->document->documentElement->getAttribute("version"); - } elseif ($ns==XPath::NS['rdf'] && $name=="RDF") { + } elseif ($ns === XPath::NS['rdf'] && $name === "RDF") { $feed->format = "rdf"; $channel = $this->fetchElement("rss1:channel|rss0:channel"); if ($channel) { $this->subject = $channel; - $feed->version = ($channel->namespaceURI==XPath::NS['rss1']) ? "1.0" : "0.90"; + $feed->version = ($channel->namespaceURI === XPath::NS['rss1']) ? "1.0" : "0.90"; } else { - $element = $this->fetchElement("rss1:item|rss0:item|rss1:image|rss0:image"); - if ($element) { - $feed->version = ($element->namespaceURI==XPath::NS['rss1']) ? "1.0" : "0.90"; - } + $element = $this->fetchElement("rss1:item|rss0:item|rss1:image|rss0:image"); + if ($element) { + $feed->version = ($element->namespaceURI === XPath::NS['rss1']) ? "1.0" : "0.90"; + } } - } elseif ($ns==XPath::NS['atom'] && $name=="feed") { + } elseif ($ns === XPath::NS['atom'] && $name === "feed") { $feed->format = "atom"; $feed->version = "1.0"; } else { @@ -98,11 +96,11 @@ class Feed implements \JKingWeb\Lax\Parser\Feed { public function getId(): ?string { return $this->getIdAtom() ?? $this->getIdDC() ?? $this->getIdRss2() ?? ""; } - + public function getUrl(): ?Url { return $this->getUrlAtom() ?? $this->getUrlRss1() ?? $this->getUrlPod() ?? $this->reqUrl; } - + public function getTitle(): ?Text { return $this->getTitleAtom() ?? $this->getTitleRss1() ?? $this->getTitleRss2() ?? $this->getTitleDC() ?? $this->getTitlePod() ?? ""; } diff --git a/lib/Parser/XML/Primitives/Construct.php b/lib/Parser/XML/Primitives/Construct.php index a8be996..3cbd9a2 100644 --- a/lib/Parser/XML/Primitives/Construct.php +++ b/lib/Parser/XML/Primitives/Construct.php @@ -90,9 +90,9 @@ trait Construct { } /** Primitive to fetch Dublin Core feed/entry categories - * + * * Dublin Core doesn't have an obvious category type, so we use 'subject' as a nearest approximation - */ + */ protected function getCategoriesDC(): ?CategoryCollection { $out = new CategoryCollection; foreach ($this->fetchStringMulti("dc:subject") ?? [] as $text) { @@ -123,10 +123,10 @@ trait Construct { return $this->fetchString("atom:id"); } - /** Primitive to fetch an RSS feed/entry identifier - * + /** Primitive to fetch an RSS feed/entry identifier + * * Using RSS' for feed identifiers is non-standard, but harmless - */ + */ protected function getIdRss2(): ?string { return $this->fetchString("guid"); } @@ -166,10 +166,10 @@ trait Construct { return $this->fetchPeopleAtom("atom:contributor", "contributor"); } - /** Primitive to fetch a collection of authors associated with a podcast/episode - * + /** Primitive to fetch a collection of authors associated with a podcast/episode + * * The collection only ever contains the first author found: podcasts implicitly have only one author - */ + */ protected function getAuthorsPod(): ?PersonCollection { $out = new PersonCollection; $p = new Person; @@ -182,10 +182,10 @@ trait Construct { return count($out) ? $out : null; } - /** Primitive to fetch a collection of webmasters associated with a podcast - * + /** Primitive to fetch a collection of webmasters associated with a podcast + * * The collection only ever contains the first webmaster found: podcasts implicitly have only one webmaster - */ + */ protected function getWebmastersPod(): ?PersonCollection { $out = new PersonCollection; $node = $this->fetchElement("gplay:owner|apple:owner"); diff --git a/lib/Parser/XML/Primitives/Entry.php b/lib/Parser/XML/Primitives/Entry.php index 4afa099..158b825 100644 --- a/lib/Parser/XML/Primitives/Entry.php +++ b/lib/Parser/XML/Primitives/Entry.php @@ -6,14 +6,13 @@ declare(strict_types=1); namespace JKingWeb\Lax\Parser\XML\Primitives; -use JKingWeb\Lax\Person\Collection as PersonCollection; use JKingWeb\Lax\Parser\XML\XPath; trait Entry { - /** Primitive to fetch a collection of authors associated with an Atom entry - * + /** Primitive to fetch a collection of authors associated with an Atom entry + * * This differs from feeds in that an entry's element (which possibly contains metadata for the source feed) is checked for authors if the entry itself has none - */ + */ protected function getAuthorsAtom() { return $this->fetchPeopleAtom("atom:author", "author") ?? $this->fetchPeopleAtom("atom:source[1]/atom:author", "author"); } @@ -22,7 +21,7 @@ trait Entry { protected function getUrlRss1() { // XPath doesn't seem to like the query we'd need for this, so it must be done the hard way. $node = $this->subject; - if ($node->localName=="item" && ($node->namespaceURI==XPath::NS['rss1'] || $node->namespaceURI==XPath::NS['rss0']) && $node->hasAttributeNS(XPath::NS['rdf'], "about")) { + if ($node->localName === "item" && ($node->namespaceURI === XPath::NS['rss1'] || $node->namespaceURI == XPath::NS['rss0']) && $node->hasAttributeNS(XPath::NS['rdf'], "about")) { return $this->resolveNodeUrl($node, "about", XPath::NS['rdf']); } else { return null; diff --git a/lib/Parser/XML/Primitives/Feed.php b/lib/Parser/XML/Primitives/Feed.php index 9814ab4..6057bc1 100644 --- a/lib/Parser/XML/Primitives/Feed.php +++ b/lib/Parser/XML/Primitives/Feed.php @@ -6,12 +6,11 @@ declare(strict_types=1); namespace JKingWeb\Lax\Parser\XML\Primitives; -use JKingWeb\Lax\Person\Collection as PersonCollection; use JKingWeb\Lax\Parser\XML\XPath; trait Feed { /** Primitive to fetch an Atom feed summary - * + * * Atom does not have a 'description' element like the RSSes, but it does have 'subtitle', which fills roughly the same function */ protected function getSummaryAtom() { @@ -49,8 +48,8 @@ trait Feed { $node = $this->subject; if ($node->hasAttributeNS(XPath::NS['rdf'], "about")) { if ( - ($node->localName=="channel" && ($node->namespaceURI==XPath::NS['rss1'] || $node->namespaceURI==XPath::NS['rss0'])) || - ($node==$node->ownerDocument->documentElement && $node->localName=="RDF" && $node->namespaceURI==XPath::NS['rdf']) + ($node->localName === "channel" && ($node->namespaceURI === XPath::NS['rss1'] || $node->namespaceURI === XPath::NS['rss0'])) || + ($node === $node->ownerDocument->documentElement && $node->localName === "RDF" && $node->namespaceURI === XPath::NS['rdf']) ) { return $this->resolveNodeUrl($node, "about", XPath::NS['rdf']); } diff --git a/lib/Person/Collection.php b/lib/Person/Collection.php index ac4b54e..9cb499a 100644 --- a/lib/Person/Collection.php +++ b/lib/Person/Collection.php @@ -9,18 +9,18 @@ namespace JKingWeb\Lax\Person; class Collection extends \JKingWeb\Lax\Collection { protected static $ranks = [ 'contributor' => -10, - 'webmaster' => 10, - 'editor' => 20, - 'author' => 30, + 'webmaster' => 10, + 'editor' => 20, + 'author' => 30, ]; /** Returns the primary person of the collection - * + * * The primary is the first member of the highest-weight role - * + * * Roles are ranked thus: * author > contributor > editor > webmaster > (anything else) - * + * */ public function primary() { $out = null; diff --git a/lib/Person/Person.php b/lib/Person/Person.php index 197d1eb..633b78c 100644 --- a/lib/Person/Person.php +++ b/lib/Person/Person.php @@ -9,7 +9,7 @@ namespace JKingWeb\Lax\Person; class Person { public $name = null; public $mail = null; - public $url = null; + public $url = null; public $role = null; public $avatar = null; diff --git a/lib/Sanitizer.php b/lib/Sanitizer.php index 15f07de..41d601f 100644 --- a/lib/Sanitizer.php +++ b/lib/Sanitizer.php @@ -172,24 +172,24 @@ class Sanitizer { //"autocapitalize", // not useful for static content //"contenteditable", // not useful for static content "class", - "dir", + "dir", //"draggable", // not useful for static content - "hidden", + "hidden", //"inputmode", // not useful for static content //"is", // only used with custom elements "id", - "itemid", - "itemprop", - "itemref", - "itemscope", - "itemtype", - "lang", + "itemid", + "itemprop", + "itemref", + "itemscope", + "itemtype", + "lang", //"nonce", // only used via scripts (I think) //"slot", // only used via scripts (I think) //"spellcheck", // not useful for static content //"style", // arbitrary styling; potentially unsafe "tabindex", - "title", + "title", "translate", // WAI-ARIA "aria-describedby", @@ -207,22 +207,22 @@ class Sanitizer { "poster", ]; - /** + /** * Sanitizes a DOMDocument object, returning the same document, modified - * + * * The document may be an HTML document or or any partial XHTML tree, possibly mixed with other XML vocabularies - * + * * The document's documentURI is assumed to already be set */ public function processDocument(\DOMDocument $doc, string $url): \DOMDocument { // determine if the document is non-XML HTML - $isHtml = ($doc->documentElement->tagName=="html" && $doc->documentElement->namespaceURI==""); + $isHtml = ($doc->documentElement->tagName === "html" && $doc->documentElement->namespaceURI === ""); // loop through each element in the document foreach ((new \DOMXPath($doc))->query("//*") as $node) { // resolve a qualified name for the element - if (($isHtml && $node->namespaceURI=="") || $node->namespaceURI=="http://www.w3.org/1999/xhtml") { + if (($isHtml && $node->namespaceURI === "") || $node->namespaceURI === "http://www.w3.org/1999/xhtml") { $qName = "html:".$node->tagName; - } elseif ($node->namespaceURI=="") { + } elseif ($node->namespaceURI === "") { $qName = $node->tagName; } elseif (isset($this->namespaces[$node->namespaceURI])) { $qName = $this->namespaces[$node->namespaceURI].":".$node->tagName; @@ -244,7 +244,7 @@ class Sanitizer { $node->parentNode->removeChild($node); } else { // if the element is in the keep list, clean up its attributes - foreach (iterator_to_array($node->attributes) as $attr) { // we use an array + foreach (iterator_to_array($node->attributes) as $attr) { // we use an array if (!in_array($attr->name, $this->attrKeep) && !(isset($this->elemKeep[$qName]) && in_array($attr->name, $this->elemKeep[$qName]))) { // if the attribute is not allowed globally or for the element, remove it $attr->ownerElement->removeAttributeNode($attr); diff --git a/lib/Schedule.php b/lib/Schedule.php index df434ca..1128911 100644 --- a/lib/Schedule.php +++ b/lib/Schedule.php @@ -8,4 +8,4 @@ namespace JKingWeb\Lax; class Schedule { public $expired; -} \ No newline at end of file +} diff --git a/lib/Text.php b/lib/Text.php index 8bb4e5b..7b67364 100644 --- a/lib/Text.php +++ b/lib/Text.php @@ -19,4 +19,4 @@ class Text { assert(in_array($type, ["plain", "html", "xhtml", "loose"]), new \InvalidArgumentException); $this->$type = $data; } -} \ No newline at end of file +} diff --git a/lib/Url.php b/lib/Url.php index d4a1aa3..8bff3f2 100644 --- a/lib/Url.php +++ b/lib/Url.php @@ -9,9 +9,9 @@ namespace JKingWeb\Lax; use Psr\Http\Message\UriInterface; /** Normalized URI representation, compatible with the PSR-7 URI interface - * + * * The following features are implemented: - * + * * - The full PSR-7 `UriInterface` interface * - Correct handling of both URLs and URNs * - Relative URL resolution @@ -20,13 +20,13 @@ use Psr\Http\Message\UriInterface; * - IDNA normalization * - IPv6 address normalization * - Empty query and fragment removal - * + * * Some things this class does not do: - * + * * - Handle non-standard schemes (e.g. ed2k) * - Collapse paths * - Drop default ports - * + * * This class should not be used with XML namespace URIs, * as the normalizations performed will change the values * of some namespaces. @@ -243,7 +243,7 @@ PCRE; } break; default: - $this->$name = $this->normalizeEncoding((string) $value, $name); + $this->$name = $this->normalizeEncoding((string) $value, $name); } } @@ -266,7 +266,7 @@ PCRE; $this->fragment = $fragment; } } - } elseif(strlen($path)) { + } elseif (strlen($path)) { if ($this->path[0] !== "/") { if ($path[-1] === "/") { $this->path = $path.$this->path; @@ -345,4 +345,4 @@ PCRE; } return $host; } -} \ No newline at end of file +} diff --git a/tests/cases/JSON/JSONTest.php b/tests/cases/JSON/JSONTest.php index fd33345..b5e72d5 100644 --- a/tests/cases/JSON/JSONTest.php +++ b/tests/cases/JSON/JSONTest.php @@ -26,11 +26,11 @@ namespace JKingWeb\Lax\TestCase\JSON; be applied to it - Any collections should be represented as sequences of maps, which will all be transformed accordingly - - Rich text can either be supplied as a string (which will yield a Text object + - Rich text can either be supplied as a string (which will yield a Text object with plain-text content) or as a map with any of the properties of the Text class listed - The transformations as performed by the `makeFeed` and `makeEntry` methods + The transformations as performed by the `makeFeed` and `makeEntry` methods of the abstract test case. */ @@ -51,8 +51,7 @@ use JKingWeb\Lax\Enclosure\Collection as EnclosureCollection; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Parser as YamlParser; - -/** +/** * @covers JKingWeb\Lax\Parser\Construct * @covers JKingWeb\Lax\Parser\JSON\Feed * @covers JKingWeb\Lax\Parser\JSON\Entry diff --git a/tests/cases/Util/Url/AbstractUriTestCase.php b/tests/cases/Util/Url/AbstractUriTestCase.php index a691bce..fdfb6d6 100644 --- a/tests/cases/Util/Url/AbstractUriTestCase.php +++ b/tests/cases/Util/Url/AbstractUriTestCase.php @@ -6,8 +6,7 @@ use Psr\Http\Message\UriInterface; use PHPUnit\Framework\TestCase; use InvalidArgumentException; -abstract class AbstractUriTestCase extends TestCase -{ +abstract class AbstractUriTestCase extends TestCase { /** * @var UriInterface */ @@ -24,13 +23,11 @@ abstract class AbstractUriTestCase extends TestCase */ abstract protected function createUri($uri = ''); - protected function setUp(): void - { + protected function setUp(): void { $this->uri = $this->createUri($this->uri_string); } - protected function tearDown(): void - { + protected function tearDown(): void { $this->uri = null; } @@ -41,15 +38,13 @@ abstract class AbstractUriTestCase extends TestCase * The value returned MUST be normalized to lowercase, per RFC 3986 * Section 3.1. */ - public function testGetScheme($scheme, $expected) - { + public function testGetScheme($scheme, $expected) { $uri = $this->uri->withScheme($scheme); $this->assertInstanceOf(UriInterface::class, $uri); $this->assertSame($expected, $uri->getScheme(), 'Scheme must be normalized according to RFC3986'); } - public function schemeProvider() - { + public function schemeProvider() { return [ 'normalized scheme' => ['HtTpS', 'https'], 'simple scheme' => ['http', 'http'], @@ -66,15 +61,13 @@ abstract class AbstractUriTestCase extends TestCase * user value, with a colon (":") separating the values. * */ - public function testGetUserInfo($user, $pass, $expected) - { + public function testGetUserInfo($user, $pass, $expected) { $uri = $this->uri->withUserInfo($user, $pass); $this->assertInstanceOf(UriInterface::class, $uri); $this->assertSame($expected, $uri->getUserInfo(), 'UserInfo must be normalized according to RFC3986'); } - public function userInfoProvider() - { + public function userInfoProvider() { return [ 'with userinfo' => ['iGoR', 'rAsMuZeN', 'iGoR:rAsMuZeN'], 'no userinfo' => ['', '', ''], @@ -92,15 +85,13 @@ abstract class AbstractUriTestCase extends TestCase * Section 3.2.2. * */ - public function testGetHost($host, $expected) - { + public function testGetHost($host, $expected) { $uri = $this->uri->withHost($host); $this->assertInstanceOf(UriInterface::class, $uri); $this->assertSame($expected, $uri->getHost(), 'Host must be normalized according to RFC3986'); } - public function hostProvider() - { + public function hostProvider() { return [ 'normalized host' => ["MaStEr.eXaMpLe.CoM", "master.example.com"], "simple host" => ["www.example.com", "www.example.com"], @@ -122,18 +113,16 @@ abstract class AbstractUriTestCase extends TestCase * If no port is present, but a scheme is present, this method MAY return * the standard port for that scheme, but SHOULD return null. */ - public function testPort($uri, $port, $expected) - { + public function testPort($uri, $port, $expected) { $uri = $this->createUri($uri)->withPort($port); $this->assertInstanceOf(UriInterface::class, $uri); $this->assertSame($expected, $uri->getPort(), 'port must be an int or null'); } - public function portProvider() - { + public function portProvider() { return [ - 'non standard port for http' => ['http://www.example.com', 443, 443], - 'remove port' => ['http://www.example.com', null, null], + 'non standard port for http' => ['http://www.example.com', 443, 443], + 'remove port' => ['http://www.example.com', null, null], 'standard port on schemeless http url' => ['//www.example.com', 80, 80], ]; } @@ -141,13 +130,11 @@ abstract class AbstractUriTestCase extends TestCase /** * @group port */ - public function testUriWithStandardPort() - { + public function testUriWithStandardPort() { $uri = $this->createUri('http://example.com:80'); $this->assertContains($uri->getPort(), [80, null], "If no port is present, but a scheme is present, this method MAY return the standard port for that scheme, but SHOULD return null."); } - /** * @group authority * @dataProvider authorityProvider @@ -155,8 +142,7 @@ abstract class AbstractUriTestCase extends TestCase * If the port component is not set or is the standard port for the current * scheme, it SHOULD NOT be included. */ - public function testGetAuthority($scheme, $user, $pass, $host, $port, $authority) - { + public function testGetAuthority($scheme, $user, $pass, $host, $port, $authority) { $uri = $this ->createUri() ->withHost($host) @@ -168,8 +154,7 @@ abstract class AbstractUriTestCase extends TestCase $this->assertSame($authority, $uri->getAuthority()); } - public function authorityProvider() - { + public function authorityProvider() { return [ 'authority' => [ 'scheme' => 'http', @@ -222,15 +207,13 @@ abstract class AbstractUriTestCase extends TestCase * any characters. To determine what characters to encode, please refer to * RFC 3986, Sections 2 and 3.4. */ - public function testGetQuery($query, $expected) - { + public function testGetQuery($query, $expected) { $uri = $this->uri->withQuery($query); $this->assertInstanceOf(UriInterface::class, $uri); $this->assertSame($expected, $uri->getQuery(), 'Query must be normalized according to RFC3986'); } - public function queryProvider() - { + public function queryProvider() { return [ 'normalized query' => ['foo.bar=%7evalue', 'foo.bar=~value'], 'empty query' => ['', ''], @@ -247,15 +230,13 @@ abstract class AbstractUriTestCase extends TestCase * any characters. To determine what characters to encode, please refer to * RFC 3986, Sections 2 and 3.5. */ - public function testGetFragment($fragment, $expected) - { + public function testGetFragment($fragment, $expected) { $uri = $this->uri->withFragment($fragment); $this->assertInstanceOf(UriInterface::class, $uri); $this->assertSame($expected, $uri->getFragment(), 'Fragment must be normalized according to RFC3986'); } - public function fragmentProvider() - { + public function fragmentProvider() { return [ 'URL with full components' => ['fragment', 'fragment'], 'URL with non-encodable fragment' => ["azAZ0-9/?-._~!$&'()*+,;=:@", "azAZ0-9/?-._~!$&'()*+,;=:@"], @@ -278,8 +259,7 @@ abstract class AbstractUriTestCase extends TestCase * - If a query is present, it MUST be prefixed by "?". * - If a fragment is present, it MUST be prefixed by "#". */ - public function testToString($scheme, $user, $pass, $host, $port, $path, $query, $fragment, $expected) - { + public function testToString($scheme, $user, $pass, $host, $port, $path, $query, $fragment, $expected) { $uri = $this->createUri() ->withHost($host) ->withScheme($scheme) @@ -295,8 +275,7 @@ abstract class AbstractUriTestCase extends TestCase 'URI string must be normalized according to RFC3986 rules' ); } - public function stringProvider() - { + public function stringProvider() { return [ 'URL normalized' => [ 'scheme' => 'HtTps', @@ -307,7 +286,7 @@ abstract class AbstractUriTestCase extends TestCase 'path' => '/%7ejohndoe/%a1/index.php', 'query' => 'foo.bar=%7evalue', 'fragment' => 'fragment', - 'uri' => 'https://iGoR:rAsMuZeN@master.example.com:443/~johndoe/%A1/index.php?foo.bar=~value#fragment' + 'uri' => 'https://iGoR:rAsMuZeN@master.example.com:443/~johndoe/%A1/index.php?foo.bar=~value#fragment', ], 'URL without scheme' => [ 'scheme' => '', @@ -337,8 +316,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group fragment */ - public function testRemoveFragment() - { + public function testRemoveFragment() { $uri = 'http://example.com/path/to/me'; $this->assertSame($uri, (string) $this->createUri($uri.'#doc')->withFragment('')); } @@ -346,8 +324,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group query */ - public function testRemoveQuery() - { + public function testRemoveQuery() { $uri = 'http://example.com/path/to/me'; $this->assertSame($uri, (string) (string) $this->createUri($uri.'?name=value')->withQuery('')); } @@ -355,8 +332,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group path */ - public function testRemovePath() - { + public function testRemovePath() { $uri = 'http://example.com'; $this->assertContains( (string) $this->createUri($uri.'/path/to/me')->withPath(''), @@ -367,8 +343,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group port */ - public function testRemovePort() - { + public function testRemovePort() { $this->assertSame( 'http://example.com/path/to/me', (string) $this->createUri('http://example.com:81/path/to/me')->withPort(null) @@ -378,8 +353,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group userinfo */ - public function testRemoveUserInfo() - { + public function testRemoveUserInfo() { $this->assertSame( 'http://example.com/path/to/me', (string) $this->createUri('http://user:pass@example.com/path/to/me')->withUserInfo('') @@ -389,8 +363,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group scheme */ - public function testRemoveScheme() - { + public function testRemoveScheme() { $this->assertSame( '//example.com/path/to/me', (string) $this->createUri('http://example.com/path/to/me')->withScheme('') @@ -400,8 +373,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group authority */ - public function testRemoveAuthority() - { + public function testRemoveAuthority() { $uri = 'http://user:login@example.com:82/path?q=v#doc'; $uri_with_host = $this->createUri($uri) @@ -418,14 +390,12 @@ abstract class AbstractUriTestCase extends TestCase * @group scheme * @dataProvider withSchemeFailedProvider */ - public function testWithSchemeFailed($scheme) - { + public function testWithSchemeFailed($scheme) { $this->expectException(InvalidArgumentException::class); $this->uri->withScheme($scheme); } - public function withSchemeFailedProvider() - { + public function withSchemeFailedProvider() { return [ 'invalid char' => ['in,valid'], 'integer like string' => ['123'], @@ -436,14 +406,12 @@ abstract class AbstractUriTestCase extends TestCase * @group host * @dataProvider withHostFailedProvider */ - public function testWithHostFailed($host) - { + public function testWithHostFailed($host) { $this->expectException(InvalidArgumentException::class); $this->uri->withHost($host); } - public function withHostFailedProvider() - { + public function withHostFailedProvider() { return [ 'dot in front' => ['.example.com'], 'hyphen suffix' => ['host.com-'], @@ -469,8 +437,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group host */ - public function testModificationFailedWithInvalidHost() - { + public function testModificationFailedWithInvalidHost() { $this->expectException(InvalidArgumentException::class); $this->createUri('http://example.com')->withHost('?'); } @@ -479,15 +446,12 @@ abstract class AbstractUriTestCase extends TestCase * @group uri * @dataProvider invalidURI */ - public function testCreateFromInvalidUrlKO($uri) - { + public function testCreateFromInvalidUrlKO($uri) { $this->expectException(InvalidArgumentException::class); $this->createUri($uri); - } - public function invalidURI() - { + public function invalidURI() { return [ ['http://user@:80'], ]; @@ -496,8 +460,7 @@ abstract class AbstractUriTestCase extends TestCase /** * @group uri */ - public function testEmptyValueDetection() - { + public function testEmptyValueDetection() { $expected = '//0:0@0/0?0#0'; $this->assertSame($expected, (string) $this->createUri($expected)); } @@ -506,9 +469,8 @@ abstract class AbstractUriTestCase extends TestCase * @group path * @group uri */ - public function testPathDetection() - { + public function testPathDetection() { $expected = 'foo/bar:'; $this->assertSame($expected, $this->createUri($expected)->getPath()); } -} \ No newline at end of file +} diff --git a/tests/cases/Util/UrlTest.php b/tests/cases/Util/UrlTest.php index 61f8bee..0088659 100644 --- a/tests/cases/Util/UrlTest.php +++ b/tests/cases/Util/UrlTest.php @@ -14,4 +14,4 @@ class UrlTest extends AbstractUriTestCase { protected function createUri($uri = '') { return new Url($uri); } -} \ No newline at end of file +} diff --git a/vendor-bin/csfixer/composer.json b/vendor-bin/csfixer/composer.json new file mode 100644 index 0000000..6d9218d --- /dev/null +++ b/vendor-bin/csfixer/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16" + } +} diff --git a/vendor-bin/csfixer/composer.lock b/vendor-bin/csfixer/composer.lock new file mode 100644 index 0000000..8431eb8 --- /dev/null +++ b/vendor-bin/csfixer/composer.lock @@ -0,0 +1,1383 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "4bdcf336f35491d1c29392d1d2e5a157", + "packages": [], + "packages-dev": [ + { + "name": "composer/semver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2020-01-13T12:06:48+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "time": "2020-03-01T12:26:26+00:00" + }, + { + "name": "doctrine/annotations", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^7.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2019-10-01T18:55:10+00:00" + }, + { + "name": "doctrine/lexer", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/lexer.git", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "reference": "5242d66dbeb21a30dd8a3e66bf7a73b66e05e1f6", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11.8", + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "keywords": [ + "annotations", + "docblock", + "lexer", + "parser", + "php" + ], + "time": "2019-10-30T14:39:59+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v2.16.1", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", + "reference": "c8afb599858876e95e8ebfcd97812d383fa23f02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/c8afb599858876e95e8ebfcd97812d383fa23f02", + "reference": "c8afb599858876e95e8ebfcd97812d383fa23f02", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4", + "composer/xdebug-handler": "^1.2", + "doctrine/annotations": "^1.2", + "ext-json": "*", + "ext-tokenizer": "*", + "php": "^5.6 || ^7.0", + "php-cs-fixer/diff": "^1.3", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", + "symfony/filesystem": "^3.0 || ^4.0 || ^5.0", + "symfony/finder": "^3.0 || ^4.0 || ^5.0", + "symfony/options-resolver": "^3.0 || ^4.0 || ^5.0", + "symfony/polyfill-php70": "^1.0", + "symfony/polyfill-php72": "^1.4", + "symfony/process": "^3.0 || ^4.0 || ^5.0", + "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" + }, + "require-dev": { + "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", + "justinrainbow/json-schema": "^5.0", + "keradus/cli-executor": "^1.2", + "mikey179/vfsstream": "^1.6", + "php-coveralls/php-coveralls": "^2.1", + "php-cs-fixer/accessible-object": "^1.0", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.1", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.1", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", + "phpunitgoodpractices/traits": "^1.8", + "symfony/phpunit-bridge": "^4.3 || ^5.0", + "symfony/yaml": "^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "ext-mbstring": "For handling non-UTF8 characters in cache signature.", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.", + "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "classmap": [ + "tests/Test/AbstractFixerTestCase.php", + "tests/Test/AbstractIntegrationCaseFactory.php", + "tests/Test/AbstractIntegrationTestCase.php", + "tests/Test/Assert/AssertTokensTrait.php", + "tests/Test/IntegrationCase.php", + "tests/Test/IntegrationCaseFactory.php", + "tests/Test/IntegrationCaseFactoryInterface.php", + "tests/Test/InternalIntegrationCaseFactory.php", + "tests/TestCase.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz RumiƄski", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "time": "2019-11-25T22:10:32+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.99", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "time": "2018-07-02T15:55:56+00:00" + }, + { + "name": "php-cs-fixer/diff", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/diff.git", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756", + "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7.23 || ^6.4.3", + "symfony/process": "^3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "SpacePossum" + } + ], + "description": "sebastian/diff v2 backport support for PHP5.6", + "homepage": "https://github.com/PHP-CS-Fixer", + "keywords": [ + "diff" + ], + "time": "2018-02-15T16:58:55+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2019-11-01T11:05:21+00:00" + }, + { + "name": "symfony/console", + "version": "v5.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "d29e2d36941de13600c399e393a60b8cfe59ac49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/d29e2d36941de13600c399e393a60b8cfe59ac49", + "reference": "d29e2d36941de13600c399e393a60b8cfe59ac49", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2020-02-24T15:05:31+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "b45ad88b253c5a9702ce218e201d89c85d148cea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b45ad88b253c5a9702ce218e201d89c85d148cea", + "reference": "b45ad88b253c5a9702ce218e201d89c85d148cea", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/event-dispatcher-contracts": "^2" + }, + "conflict": { + "symfony/dependency-injection": "<4.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/expression-language": "^4.4|^5.0", + "symfony/http-foundation": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^4.4|^5.0" + }, + "suggest": { + "symfony/dependency-injection": "", + "symfony/http-kernel": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2020-02-22T20:09:08+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "af23c2584d4577d54661c434446fb8fbed6025dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/af23c2584d4577d54661c434446fb8fbed6025dd", + "reference": "af23c2584d4577d54661c434446fb8fbed6025dd", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "psr/event-dispatcher": "^1" + }, + "suggest": { + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-18T17:27:11+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "3afadc0f57cd74f86379d073e694b0f2cda2a88c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/3afadc0f57cd74f86379d073e694b0f2cda2a88c", + "reference": "3afadc0f57cd74f86379d073e694b0f2cda2a88c", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "time": "2020-01-21T08:40:24+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "6251f201187ca9d66f6b099d3de65d279e971138" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/6251f201187ca9d66f6b099d3de65d279e971138", + "reference": "6251f201187ca9d66f6b099d3de65d279e971138", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2020-02-14T07:43:07+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v5.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "b1ab86ce52b0c0abe031367a173005a025e30e04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b1ab86ce52b0c0abe031367a173005a025e30e04", + "reference": "b1ab86ce52b0c0abe031367a173005a025e30e04", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2020-01-04T14:08:26+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/polyfill-php70", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php70.git", + "reference": "419c4940024c30ccc033650373a1fe13890d3255" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/419c4940024c30ccc033650373a1fe13890d3255", + "reference": "419c4940024c30ccc033650373a1fe13890d3255", + "shasum": "" + }, + "require": { + "paragonie/random_compat": "~1.0|~2.0|~9.99", + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php70\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/polyfill-php72", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", + "reference": "46ecacf4751dd0dc81e4f6bf01dbf9da1dc1dadf", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "5e66a0fa1070bf46bec4bea7962d285108edd675" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/5e66a0fa1070bf46bec4bea7962d285108edd675", + "reference": "5e66a0fa1070bf46bec4bea7962d285108edd675", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/process", + "version": "v5.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", + "shasum": "" + }, + "require": { + "php": "^7.2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "time": "2020-02-08T17:00:58+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.0.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "144c5e51266b281231e947b51223ba14acf1a749" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-11-18T17:27:11+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v5.0.5", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "5d9add8034135b9a5f7b101d1e42c797e7f053e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5d9add8034135b9a5f7b101d1e42c797e7f053e4", + "reference": "5d9add8034135b9a5f7b101d1e42c797e7f053e4", + "shasum": "" + }, + "require": { + "php": "^7.2.5", + "symfony/service-contracts": "^1.0|^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Stopwatch Component", + "homepage": "https://symfony.com", + "time": "2020-01-04T14:08:26+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +}