Update composer installed packages
This commit is contained in:
8
www/vendor/sebastian/type/ChangeLog.md
vendored
8
www/vendor/sebastian/type/ChangeLog.md
vendored
@@ -2,11 +2,11 @@
|
||||
|
||||
All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.
|
||||
|
||||
## [4.0.0] - 2022-MM-DD
|
||||
## [3.1.0] - 2022-08-29
|
||||
|
||||
### Removed
|
||||
### Added
|
||||
|
||||
* This component is no longer supported on PHP 7.3 and PHP 7.4
|
||||
* [#21](https://github.com/sebastianbergmann/type/issues/21): Support `true` as stand-alone type
|
||||
|
||||
## [3.0.0] - 2022-03-15
|
||||
|
||||
@@ -130,7 +130,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
|
||||
|
||||
* Initial release based on [code contributed by Michel Hartmann to PHPUnit](https://github.com/sebastianbergmann/phpunit/pull/3673)
|
||||
|
||||
[4.0.0]: https://github.com/sebastianbergmann/type/compare/3.0...master
|
||||
[3.1.0]: https://github.com/sebastianbergmann/type/compare/3.0.0...3.1.0
|
||||
[3.0.0]: https://github.com/sebastianbergmann/type/compare/2.3.4...3.0.0
|
||||
[2.3.4]: https://github.com/sebastianbergmann/type/compare/ca39369c41313ed12c071ed38ecda8fcdb248859...2.3.4
|
||||
[2.3.3]: https://github.com/sebastianbergmann/type/compare/2.3.2...ca39369c41313ed12c071ed38ecda8fcdb248859
|
||||
|
||||
2
www/vendor/sebastian/type/composer.json
vendored
2
www/vendor/sebastian/type/composer.json
vendored
@@ -44,7 +44,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.1-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,10 @@ final class SimpleType extends Type
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->name === 'bool' && $other->name() === 'true') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->name === 'bool' && $other->name() === 'false') {
|
||||
return true;
|
||||
}
|
||||
|
||||
39
www/vendor/sebastian/type/src/type/TrueType.php
vendored
Normal file
39
www/vendor/sebastian/type/src/type/TrueType.php
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php declare(strict_types=1);
|
||||
/*
|
||||
* This file is part of sebastian/type.
|
||||
*
|
||||
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
namespace SebastianBergmann\Type;
|
||||
|
||||
final class TrueType extends Type
|
||||
{
|
||||
public function isAssignable(Type $other): bool
|
||||
{
|
||||
if ($other instanceof self) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return $other instanceof SimpleType &&
|
||||
$other->name() === 'bool' &&
|
||||
$other->value() === true;
|
||||
}
|
||||
|
||||
public function name(): string
|
||||
{
|
||||
return 'true';
|
||||
}
|
||||
|
||||
public function allowsNull(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isTrue(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
18
www/vendor/sebastian/type/src/type/Type.php
vendored
18
www/vendor/sebastian/type/src/type/Type.php
vendored
@@ -19,8 +19,14 @@ abstract class Type
|
||||
{
|
||||
public static function fromValue($value, bool $allowsNull): self
|
||||
{
|
||||
if ($value === false) {
|
||||
return new FalseType;
|
||||
if ($allowsNull === false) {
|
||||
if ($value === true) {
|
||||
return new TrueType;
|
||||
}
|
||||
|
||||
if ($value === false) {
|
||||
return new FalseType;
|
||||
}
|
||||
}
|
||||
|
||||
$typeName = gettype($value);
|
||||
@@ -48,6 +54,9 @@ abstract class Type
|
||||
case 'callable':
|
||||
return new CallableType($allowsNull);
|
||||
|
||||
case 'true':
|
||||
return new TrueType;
|
||||
|
||||
case 'false':
|
||||
return new FalseType;
|
||||
|
||||
@@ -94,6 +103,11 @@ abstract class Type
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isTrue(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function isFalse(): bool
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user