-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set version to 0.12.0 and add composer dependencies
- Loading branch information
Dominic Tubach
committed
Dec 13, 2024
1 parent
d891f18
commit 91c2632
Showing
684 changed files
with
103,266 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
// autoload.php @generated by Composer | ||
|
||
if (PHP_VERSION_ID < 50600) { | ||
if (!headers_sent()) { | ||
header('HTTP/1.1 500 Internal Server Error'); | ||
} | ||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; | ||
if (!ini_get('display_errors')) { | ||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { | ||
fwrite(STDERR, $err); | ||
} elseif (!headers_sent()) { | ||
echo $err; | ||
} | ||
} | ||
trigger_error( | ||
$err, | ||
E_USER_ERROR | ||
); | ||
} | ||
|
||
require_once __DIR__ . '/composer/autoload_real.php'; | ||
|
||
return ComposerAutoloaderInitbbd56952e1677721dd4d6854404779cd::getLoader(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Copyright (c) 2011-2013, Benjamin Eberlei | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
- Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
- Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
"name": "beberlei/assert", | ||
"description": "Thin assertion library for input validation in business models.", | ||
"authors": [ | ||
{ | ||
"name": "Benjamin Eberlei", | ||
"email": "[email protected]", | ||
"role": "Lead Developer" | ||
}, | ||
{ | ||
"name": "Richard Quadling", | ||
"email": "[email protected]", | ||
"role": "Collaborator" | ||
} | ||
], | ||
"license": "BSD-2-Clause", | ||
"keywords": [ | ||
"assert", | ||
"assertion", | ||
"validation" | ||
], | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"require": { | ||
"php": "^7.1 || ^8.0", | ||
"ext-simplexml": "*", | ||
"ext-mbstring": "*", | ||
"ext-ctype": "*", | ||
"ext-json": "*" | ||
}, | ||
"require-dev": { | ||
"friendsofphp/php-cs-fixer": "*", | ||
"phpstan/phpstan": "*", | ||
"phpunit/phpunit": ">=6.0.0", | ||
"yoast/phpunit-polyfills": "^0.1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Assert\\": "lib/Assert" | ||
}, | ||
"files": [ | ||
"lib/Assert/functions.php" | ||
] | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Assert\\Tests\\": "tests/Assert/Tests" | ||
}, | ||
"files": [ | ||
"tests/Assert/Tests/Fixtures/functions.php" | ||
] | ||
}, | ||
"scripts": { | ||
"assert:generate-docs": "php bin/generate_method_docs.php", | ||
"assert:cs-lint": "php-cs-fixer fix --diff -vvv --dry-run", | ||
"assert:cs-fix": "php-cs-fixer fix . -vvv || true", | ||
"assert:sa-code": "vendor/bin/phpstan analyse --configuration=phpstan-code.neon --no-progress --ansi -l 7 bin lib", | ||
"assert:sa-tests": "vendor/bin/phpstan analyse --configuration=phpstan-tests.neon --no-progress --ansi -l 7 tests" | ||
}, | ||
"suggest": { | ||
"ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
/** | ||
* Assert | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so I can send you a copy immediately. | ||
*/ | ||
|
||
namespace Assert; | ||
|
||
/** | ||
* AssertionChain factory. | ||
*/ | ||
abstract class Assert | ||
{ | ||
/** @var string */ | ||
protected static $lazyAssertionExceptionClass = LazyAssertionException::class; | ||
|
||
/** @var string */ | ||
protected static $assertionClass = Assertion::class; | ||
|
||
/** | ||
* Start validation on a value, returns {@link AssertionChain}. | ||
* | ||
* The invocation of this method starts an assertion chain | ||
* that is happening on the passed value. | ||
* | ||
* @param mixed $value | ||
* @param string|callable|null $defaultMessage | ||
* | ||
* @example | ||
* | ||
* Assert::that($value)->notEmpty()->integer(); | ||
* Assert::that($value)->nullOr()->string()->startsWith("Foo"); | ||
* | ||
* The assertion chain can be stateful, that means be careful when you reuse | ||
* it. You should never pass around the chain. | ||
*/ | ||
public static function that($value, $defaultMessage = null, ?string $defaultPropertyPath = null): AssertionChain | ||
{ | ||
$assertionChain = new AssertionChain($value, $defaultMessage, $defaultPropertyPath); | ||
|
||
return $assertionChain->setAssertionClassName(static::$assertionClass); | ||
} | ||
|
||
/** | ||
* Start validation on a set of values, returns {@link AssertionChain}. | ||
* | ||
* @param mixed $values | ||
* @param string|callable|null $defaultMessage | ||
*/ | ||
public static function thatAll($values, $defaultMessage = null, ?string $defaultPropertyPath = null): AssertionChain | ||
{ | ||
return static::that($values, $defaultMessage, $defaultPropertyPath)->all(); | ||
} | ||
|
||
/** | ||
* Start validation and allow NULL, returns {@link AssertionChain}. | ||
* | ||
* @param mixed $value | ||
* @param string|callable|null $defaultMessage | ||
*/ | ||
public static function thatNullOr($value, $defaultMessage = null, ?string $defaultPropertyPath = null): AssertionChain | ||
{ | ||
return static::that($value, $defaultMessage, $defaultPropertyPath)->nullOr(); | ||
} | ||
|
||
/** | ||
* Create a lazy assertion object. | ||
*/ | ||
public static function lazy(): LazyAssertion | ||
{ | ||
$lazyAssertion = new LazyAssertion(); | ||
|
||
return $lazyAssertion | ||
->setAssertClass(\get_called_class()) | ||
->setExceptionClass(static::$lazyAssertionExceptionClass); | ||
} | ||
} |
Oops, something went wrong.