Aggiornato Composer
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,13 +2,17 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
use function preg_match;
|
||||
use function sprintf;
|
||||
|
||||
class ApplicationName {
|
||||
/** @var string */
|
||||
private $name;
|
||||
@@ -27,9 +31,9 @@ class ApplicationName {
|
||||
}
|
||||
|
||||
private function ensureValidFormat(string $name): void {
|
||||
if (!\preg_match('#\w/\w#', $name)) {
|
||||
if (!preg_match('#\w/\w#', $name)) {
|
||||
throw new InvalidApplicationNameException(
|
||||
\sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name),
|
||||
sprintf('Format of name "%s" is not valid - expected: vendor/packagename', $name),
|
||||
InvalidApplicationNameException::InvalidFormat
|
||||
);
|
||||
}
|
||||
|
||||
26
vendor/phar-io/manifest/src/values/Author.php
vendored
26
vendor/phar-io/manifest/src/values/Author.php
vendored
@@ -2,27 +2,34 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
class Author {
|
||||
/** @var string */
|
||||
private $name;
|
||||
|
||||
/** @var Email */
|
||||
/** @var null|Email */
|
||||
private $email;
|
||||
|
||||
public function __construct(string $name, Email $email) {
|
||||
public function __construct(string $name, ?Email $email = null) {
|
||||
$this->name = $name;
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
public function asString(): string {
|
||||
return \sprintf(
|
||||
if (!$this->hasEmail()) {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'%s <%s>',
|
||||
$this->name,
|
||||
$this->email->asString()
|
||||
@@ -33,7 +40,18 @@ class Author {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @psalm-assert-if-true Email $this->email
|
||||
*/
|
||||
public function hasEmail(): bool {
|
||||
return $this->email !== null;
|
||||
}
|
||||
|
||||
public function getEmail(): Email {
|
||||
if (!$this->hasEmail()) {
|
||||
throw new NoEmailAddressException();
|
||||
}
|
||||
|
||||
return $this->email;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,20 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
class AuthorCollection implements \Countable, \IteratorAggregate {
|
||||
use Countable;
|
||||
use IteratorAggregate;
|
||||
use function count;
|
||||
|
||||
/** @template-implements IteratorAggregate<int,Author> */
|
||||
class AuthorCollection implements Countable, IteratorAggregate {
|
||||
/** @var Author[] */
|
||||
private $authors = [];
|
||||
|
||||
@@ -25,7 +31,7 @@ class AuthorCollection implements \Countable, \IteratorAggregate {
|
||||
}
|
||||
|
||||
public function count(): int {
|
||||
return \count($this->authors);
|
||||
return count($this->authors);
|
||||
}
|
||||
|
||||
public function getIterator(): AuthorCollectionIterator {
|
||||
|
||||
@@ -2,14 +2,19 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
class AuthorCollectionIterator implements \Iterator {
|
||||
use Iterator;
|
||||
use function count;
|
||||
|
||||
/** @template-implements Iterator<int,Author> */
|
||||
class AuthorCollectionIterator implements Iterator {
|
||||
/** @var Author[] */
|
||||
private $authors;
|
||||
|
||||
@@ -25,7 +30,7 @@ class AuthorCollectionIterator implements \Iterator {
|
||||
}
|
||||
|
||||
public function valid(): bool {
|
||||
return $this->position < \count($this->authors);
|
||||
return $this->position < count($this->authors);
|
||||
}
|
||||
|
||||
public function key(): int {
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,14 +2,20 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
class BundledComponentCollection implements \Countable, \IteratorAggregate {
|
||||
use Countable;
|
||||
use IteratorAggregate;
|
||||
use function count;
|
||||
|
||||
/** @template-implements IteratorAggregate<int,BundledComponent> */
|
||||
class BundledComponentCollection implements Countable, IteratorAggregate {
|
||||
/** @var BundledComponent[] */
|
||||
private $bundledComponents = [];
|
||||
|
||||
@@ -25,7 +31,7 @@ class BundledComponentCollection implements \Countable, \IteratorAggregate {
|
||||
}
|
||||
|
||||
public function count(): int {
|
||||
return \count($this->bundledComponents);
|
||||
return count($this->bundledComponents);
|
||||
}
|
||||
|
||||
public function getIterator(): BundledComponentCollectionIterator {
|
||||
|
||||
@@ -2,14 +2,19 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
class BundledComponentCollectionIterator implements \Iterator {
|
||||
use Iterator;
|
||||
use function count;
|
||||
|
||||
/** @template-implements Iterator<int,BundledComponent> */
|
||||
class BundledComponentCollectionIterator implements Iterator {
|
||||
/** @var BundledComponent[] */
|
||||
private $bundledComponents;
|
||||
|
||||
@@ -25,7 +30,7 @@ class BundledComponentCollectionIterator implements \Iterator {
|
||||
}
|
||||
|
||||
public function valid(): bool {
|
||||
return $this->position < \count($this->bundledComponents);
|
||||
return $this->position < count($this->bundledComponents);
|
||||
}
|
||||
|
||||
public function key(): int {
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
8
vendor/phar-io/manifest/src/values/Email.php
vendored
8
vendor/phar-io/manifest/src/values/Email.php
vendored
@@ -2,13 +2,17 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
use const FILTER_VALIDATE_EMAIL;
|
||||
use function filter_var;
|
||||
|
||||
class Email {
|
||||
/** @var string */
|
||||
private $email;
|
||||
@@ -24,7 +28,7 @@ class Email {
|
||||
}
|
||||
|
||||
private function ensureEmailIsValid(string $url): void {
|
||||
if (\filter_var($url, \FILTER_VALIDATE_EMAIL) === false) {
|
||||
if (filter_var($url, FILTER_VALIDATE_EMAIL) === false) {
|
||||
throw new InvalidEmailException;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
@@ -75,7 +76,7 @@ class Manifest {
|
||||
return $this->type->isExtension();
|
||||
}
|
||||
|
||||
public function isExtensionFor(ApplicationName $application, Version $version = null): bool {
|
||||
public function isExtensionFor(ApplicationName $application, ?Version $version = null): bool {
|
||||
if (!$this->isExtension()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
@@ -2,14 +2,20 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
class RequirementCollection implements \Countable, \IteratorAggregate {
|
||||
use Countable;
|
||||
use IteratorAggregate;
|
||||
use function count;
|
||||
|
||||
/** @template-implements IteratorAggregate<int,Requirement> */
|
||||
class RequirementCollection implements Countable, IteratorAggregate {
|
||||
/** @var Requirement[] */
|
||||
private $requirements = [];
|
||||
|
||||
@@ -25,7 +31,7 @@ class RequirementCollection implements \Countable, \IteratorAggregate {
|
||||
}
|
||||
|
||||
public function count(): int {
|
||||
return \count($this->requirements);
|
||||
return count($this->requirements);
|
||||
}
|
||||
|
||||
public function getIterator(): RequirementCollectionIterator {
|
||||
|
||||
@@ -2,14 +2,19 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
class RequirementCollectionIterator implements \Iterator {
|
||||
use Iterator;
|
||||
use function count;
|
||||
|
||||
/** @template-implements Iterator<int,Requirement> */
|
||||
class RequirementCollectionIterator implements Iterator {
|
||||
/** @var Requirement[] */
|
||||
private $requirements;
|
||||
|
||||
@@ -25,7 +30,7 @@ class RequirementCollectionIterator implements \Iterator {
|
||||
}
|
||||
|
||||
public function valid(): bool {
|
||||
return $this->position < \count($this->requirements);
|
||||
return $this->position < count($this->requirements);
|
||||
}
|
||||
|
||||
public function key(): int {
|
||||
|
||||
3
vendor/phar-io/manifest/src/values/Type.php
vendored
3
vendor/phar-io/manifest/src/values/Type.php
vendored
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
|
||||
12
vendor/phar-io/manifest/src/values/Url.php
vendored
12
vendor/phar-io/manifest/src/values/Url.php
vendored
@@ -2,13 +2,17 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
use const FILTER_VALIDATE_URL;
|
||||
use function filter_var;
|
||||
|
||||
class Url {
|
||||
/** @var string */
|
||||
private $url;
|
||||
@@ -24,12 +28,10 @@ class Url {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*
|
||||
* @throws InvalidUrlException
|
||||
*/
|
||||
private function ensureUrlIsValid($url): void {
|
||||
if (\filter_var($url, \FILTER_VALIDATE_URL) === false) {
|
||||
private function ensureUrlIsValid(string $url): void {
|
||||
if (filter_var($url, FILTER_VALIDATE_URL) === false) {
|
||||
throw new InvalidUrlException;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user