diff --git a/.travis.yml b/.travis.yml index 686e3ba..68b7076 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,3 +24,4 @@ install: script: - vendor/bin/phpunit - vendor/bin/phpcs . + - vendor/bin/psalm --show-info=false diff --git a/Behavioral/ChainOfResponsibilities/Tests/ChainTest.php b/Behavioral/ChainOfResponsibilities/Tests/ChainTest.php index 2dd6eb2..8923d3b 100644 --- a/Behavioral/ChainOfResponsibilities/Tests/ChainTest.php +++ b/Behavioral/ChainOfResponsibilities/Tests/ChainTest.php @@ -5,7 +5,10 @@ namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Tests; use DesignPatterns\Behavioral\ChainOfResponsibilities\Handler; use DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible\HttpInMemoryCacheHandler; use DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible\SlowDatabaseHandler; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\UriInterface; class ChainTest extends TestCase { @@ -24,11 +27,11 @@ class ChainTest extends TestCase public function testCanRequestKeyInFastStorage() { - $uri = $this->createMock('Psr\Http\Message\UriInterface'); + $uri = $this->createMock(UriInterface::class); $uri->method('getPath')->willReturn('/foo/bar'); $uri->method('getQuery')->willReturn('index=1'); - $request = $this->createMock('Psr\Http\Message\RequestInterface'); + $request = $this->createMock(RequestInterface::class); $request->method('getMethod') ->willReturn('GET'); $request->method('getUri')->willReturn($uri); @@ -38,11 +41,11 @@ class ChainTest extends TestCase public function testCanRequestKeyInSlowStorage() { - $uri = $this->createMock('Psr\Http\Message\UriInterface'); + $uri = $this->createMock(UriInterface::class); $uri->method('getPath')->willReturn('/foo/baz'); $uri->method('getQuery')->willReturn(''); - $request = $this->createMock('Psr\Http\Message\RequestInterface'); + $request = $this->createMock(RequestInterface::class); $request->method('getMethod') ->willReturn('GET'); $request->method('getUri')->willReturn($uri); diff --git a/Behavioral/Observer/UserObserver.php b/Behavioral/Observer/UserObserver.php index 4ecd107..c06863f 100644 --- a/Behavioral/Observer/UserObserver.php +++ b/Behavioral/Observer/UserObserver.php @@ -2,25 +2,27 @@ namespace DesignPatterns\Behavioral\Observer; +use SplSubject; + class UserObserver implements \SplObserver { /** - * @var User[] + * @var SplSubject[] */ private $changedUsers = []; /** * It is called by the Subject, usually by SplSubject::notify() * - * @param \SplSubject $subject + * @param SplSubject $subject */ - public function update(\SplSubject $subject) + public function update(SplSubject $subject) { $this->changedUsers[] = clone $subject; } /** - * @return User[] + * @return SplSubject[] */ public function getChangedUsers(): array { diff --git a/Behavioral/Specification/AndSpecification.php b/Behavioral/Specification/AndSpecification.php index 700b499..677deb1 100644 --- a/Behavioral/Specification/AndSpecification.php +++ b/Behavioral/Specification/AndSpecification.php @@ -10,7 +10,7 @@ class AndSpecification implements Specification private $specifications; /** - * @param Specification[] ...$specifications + * @param Specification[] $specifications */ public function __construct(Specification ...$specifications) { diff --git a/Behavioral/Specification/OrSpecification.php b/Behavioral/Specification/OrSpecification.php index 722f5bd..5307d47 100644 --- a/Behavioral/Specification/OrSpecification.php +++ b/Behavioral/Specification/OrSpecification.php @@ -10,14 +10,14 @@ class OrSpecification implements Specification private $specifications; /** - * @param Specification[] ...$specifications + * @param Specification[] $specifications */ public function __construct(Specification ...$specifications) { $this->specifications = $specifications; } - /** + /* * if at least one specification is true, return true, else return false */ public function isSatisfiedBy(Item $item): bool diff --git a/Creational/AbstractFactory/ShippableProduct.php b/Creational/AbstractFactory/ShippableProduct.php index 6979311..3521bd5 100644 --- a/Creational/AbstractFactory/ShippableProduct.php +++ b/Creational/AbstractFactory/ShippableProduct.php @@ -5,12 +5,12 @@ namespace DesignPatterns\Creational\AbstractFactory; class ShippableProduct implements Product { /** - * @var float + * @var int */ private $productPrice; /** - * @var float + * @var int */ private $shippingCosts; diff --git a/Creational/StaticFactory/FormatNumber.php b/Creational/StaticFactory/FormatNumber.php index 98be4e8..c6231e0 100644 --- a/Creational/StaticFactory/FormatNumber.php +++ b/Creational/StaticFactory/FormatNumber.php @@ -6,6 +6,6 @@ class FormatNumber implements Formatter { public function format(string $input): string { - return number_format($input); + return number_format((int) $input); } } diff --git a/Creational/StaticFactory/Tests/StaticFactoryTest.php b/Creational/StaticFactory/Tests/StaticFactoryTest.php index b289192..70646ef 100644 --- a/Creational/StaticFactory/Tests/StaticFactoryTest.php +++ b/Creational/StaticFactory/Tests/StaticFactoryTest.php @@ -2,6 +2,8 @@ namespace DesignPatterns\Creational\StaticFactory\Tests; +use DesignPatterns\Creational\StaticFactory\FormatNumber; +use DesignPatterns\Creational\StaticFactory\FormatString; use DesignPatterns\Creational\StaticFactory\StaticFactory; use PHPUnit\Framework\TestCase; @@ -9,18 +11,12 @@ class StaticFactoryTest extends TestCase { public function testCanCreateNumberFormatter() { - $this->assertInstanceOf( - 'DesignPatterns\Creational\StaticFactory\FormatNumber', - StaticFactory::factory('number') - ); + $this->assertInstanceOf(FormatNumber::class, StaticFactory::factory('number')); } public function testCanCreateStringFormatter() { - $this->assertInstanceOf( - 'DesignPatterns\Creational\StaticFactory\FormatString', - StaticFactory::factory('string') - ); + $this->assertInstanceOf(FormatString::class, StaticFactory::factory('string')); } public function testException() diff --git a/More/EAV/Entity.php b/More/EAV/Entity.php index cda0389..7e8724c 100644 --- a/More/EAV/Entity.php +++ b/More/EAV/Entity.php @@ -2,10 +2,12 @@ namespace DesignPatterns\More\EAV; +use SplObjectStorage; + class Entity { /** - * @var \SplObjectStorage + * @var SplObjectStorage */ private $values; @@ -20,7 +22,7 @@ class Entity */ public function __construct(string $name, $values) { - $this->values = new \SplObjectStorage(); + $this->values = new SplObjectStorage(); $this->name = $name; foreach ($values as $value) { diff --git a/More/EAV/Value.php b/More/EAV/Value.php index 4e993aa..b5423b8 100644 --- a/More/EAV/Value.php +++ b/More/EAV/Value.php @@ -24,6 +24,6 @@ class Value public function __toString(): string { - return sprintf('%s: %s', $this->attribute, $this->name); + return sprintf('%s: %s', (string) $this->attribute, $this->name); } } diff --git a/More/ServiceLocator/ServiceLocator.php b/More/ServiceLocator/ServiceLocator.php index 6c7bdf0..3dfb542 100644 --- a/More/ServiceLocator/ServiceLocator.php +++ b/More/ServiceLocator/ServiceLocator.php @@ -5,18 +5,17 @@ namespace DesignPatterns\More\ServiceLocator; class ServiceLocator { /** - * @var array|Service[] + * @var string[][] */ private $services = []; /** - * @var array|Service[] + * @var Service[] */ private $instantiated = []; public function addInstance(string $class, Service $service) { - $this->services[$class] = $service; $this->instantiated[$class] = $service; } @@ -55,6 +54,10 @@ class ServiceLocator throw new \OutOfRangeException('Too many arguments given'); } + if (!$object instanceof Service) { + throw new \InvalidArgumentException('Could not register service: is no instance of Service'); + } + $this->instantiated[$class] = $object; return $object; diff --git a/Structural/Facade/Tests/FacadeTest.php b/Structural/Facade/Tests/FacadeTest.php index 568c27d..452ca66 100644 --- a/Structural/Facade/Tests/FacadeTest.php +++ b/Structural/Facade/Tests/FacadeTest.php @@ -2,6 +2,7 @@ namespace DesignPatterns\Structural\Facade\Tests; +use DesignPatterns\Structural\Facade\Bios; use DesignPatterns\Structural\Facade\Facade; use DesignPatterns\Structural\Facade\OperatingSystem; use PHPUnit\Framework\TestCase; @@ -10,27 +11,20 @@ class FacadeTest extends TestCase { public function testComputerOn() { - /** @var OperatingSystem|\PHPUnit_Framework_MockObject_MockObject $os */ - $os = $this->createMock('DesignPatterns\Structural\Facade\OperatingSystem'); + $os = $this->createMock(OperatingSystem::class); $os->method('getName') ->will($this->returnValue('Linux')); - $bios = $this->getMockBuilder('DesignPatterns\Structural\Facade\Bios') - ->setMethods(['launch', 'execute', 'waitForKeyPress']) - ->disableAutoload() - ->getMock(); + $bios = $this->createMock(Bios::class); - $bios->expects($this->once()) - ->method('launch') + $bios->method('launch') ->with($os); + /** @noinspection PhpParamsInspection */ $facade = new Facade($bios, $os); - - // the facade interface is simple $facade->turnOn(); - // but you can also access the underlying components $this->assertSame('Linux', $os->getName()); } } diff --git a/Structural/Proxy/HeavyBankAccount.php b/Structural/Proxy/HeavyBankAccount.php index 37aa0ca..432ce0d 100644 --- a/Structural/Proxy/HeavyBankAccount.php +++ b/Structural/Proxy/HeavyBankAccount.php @@ -20,6 +20,6 @@ class HeavyBankAccount implements BankAccount // years and decades ago must be fetched from a database or web service // and the balance must be calculated from it - return array_sum($this->transactions); + return (int) array_sum($this->transactions); } } diff --git a/Structural/Registry/Tests/RegistryTest.php b/Structural/Registry/Tests/RegistryTest.php index 3e02909..11a3ba1 100644 --- a/Structural/Registry/Tests/RegistryTest.php +++ b/Structural/Registry/Tests/RegistryTest.php @@ -9,9 +9,6 @@ use PHPUnit\Framework\TestCase; class RegistryTest extends TestCase { - /** - * @var Service|MockObject - */ private $service; protected function setUp(): void @@ -21,6 +18,7 @@ class RegistryTest extends TestCase public function testSetAndGetLogger() { + /** @noinspection PhpParamsInspection */ Registry::set(Registry::LOGGER, $this->service); $this->assertSame($this->service, Registry::get(Registry::LOGGER)); diff --git a/composer.json b/composer.json index e71c87c..ce8912d 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,9 @@ "require-dev": { "phpunit/phpunit": "^8", "squizlabs/php_codesniffer": "^3", - "flyeralarm/php-code-validator": "^2.2" + "flyeralarm/php-code-validator": "^2.2", + "vimeo/psalm": "^3.4", + "psalm/plugin-phpunit": "^0.7.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 95ad521..14d11d8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ef568154a3e2f0f81df2f2c9f1948e80", + "content-hash": "370ddff8d6fbcca75679dfa3d207c3cd", "packages": [ { "name": "psr/http-message", @@ -58,6 +58,248 @@ } ], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "c6a775a6c9fdd9ca4c909647a19b02d2d11a0568" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/c6a775a6c9fdd9ca4c909647a19b02d2d11a0568", + "reference": "c6a775a6c9fdd9ca4c909647a19b02d2d11a0568", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "phpstan/phpstan": "^0.8.5", + "phpunit/phpunit": "^6.0.9", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "time": "2019-08-02T20:37:42+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.6.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "47908f8e8bb2da8af4e59028200758477bc927ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/47908f8e8bb2da8af4e59028200758477bc927ea", + "reference": "47908f8e8bb2da8af4e59028200758477bc927ea", + "shasum": "" + }, + "require": { + "amphp/amp": "^2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "friendsofphp/php-cs-fixer": "^2.3", + "infection/infection": "^0.9.3", + "phpunit/phpunit": "^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "time": "2019-07-26T21:22:49+00:00" + }, + { + "name": "composer/semver", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5", + "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + }, + "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": "2019-03-19T17:25:45+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.3.3", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", + "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "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": "2019-05-27T17:52:04+00:00" + }, { "name": "doctrine/instantiator", "version": "1.2.0", @@ -114,6 +356,94 @@ ], "time": "2019-03-17T17:37:11+00:00" }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "241c470695366e7b83672be04ea0e64d8085a551" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/241c470695366e7b83672be04ea0e64d8085a551", + "reference": "241c470695366e7b83672be04ea0e64d8085a551", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0", + "php": ">=7.0", + "phpdocumentor/reflection-docblock": "^4.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "time": "2018-09-10T08:58:41+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f", + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpstan/phpstan": "*", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "time": "2019-06-23T21:03:50+00:00" + }, { "name": "flyeralarm/php-code-validator", "version": "2.2.0", @@ -200,6 +530,202 @@ ], "time": "2019-08-09T12:45:53+00:00" }, + { + "name": "netresearch/jsonmapper", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06", + "reference": "0d4d1b48d682a93b6bfedf60b88c7750e9cb0b06", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4", + "squizlabs/php_codesniffer": "~1.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "role": "Developer", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "time": "2019-08-15T19:41:25+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "e612609022e935f3d0337c1295176505b41188c8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8", + "reference": "e612609022e935f3d0337c1295176505b41188c8", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2019-08-12T20:17:41+00:00" + }, + { + "name": "ocramius/package-versions", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2019-02-21T12:16:21+00:00" + }, + { + "name": "openlss/lib-array2xml", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "time": "2019-03-29T20:06:56+00:00" + }, { "name": "phar-io/manifest", "version": "1.0.3", @@ -852,6 +1378,159 @@ ], "time": "2019-08-11T06:56:55+00:00" }, + { + "name": "psalm/plugin-phpunit", + "version": "0.7", + "source": { + "type": "git", + "url": "https://github.com/psalm/phpunit-psalm-plugin.git", + "reference": "69aaf6be9f3edecf0158d08dc073f9867e890387" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/phpunit-psalm-plugin/zipball/69aaf6be9f3edecf0158d08dc073f9867e890387", + "reference": "69aaf6be9f3edecf0158d08dc073f9867e890387", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4", + "ocramius/package-versions": "^1.3", + "phpunit/phpunit": "^6.0 || ^7.0 || ^8.0", + "vimeo/psalm": "^3.2.11 || ^3.3 || dev-master" + }, + "require-dev": { + "codeception/base": "^2.5", + "squizlabs/php_codesniffer": "^3.3.1", + "weirdan/codeception-psalm-module": "^0.2.1" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psalm\\PhpUnitPlugin\\": [ + "." + ], + "Psalm\\PhpUnitPlugin\\Hooks\\": [ + "hooks" + ], + "Psalm\\PhpUnitPlugin\\Exception\\": [ + "Exception" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Brown", + "email": "github@muglug.com" + } + ], + "description": "Psalm plugin for PHPUnit", + "time": "2019-07-10T21:05:07+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/log", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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": "2018-11-20T15:27:04+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -1518,6 +2197,81 @@ ], "time": "2019-04-10T23:49:02+00:00" }, + { + "name": "symfony/console", + "version": "v4.3.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "de63799239b3881b8a08f8481b22348f77ed7b36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36", + "reference": "de63799239b3881b8a08f8481b22348f77ed7b36", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3", + "symfony/process": "<3.3" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "^4.3", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0", + "symfony/var-dumper": "^4.3" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-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": "2019-08-26T08:26:39+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.12.0", @@ -1576,6 +2330,181 @@ ], "time": "2019-08-06T08:03:45+00:00" }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12-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": "2019-08-06T08:03:45+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.12.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", + "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.12-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": "2019-08-06T08:03:45+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v1.1.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-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-08-20T14:44:19+00:00" + }, { "name": "theseer/tokenizer", "version": "1.1.3", @@ -1616,6 +2545,93 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "time": "2019-06-13T22:48:21+00:00" }, + { + "name": "vimeo/psalm", + "version": "3.4.12", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "86e5e50c1bb492045e70f2ebe1da3cad06e4e9b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/86e5e50c1bb492045e70f2ebe1da3cad06e4e9b2", + "reference": "86e5e50c1bb492045e70f2ebe1da3cad06e4e9b2", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.1", + "amphp/byte-stream": "^1.5", + "composer/xdebug-handler": "^1.1", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.4", + "netresearch/jsonmapper": "^1.0", + "nikic/php-parser": "^4.2", + "ocramius/package-versions": "^1.2", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1", + "sebastian/diff": "^3.0", + "symfony/console": "^3.3||^4.0", + "webmozart/glob": "^4.1", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "friendsofphp/php-cs-fixer": "^2.15", + "phpmyadmin/sql-parser": "^5.0", + "phpunit/phpunit": "^7.5 || ^8.0", + "psalm/plugin-phpunit": "^0.6", + "slevomat/coding-standard": "^5.0", + "squizlabs/php_codesniffer": "3.4.0", + "symfony/process": "^4.3" + }, + "suggest": { + "ext-igbinary": "^2.0.5" + }, + "bin": [ + "psalm", + "psalter", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\Plugin\\": "src/Psalm/Plugin", + "Psalm\\": "src/Psalm" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "time": "2019-08-20T18:26:32+00:00" + }, { "name": "webmozart/assert", "version": "1.5.0", @@ -1665,6 +2681,99 @@ "validate" ], "time": "2019-08-24T08:43:50+00:00" + }, + { + "name": "webmozart/glob", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/glob.git", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0", + "webmozart/path-util": "^2.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1", + "symfony/filesystem": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Glob\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A PHP implementation of Ant's glob.", + "time": "2015-12-29T11:14:33+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..1061909 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +